mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-24 10:23:26 +08:00
f8abd74658
FullCLR windows host doesn't read keys when run in separate window. Fix: don't use Start-Process -Wait $false -NoNewWindow $false Instead, ommit this parameters. Seems like a bug in Start-Process.
58 lines
1.3 KiB
PowerShell
58 lines
1.3 KiB
PowerShell
function Start-DevPSGithub
|
|
{
|
|
param(
|
|
[switch]$ZapDisable,
|
|
[string[]]$ArgumentList = '',
|
|
[switch]$LoadProfile,
|
|
[string]$binDir = "$PSScriptRoot\binFull",
|
|
[switch]$NoNewWindow
|
|
)
|
|
|
|
try
|
|
{
|
|
if ($LoadProfile -eq $false)
|
|
{
|
|
$ArgumentList = @('-noprofile') + $ArgumentList
|
|
}
|
|
|
|
$env:DEVPATH = $binDir
|
|
if ($ZapDisable)
|
|
{
|
|
$env:COMPLUS_ZapDisable = 1
|
|
}
|
|
|
|
if (!(Test-Path $binDir\powershell.exe.config))
|
|
{
|
|
$configContents = @"
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
<configuration>
|
|
<runtime>
|
|
<developmentMode developerInstallation="true"/>
|
|
</runtime>
|
|
</configuration>
|
|
"@
|
|
$configContents | Out-File -Encoding Ascii $binDir\powershell.exe.config
|
|
}
|
|
|
|
# splatting for the win
|
|
$startProcessArgs = @{
|
|
FilePath = "$binDir\powershell.exe"
|
|
ArgumentList = "$ArgumentList"
|
|
}
|
|
|
|
if ($NoNewWindow) {
|
|
$startProcessArgs.NoNewWindow = $true
|
|
$startProcessArgs.Wait = $true
|
|
}
|
|
|
|
Start-Process @startProcessArgs
|
|
}
|
|
finally
|
|
{
|
|
ri env:DEVPATH
|
|
if ($ZapDisable)
|
|
{
|
|
ri env:COMPLUS_ZapDisable
|
|
}
|
|
}
|
|
} |