Created
June 6, 2023 00:18
-
-
Save mavaddat/63196da3451889428c74452c21d9d825 to your computer and use it in GitHub Desktop.
Update all out-of-date PowerShell modules using this one-liner.
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
Get-Module | Where-Object { $null -ne ($remoteVer = Find-Module -Name $_.Name -AllowPrerelease -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Version -ErrorAction SilentlyContinue) -and $_.Version -ne $remoteVer } | ForEach-Object { [pscustomobject]@{ Name = $_.Name; RemoteVer = $remoteVer; ThisVer = $_.Version } | Format-Table; Update-Module -Name $_.Name -AllowPrerelease -Verbose } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment