From 05ef79784995da6e85097228331ea6c19d9c1e4b Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 7 Mar 2016 16:12:50 -0800 Subject: [PATCH] Add -Clean switch to Start-PSBuild And use full names of cmdlets. --- PowerShellGitHubDev.psm1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 0d4ce06b1e..488cba6e01 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -21,6 +21,7 @@ function Start-PSBuild { param( [switch]$Restore, + [switch]$Clean, [string]$Output = "$PSScriptRoot/bin", # These runtimes must match those in project.json # We do not use ValidateScript since we want tab completion @@ -37,6 +38,10 @@ function Start-PSBuild throw "Build dependency 'dotnet' not found in PATH! See: https://dotnet.github.io/getting-started/" } + if ($Clean) { + Remove-Item -Force -Recurse $Output + } + New-Item -Force -Type Directory $Output | Out-Null $Top = "$PSScriptRoot/src/Microsoft.PowerShell.Linux.Host" @@ -58,16 +63,16 @@ function Start-PSBuild Write-Host "Building $Lib" try { - pushd $Native + Push-Location $Native cmake -DCMAKE_BUILD_TYPE=Debug . make -j make test } finally { - popd + Pop-Location } if (-Not (Test-Path $Lib)) { throw "Compilation of $Lib failed" } - cp $Lib $Output + Copy-Item $Lib $Output } Write-Host "Building PowerShell"