Last active
June 27, 2018 12:24
-
-
Save turboBasic/3e129ef62af53a69ca9949a77e79fef3 to your computer and use it in GitHub Desktop.
[Get-OutdatedChocoPackages.ps1] Get outdated #chocolatey packages #powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$outdated = (choco outdated) -join "`n" | |
$outdated = ($outdated -replace '(?sx) ^ .* \n\n (.*) \n\n .* $', '$1') -split "`n" | |
$outdated | | |
ForEach-Object { | |
if ($_ -match '(?x) ^ (?<name> [^|]+) \| (?<old> [^|]+) \| (?<new> [^|]+) \| (?<pinned> [^|]+) $') { | |
[psCustomObject] $Matches | |
} | |
} | | |
Select-Object Name, New, Old, Pinned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment