@@ -79,7 +79,7 @@ Function Confirm-rsWinGet {
7979 [System.Object ]$GithubInfoRestData = Invoke-RestMethod - Uri $WinGetUrl - Method Get - Headers $GithubHeaders - TimeoutSec 10 - HttpVersion $SysInfo.HTTPVersion | Select-Object - Property assets, tag_name
8080
8181 [System.Object ]$GitHubInfo = [PSCustomObject ]@ {
82- Tag = $ ($GithubInfoRestData.tag_name.Substring (1 )) -as [ version ]
82+ Tag = $ ($GithubInfoRestData.tag_name.Substring (1 ))
8383 DownloadUrl = $GithubInfoRestData.assets | where-object { $_.name -like " *.msixbundle" } | Select-Object - ExpandProperty browser_download_url
8484 OutFile = " $ ( $env: TEMP ) \WinGet_$ ( $GithubInfoRestData.tag_name.Substring (1 )) .msixbundle"
8585 }
@@ -361,11 +361,20 @@ Function Update-rsWinSoftware {
361361
362362 # Checking if it's any softwares to update and if so it will update them
363363 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
365365
366366 Write-OutPut " Checks if any softwares needs to be updated..."
367367 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
369378 }
370379 catch {
371380 Write-Error " Message: $ ( $_.Exception.Message ) `n Error Line: $ ( $_.InvocationInfo.Line ) `n "
0 commit comments