Merge pull request #1541 from PowerShell/vors/start-devpowershell
Start-DevPowerShell for all platforms and editions
This commit is contained in:
commit
be319625a1
|
@ -42,7 +42,7 @@ test_script:
|
|||
$env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR))
|
||||
Write-Host -Foreground Green 'Run FullCLR tests'
|
||||
$testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml"
|
||||
Start-DevPowerShell -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Invoke-Pester test/fullCLR -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
|
||||
Start-DevPowerShell -FullCLR -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Invoke-Pester test/fullCLR -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
|
||||
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR))
|
||||
#
|
||||
# Fail the build, if tests failed
|
||||
|
|
13
build.psm1
13
build.psm1
|
@ -884,16 +884,23 @@ function Publish-NuGetFeed
|
|||
|
||||
function Start-DevPowerShell {
|
||||
param(
|
||||
[switch]$FullCLR,
|
||||
[switch]$ZapDisable,
|
||||
[string[]]$ArgumentList = '',
|
||||
[switch]$LoadProfile,
|
||||
[string]$binDir = (Split-Path (New-PSOptions -FullCLR).Output),
|
||||
[string]$binDir = (Split-Path (New-PSOptions -FullCLR:$FullCLR).Output),
|
||||
[switch]$NoNewWindow,
|
||||
[string]$Command,
|
||||
[switch]$KeepPSModulePath
|
||||
)
|
||||
|
||||
try {
|
||||
if ((-not $NoNewWindow) -and ($IsCoreCLR))
|
||||
{
|
||||
Write-Warning "Start-DevPowerShell -NoNewWindow is currently implied in PowerShellCore edition https://github.com/PowerShell/PowerShell/issues/1543"
|
||||
$NoNewWindow = $true
|
||||
}
|
||||
|
||||
if (-not $LoadProfile) {
|
||||
$ArgumentList = @('-noprofile') + $ArgumentList
|
||||
}
|
||||
|
@ -918,7 +925,7 @@ function Start-DevPowerShell {
|
|||
$env:COMPLUS_ZapDisable = 1
|
||||
}
|
||||
|
||||
if (-not (Test-Path $binDir\powershell.exe.config)) {
|
||||
if ($FullCLR -and (-not (Test-Path $binDir\powershell.exe.config))) {
|
||||
$configContents = @"
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
|
@ -932,7 +939,7 @@ function Start-DevPowerShell {
|
|||
|
||||
# splatting for the win
|
||||
$startProcessArgs = @{
|
||||
FilePath = "$binDir\powershell.exe"
|
||||
FilePath = "$binDir\powershell"
|
||||
ArgumentList = "$ArgumentList"
|
||||
}
|
||||
|
||||
|
|
|
@ -92,20 +92,20 @@ Assembly Cache (GAC), not your output directory.
|
|||
Use `Start-DevPowerShell` helper funciton, to workaround it with `$env:DEVPATH`
|
||||
|
||||
```powershell
|
||||
Start-DevPowerShell
|
||||
Start-DevPowerShell -FullCLR
|
||||
```
|
||||
|
||||
This command has a reasonable default to run `powershell.exe` from the build output folder.
|
||||
If you are building an unusual configuration (i.e. not `Debug`), you can explicitly specify path to the bin directory
|
||||
|
||||
```powershell
|
||||
Start-DevPowerShell -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451
|
||||
Start-DevPowerShell -FullCLR -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451
|
||||
```
|
||||
|
||||
Or more programmatically:
|
||||
|
||||
```powershell
|
||||
Start-DevPowerShell -binDir (Split-Path -Parent (Get-PSOutput))
|
||||
Start-DevPowerShell -FullCLR -binDir (Split-Path -Parent (Get-PSOutput))
|
||||
```
|
||||
|
||||
The default for produced `powershell.exe` is x64.
|
||||
|
|
Loading…
Reference in a new issue