Skip to content

Instantly share code, notes, and snippets.

@dfranciscus
Created April 23, 2019 13:55
Show Gist options
  • Save dfranciscus/ff3eeda9241041d7a31ba163c61e5050 to your computer and use it in GitHub Desktop.
Save dfranciscus/ff3eeda9241041d7a31ba163c61e5050 to your computer and use it in GitHub Desktop.
Boxstarter-test
$packages = [System.Collections.ArrayList]@(choco outdated -r --ignore-unfound --ignore-pinned | Foreach-Object {
($_.split("|"))[0]})
foreach ($package in $packages)
{
choco upgrade $package -r -y --timeout=600 | Out-File ("c:\Windows\Temp\choco-" + $package + ".txt")
if ($LASTEXITCODE -ne 0)
{
$Result = 'Failed'
}
else
{
$Result = 'Success'
}
$Output = [PSCustomObject]@{
Name = $Package
Result = $Result
Computer = $Env:COMPUTERNAME
}
$output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment