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
No EOL
1.3 KiB
PowerShell
58 lines
No EOL
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
|
|
}
|
|
}
|
|
} |