From ef504e5212cdb49fde3a35ef405f158a35cec6ac Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sun, 21 Oct 2018 02:38:15 +0800 Subject: [PATCH] Fix `psmodulerestore` path when built in VSCode (#8075) --- build.psm1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 931fd8977f..fa6a8f3e36 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