diff --git a/InstallAppsWinget.ps1 b/InstallAppsWinget.ps1 index 3aab8ef..e381e12 100644 --- a/InstallAppsWinget.ps1 +++ b/InstallAppsWinget.ps1 @@ -9,7 +9,7 @@ if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1. [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $releases = Invoke-RestMethod -uri $releases_url - $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1 + $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1 "Installing winget from $($latestRelease.browser_download_url)" Add-AppxPackage -Path $latestRelease.browser_download_url @@ -59,7 +59,7 @@ Foreach ($app in $apps) { $listApp = winget list --exact -q $app.name --accept-source-agreements if (![String]::Join("", $listApp).Contains($app.name)) { Write-host "Installing:" $app.name - if ($app.source -ne $null) { + if ($null -ne $app.source) { winget install --exact --silent $app.name --source $app.source --accept-package-agreements } else {