From 17d6ee4862c1f7151d362087ccacfce9ac75c9fc Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 3 Feb 2016 10:53:43 -0800 Subject: [PATCH] Add PowerShellGithubDev.psm1 module to run FullCLR powershell --- PowerShellGithubDev.psm1 | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 PowerShellGithubDev.psm1 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