@@ -154,23 +154,23 @@ Begin
154154 [CmdletBinding ()] Param ()
155155 if ($Script :IsNotAdministrator ) {Write-Warning " Not running as admin; skipping Essential." ; return }
156156 Write-Step " $ ( [char ]0xD83D ) $ ( [char ]0xDD1C ) Checking for essential updates"
157- if (Get-Command choco - ErrorAction Ignore)
157+ if (Get-Command winget - ErrorAction Ignore)
158158 {
159- if (choco outdated - r |
160- ConvertFrom-Csv - Delimiter ' |' - Header PackageName, LocalVersion, AvailableVersion |
161- Where-Object PackageName -in powershell, powershell- core, microsoft- windows- terminal)
162- {Invoke-EssentialUpdate }
163- }
164- elseif (Get-Command winget - ErrorAction Ignore)
165- {
166- if (@ (winget list Microsoft.WindowsTerminal |
159+ if (@ (winget list - e -- id Microsoft.WindowsTerminal - s winget -- upgrade- available -- disable-interactivity -- nowarn |
167160 Select-Object - Skip 2 - First 1 |
168161 Select-String Available &&
169- winget list Microsoft.PowerShell |
162+ winget list - e -- id Microsoft.PowerShell - s winget -- upgrade - available -- disable-interactivity -- nowarn |
170163 Select-Object - Skip 2 - First 1 |
171164 Select-String Available).Count -gt 0 )
172165 {Invoke-EssentialUpdate }
173166 }
167+ elseif (Get-Command choco - ErrorAction Ignore)
168+ {
169+ if (choco outdated - r |
170+ ConvertFrom-Csv - Delimiter ' |' - Header PackageName, LocalVersion, AvailableVersion |
171+ Where-Object PackageName -in powershell, powershell- core, microsoft- windows- terminal)
172+ {Invoke-EssentialUpdate }
173+ }
174174 else
175175 {
176176 Write-Verbose ' Neither Chocolatey nor WinGet found, skipping essential updates'
0 commit comments