mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 03:46:23 +08:00
Start-DevPowerShell
: add -Configuration
and handle -ArgumentList
more properly (#7300)
- Allow specifying the configuration, rather than the `bin` folder. - Do not attempt to pass null/empty `ArgumentList` to `Start-Process`.
This commit is contained in:
parent
d97c9e701b
commit
e7c315b65c
23
build.psm1
23
build.psm1
@ -1858,16 +1858,25 @@ function Publish-NuGetFeed
|
||||
}
|
||||
|
||||
function Start-DevPowerShell {
|
||||
[CmdletBinding(DefaultParameterSetName='ConfigurationParamSet')]
|
||||
param(
|
||||
[string[]]$ArgumentList = '',
|
||||
[string[]]$ArgumentList = @(),
|
||||
[switch]$LoadProfile,
|
||||
[string]$binDir = (Split-Path (New-PSOptions).Output),
|
||||
[Parameter(ParameterSetName='ConfigurationParamSet')]
|
||||
[ValidateSet("Debug", "Release", "CodeCoverage", '')] # should match New-PSOptions -Configuration values
|
||||
[string]$Configuration,
|
||||
[Parameter(ParameterSetName='BinDirParamSet')]
|
||||
[string]$BinDir,
|
||||
[switch]$NoNewWindow,
|
||||
[string]$Command,
|
||||
[switch]$KeepPSModulePath
|
||||
)
|
||||
|
||||
try {
|
||||
if (-not $BinDir) {
|
||||
$BinDir = Split-Path (New-PSOptions -Configuration $Configuration).Output
|
||||
}
|
||||
|
||||
if ((-not $NoNewWindow) -and ($Environment.IsCoreCLR)) {
|
||||
Write-Warning "Start-DevPowerShell -NoNewWindow is currently implied in PowerShellCore edition https://github.com/PowerShell/PowerShell/issues/1543"
|
||||
$NoNewWindow = $true
|
||||
@ -1888,12 +1897,16 @@ function Start-DevPowerShell {
|
||||
$ArgumentList = $ArgumentList + @("-command $Command")
|
||||
}
|
||||
|
||||
$env:DEVPATH = $binDir
|
||||
$env:DEVPATH = $BinDir
|
||||
|
||||
|
||||
# splatting for the win
|
||||
$startProcessArgs = @{
|
||||
FilePath = "$binDir\pwsh"
|
||||
ArgumentList = "$ArgumentList"
|
||||
FilePath = "$BinDir\pwsh"
|
||||
}
|
||||
|
||||
if ($ArgumentList) {
|
||||
$startProcessArgs.ArgumentList = $ArgumentList
|
||||
}
|
||||
|
||||
if ($NoNewWindow) {
|
||||
|
Loading…
Reference in New Issue
Block a user