Added $Parallel switch
This commit is contained in:
@@ -9,6 +9,7 @@ function Invoke-BoxStarterRemoteUpgrade {
|
|||||||
[string[]]$ExcludedPackages,
|
[string[]]$ExcludedPackages,
|
||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
[string]$ScriptPath,
|
[string]$ScriptPath,
|
||||||
|
[switch]$Parallel
|
||||||
)
|
)
|
||||||
|
|
||||||
#Create dynamic upgrade list
|
#Create dynamic upgrade list
|
||||||
@@ -39,9 +40,13 @@ function Invoke-BoxStarterRemoteUpgrade {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#Upgrade computers with Boxstarter
|
#Upgrade computers with Boxstarter
|
||||||
|
if (!$Parallel){
|
||||||
Install-BoxstarterPackage -ComputerName $ComputerName -PackageName $ScriptPath
|
Install-BoxstarterPackage -ComputerName $ComputerName -PackageName $ScriptPath
|
||||||
|
}
|
||||||
|
else {
|
||||||
#Upgrade computers in parallel with Boxstarter
|
#Upgrade computers in parallel with Boxstarter
|
||||||
# $ComputerName | ForEach-Object {
|
$ComputerName | ForEach-Object {
|
||||||
# start-process -RedirectStandardOutput C:\scripts\powershell\$_.txt -FilePath powershell -ArgumentList "-windowstyle hidden Install-BoxstarterPackage -ComputerName $_ -PackageName $ScriptPath" -PassThru
|
start-process -RedirectStandardOutput C:\Windows\Temp\$_.txt -FilePath powershell -ArgumentList "-windowstyle hidden Install-BoxstarterPackage -ComputerName $_ -PackageName $ScriptPath" -PassThru
|
||||||
# }
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user