Refactoring
This commit is contained in:
parent
db888656db
commit
36ff8879a0
@ -9,7 +9,7 @@ if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.
|
|||||||
|
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
$releases = Invoke-RestMethod -uri $releases_url
|
$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)"
|
"Installing winget from $($latestRelease.browser_download_url)"
|
||||||
Add-AppxPackage -Path $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
|
$listApp = winget list --exact -q $app.name --accept-source-agreements
|
||||||
if (![String]::Join("", $listApp).Contains($app.name)) {
|
if (![String]::Join("", $listApp).Contains($app.name)) {
|
||||||
Write-host "Installing:" $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
|
winget install --exact --silent $app.name --source $app.source --accept-package-agreements
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user