From dacbcc81b7168f5b1e2e77182e5904fd06e0fc37 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 18 Oct 2018 21:23:52 +0800 Subject: [PATCH] fix psmodulerestore path when built in VSCode --- build.psm1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 89c45bd1937..6dc755aaf8a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -362,7 +362,13 @@ Fix steps: } # Get the folder path where pwsh.exe is located. - $publishPath = Split-Path $Options.Output -Parent + if ((Split-Path $Options.Output -Leaf) -like "pwsh*") { + $publishPath = Split-Path $Options.Output -Parent + } + else { + $publishPath = $Options.Output + } + try { # Relative paths do not work well if cwd is not changed to project Push-Location $Options.Top