@@ -79,7 +79,7 @@ Function Confirm-rsWinGet {
79
79
[System.Object ]$GithubInfoRestData = Invoke-RestMethod - Uri $WinGetUrl - Method Get - Headers $GithubHeaders - TimeoutSec 10 - HttpVersion $SysInfo.HTTPVersion | Select-Object - Property assets, tag_name
80
80
81
81
[System.Object ]$GitHubInfo = [PSCustomObject ]@ {
82
- Tag = $ ($GithubInfoRestData.tag_name.Substring (1 )) -as [ version ]
82
+ Tag = $ ($GithubInfoRestData.tag_name.Substring (1 ))
83
83
DownloadUrl = $GithubInfoRestData.assets | where-object { $_.name -like " *.msixbundle" } | Select-Object - ExpandProperty browser_download_url
84
84
OutFile = " $ ( $env: TEMP ) \WinGet_$ ( $GithubInfoRestData.tag_name.Substring (1 )) .msixbundle"
85
85
}
@@ -361,11 +361,20 @@ Function Update-rsWinSoftware {
361
361
362
362
# Checking if it's any softwares to update and if so it will update them
363
363
Write-Output " Updating Wingets source list..."
364
- Start-Process - FilePath " WinGet.exe" - ArgumentList " source update" - Verb RunAS - NoNewWindow - Wait
364
+ Start-Process - FilePath " WinGet.exe" - ArgumentList " source update" - NoNewWindow - Wait
365
365
366
366
Write-OutPut " Checks if any softwares needs to be updated..."
367
367
try {
368
- Start-Process - FilePath " WinGet.exe" - ArgumentList " upgrade --all --accept-package-agreements --accept-source-agreements --silent --include-unknown --uninstall-previous" - Verb RunAS - NoNewWindow - Wait
368
+ $Arguments = @ ()
369
+ $Arguments += " upgrade"
370
+ $Arguments += " --all"
371
+ $Arguments += " --include-unknown"
372
+ $Arguments += " --accept-package-agreements"
373
+ $Arguments += " --accept-source-agreements"
374
+ $Arguments += " --uninstall-previous"
375
+ $Arguments += " --silent"
376
+
377
+ Start-Process - FilePath " WinGet.exe" - ArgumentList $Arguments - NoNewWindow - Wait
369
378
}
370
379
catch {
371
380
Write-Error " Message: $ ( $_.Exception.Message ) `n Error Line: $ ( $_.InvocationInfo.Line ) `n "
0 commit comments