mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add Start-PSBuild -StopDevPowerShell switch
This commit is contained in:
+21
-2
@@ -30,6 +30,10 @@ if ($IsLinux) {
|
||||
function Start-PSBuild {
|
||||
[CmdletBinding(DefaultParameterSetName='CoreCLR')]
|
||||
param(
|
||||
# When specified this switch will stops running dev powershell
|
||||
# to help avoid compilation error, because file are in use.
|
||||
[switch]$StopDevPowerShell,
|
||||
|
||||
[switch]$NoPath,
|
||||
[switch]$Restore,
|
||||
[string]$Output,
|
||||
@@ -70,6 +74,18 @@ function Start-PSBuild {
|
||||
[string]$Configuration
|
||||
)
|
||||
|
||||
function Stop-DevPowerShell
|
||||
{
|
||||
Get-Process powershell* |
|
||||
Where-Object {
|
||||
$_.Modules |
|
||||
Where-Object {
|
||||
$_.FileName -eq (Resolve-Path $script:Options.Output).Path
|
||||
}
|
||||
} |
|
||||
Stop-Process -Verbose
|
||||
}
|
||||
|
||||
if ($Clean)
|
||||
{
|
||||
log "Cleaning your working directory. You can also do it with 'git clean -fdX'"
|
||||
@@ -153,6 +169,11 @@ function Start-PSBuild {
|
||||
}
|
||||
$script:Options = New-PSOptions @OptionsArguments
|
||||
|
||||
if ($StopDevPowerShell)
|
||||
{
|
||||
Stop-DevPowerShell
|
||||
}
|
||||
|
||||
# setup arguments
|
||||
$Arguments = @()
|
||||
if ($Publish) {
|
||||
@@ -273,7 +294,6 @@ function Start-PSBuild {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function New-PSOptions {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
@@ -729,7 +749,6 @@ function Publish-NuGetFeed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Start-DevPowerShell {
|
||||
param(
|
||||
[switch]$ZapDisable,
|
||||
|
||||
Reference in New Issue
Block a user