diff --git a/PowerShellGithubDev.psm1 b/PowerShellGithubDev.psm1 new file mode 100644 index 000000000..7d9f0a58a --- /dev/null +++ b/PowerShellGithubDev.psm1 @@ -0,0 +1,46 @@ +function Start-DevPSGithub +{ + param( + [switch]$ZapDisable, + [string[]]$ArgumentList = '', + [switch]$LoadProfile, + [string]$binDir = "$PSScriptRoot\binFull" + ) + + try + { + if ($LoadProfile -eq $false) + { + $ArgumentList += '-noprofile' + } + + $env:DEVPATH = $binDir + if ($ZapDisable) + { + $env:COMPLUS_ZapDisable = 1 + } + + if (!(Test-Path $binDir\powershell.exe.config)) + { + $configContents = @" + + + + + + +"@ + $configContents | Out-File -Encoding Ascii $binDir\powershell.exe.config + } + + Start-Process -FilePath $binDir\powershell.exe -ArgumentList "$ArgumentList" + } + finally + { + ri env:DEVPATH + if ($ZapDisable) + { + ri env:COMPLUS_ZapDisable + } + } +} \ No newline at end of file