Skip to content

Commit

Permalink
Merge pull request #29 from rstolpe/dev
Browse files Browse the repository at this point in the history
hopeing this works
  • Loading branch information
rstolpe authored Apr 26, 2024
2 parents 54dfc68 + 5e1b729 commit cb1d250
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion WinSoftwareUpdate/WinSoftwareUpdate.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
ReleaseNotes = 'https://github.com/rstolpe/WinSoftwareUpdate/releases'

# Prerelease string of this module
Prerelease = 'beta3'
Prerelease = 'beta4'

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
RequireLicenseAcceptance = $false
Expand Down
15 changes: 12 additions & 3 deletions WinSoftwareUpdate/WinSoftwareUpdate.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Function Confirm-rsWinGet {
[System.Object]$GithubInfoRestData = Invoke-RestMethod -Uri $WinGetUrl -Method Get -Headers $GithubHeaders -TimeoutSec 10 -HttpVersion $SysInfo.HTTPVersion | Select-Object -Property assets, tag_name

[System.Object]$GitHubInfo = [PSCustomObject]@{
Tag = $($GithubInfoRestData.tag_name.Substring(1)) -as [version]
Tag = $($GithubInfoRestData.tag_name.Substring(1))
DownloadUrl = $GithubInfoRestData.assets | where-object { $_.name -like "*.msixbundle" } | Select-Object -ExpandProperty browser_download_url
OutFile = "$($env:TEMP)\WinGet_$($GithubInfoRestData.tag_name.Substring(1)).msixbundle"
}
Expand Down Expand Up @@ -361,11 +361,20 @@ Function Update-rsWinSoftware {

# Checking if it's any softwares to update and if so it will update them
Write-Output "Updating Wingets source list..."
Start-Process -FilePath "WinGet.exe" -ArgumentList "source update" -Verb RunAS -NoNewWindow -Wait
Start-Process -FilePath "WinGet.exe" -ArgumentList "source update" -NoNewWindow -Wait

Write-OutPut "Checks if any softwares needs to be updated..."
try {
Start-Process -FilePath "WinGet.exe" -ArgumentList "upgrade --all --accept-package-agreements --accept-source-agreements --silent --include-unknown --uninstall-previous" -Verb RunAS -NoNewWindow -Wait
$Arguments = @()
$Arguments += "upgrade"
$Arguments += "--all"
$Arguments += "--include-unknown"
$Arguments += "--accept-package-agreements"
$Arguments += "--accept-source-agreements"
$Arguments += "--uninstall-previous"
$Arguments += "--silent"

Start-Process -FilePath "WinGet.exe" -ArgumentList $Arguments -NoNewWindow -Wait
}
catch {
Write-Error "Message: $($_.Exception.Message)`nError Line: $($_.InvocationInfo.Line)`n"
Expand Down

0 comments on commit cb1d250

Please sign in to comment.