Add PowerShellGithubDev.psm1 module to run FullCLR powershell

This commit is contained in:
Sergei Vorobev 2016-02-03 10:53:43 -08:00
parent 48ae539f8f
commit 17d6ee4862

46
PowerShellGithubDev.psm1 Normal file
View file

@ -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 = @"
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<developmentMode developerInstallation="true"/>
</runtime>
</configuration>
"@
$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
}
}
}