From e1c0f680983dc624cf190164bfd3ff391f5292e6 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 26 Feb 2016 18:49:51 -0800 Subject: [PATCH] Add switch to Start-PSBuild any specific -Runtime Much better argument passing to CLI. Thanks @vors. --- PowerShellGitHubDev.psm1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 0f28bb92b6..91f0a4eff9 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -21,7 +21,8 @@ function Start-PSBuild { param( [switch]$Restore, - [string]$Output = "$PSScriptRoot/bin" + [string]$Output = "$PSScriptRoot/bin", + [string]$Runtime ) if (-Not (Get-Command "dotnet" -ErrorAction SilentlyContinue)) { @@ -63,11 +64,15 @@ function Start-PSBuild Write-Host "Building PowerShell" - $Configuration = - if ($IsLinux -Or $IsOSX) { "Linux" } - elseif ($IsWindows) { "Debug" } + $Arguments = "--framework", "netstandardapp1.5", "--output", $Output - dotnet publish -o $Output -c $Configuration -f "netstandardapp1.5" $Top + if ($IsLinux -Or $IsOSX) { $Arguments += "--configuration", "Linux" } + + if ($Runtime) { $Arguments += "--runtime", $Runtime } + + $Arguments += $Top + + dotnet publish $Arguments } function Start-PSPackage