Fixed some formatting
This commit is contained in:
@@ -23,29 +23,22 @@ function Invoke-ChocoRemoteUpgrade {
|
|||||||
$packages = [System.Collections.ArrayList]@(choco outdated -r --ignore-unfound --ignore-pinned | Foreach-Object {
|
$packages = [System.Collections.ArrayList]@(choco outdated -r --ignore-unfound --ignore-pinned | Foreach-Object {
|
||||||
($_.split("|"))[0]})
|
($_.split("|"))[0]})
|
||||||
|
|
||||||
foreach ($ExcludedPackage in $ExcludedPackages)
|
foreach ($ExcludedPackage in $ExcludedPackages){
|
||||||
{
|
if ($packages -contains $ExcludedPackage){
|
||||||
if ($packages -contains $ExcludedPackage)
|
|
||||||
{
|
|
||||||
$packages.Remove($ExcludedPackage) | Out-Null
|
$packages.Remove($ExcludedPackage) | Out-Null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($AddedBasePackage in $AdditionalPackage)
|
foreach ($AddedBasePackage in $AdditionalPackage){
|
||||||
{
|
if ($packages -notcontains $AddedBasePackage){
|
||||||
if ($packages -notcontains $AddedBasePackage)
|
|
||||||
{
|
|
||||||
$packages.Add($AddedBasePackage) | Out-Null
|
$packages.Add($AddedBasePackage) | Out-Null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($package in $packages)
|
foreach ($package in $packages){
|
||||||
{
|
|
||||||
choco upgrade $package -r -y --timeout=600 | Out-File ("c:\Windows\Temp\choco-" + $package + ".txt")
|
choco upgrade $package -r -y --timeout=600 | Out-File ("c:\Windows\Temp\choco-" + $package + ".txt")
|
||||||
if ($LASTEXITCODE -ne 0)
|
if ($LASTEXITCODE -ne 0){
|
||||||
{
|
|
||||||
$Result = 'Failed'
|
$Result = 'Failed'
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
|
||||||
$Result = 'Success'
|
$Result = 'Success'
|
||||||
}
|
}
|
||||||
[PSCustomObject]@{
|
[PSCustomObject]@{
|
||||||
|
|||||||
Reference in New Issue
Block a user