Skip to content

Commit cb1d250

Browse files
author
Robin Stolpe
authored
Merge pull request #29 from rstolpe/dev
hopeing this works
2 parents 54dfc68 + 5e1b729 commit cb1d250

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

WinSoftwareUpdate/WinSoftwareUpdate.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
ReleaseNotes = 'https://github.com/rstolpe/WinSoftwareUpdate/releases'
135135

136136
# Prerelease string of this module
137-
Prerelease = 'beta3'
137+
Prerelease = 'beta4'
138138

139139
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
140140
RequireLicenseAcceptance = $false

WinSoftwareUpdate/WinSoftwareUpdate.psm1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)`nError Line: $($_.InvocationInfo.Line)`n"

0 commit comments

Comments
 (0)