Outputs from package managers on the current session: ---------Winget Failed when opening source(s); try the 'source reset' command if the problem persists. ---------Chocolatey The system cannot find the path specified.---------Chocolatey The system cannot find the path specified. ---------Winget Failed when opening source(s); try the 'source reset' command if the problem persists. An unexpected error occurred while executing the command: 0x80070005 : Access is denied. ------------------Chocolatey The system cannot find the path specified.---------Chocolatey The system cannot find the path specified. ---------Winget Failed when opening source(s); try the 'source reset' command if the problem persists. ---------Winget Failed when opening source(s); try the 'source reset' command if the problem persists. An unexpected error occurred while executing the command: 0x80070005 : Access is denied.--------- ---------Chocolatey The system cannot find the path specified. ---------Winget Failed when opening source(s); try the 'source reset' command if the problem persists. An unexpected error occurred while executing the command: 0x80070005 : Access is denied. --------- Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows PS C:\Users\Gunilla Bolin> PS C:\Users\Gunilla Bolin> function Test-GalleryModuleUpdate >> { >> param >> ( >> [Parameter(Mandatory,ValueFromPipelineByPropertyName)] >> [string] >> $Name, >> >> [Parameter(Mandatory,ValueFromPipelineByPropertyName)] >> [version] >> $Version, >> >> [Parameter(Mandatory,ValueFromPipelineByPropertyName)] >> [string] >> $Repository, >> >> [switch] >> $NeedUpdateOnly >> ) >> >> process >> { >> >> >> $URLs = @{"PSGallery" = "https://www.powershellgallery.com/api/v2";} >> >> $page = Invoke-WebRequest -Uri ($URLs[$Repository] + "/package/$Name") -UseBasicParsing -Maximum 0 -ea Ignore >> [version]$latest = Split-Path -Path ($page.Headers.Location -replace "$Name." -replace ".nupkg") -Leaf >> $needsupdate = $Latest -gt $Version >> >> if ($needsupdate) >> { >> Write-Output ($Name + "|" + $Version.ToString() + "|" + $Latest.ToString() + "|" + $Repository) >> } >> } >> } >> PS C:\Users\Gunilla Bolin> Get-InstalledModule | Test-GalleryModuleUpdate PS C:\Users\Gunilla Bolin> exit