UniGetUI icon indicating copy to clipboard operation
UniGetUI copied to clipboard

[BUG] Version 3 Beta 0 - Unknown Source & PowerShell Invoke-WebRequest : Invalid URI: The hostname could not be parsed.

Open RonnyTNL opened this issue 11 months ago • 2 comments

Please confirm these before moving forward

  • [X] I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • [X] I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • [X] I have checked the FAQ section for solutions
  • [X] This issue is about a bug (if it is not, please use the correct template)

Describe your issue

WinGetUI log shows unknown source lines Also see "Invoke-WebRequest : Invalid URI: The hostname could not be parsed." powershell command failure.

Steps to reproduce the issue

No response

WingetUI Log

C:\Users\<REMOVED>\AppData\Local\WingetUI\CachedLangFiles\lang_en.json
Loaded language locale: en
Api auth token: <REMOVED>
Starting update check
Downloaded icons and screenshots successfully!
WingetUI is up to date
Api running on http://localhost:7058
Lang files were updated successfully
LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface.
Unknown source!
Unknown source!
Unknown PowerShell source!

Package Managers Logs

=========================================
[05/03/2024 10:13:04] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[05/03/2024 10:13:04] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:04] Chocolatey - Arguments:  source list
       Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
[05/03/2024 10:13:04] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:09] Chocolatey - Arguments:  source list
       Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
[05/03/2024 10:13:09] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:10] Scoop - Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop list
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Installed apps:
Name         Version Source Updated             Info
----         ------- ------ -------             ----
7zip         23.01   main   2023-09-27 12:33:45     
git          2.43.0  main   2023-11-22 10:32:11     
scoop-search 1.4.1   main   2024-02-13 11:08:41     
[05/03/2024 10:13:10] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:11] Chocolatey - Arguments:  outdated
       Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
Chocolatey v2.2.2
Outdated Packages
 Output is package name | current version | available version | pinned?
Chocolatey has determined 0 package(s) are outdated. 
[05/03/2024 10:13:11] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:11] Scoop - Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop list
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Installed apps:
Name         Version Source Updated             Info
----         ------- ------ -------             ----
7zip         23.01   main   2023-09-27 12:33:45     
git          2.43.0  main   2023-11-22 10:32:11     
scoop-search 1.4.1   main   2024-02-13 11:08:41     
[05/03/2024 10:13:11] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:11] Chocolatey - Arguments:  list
       Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
Chocolatey v2.2.2
0 packages installed.
[05/03/2024 10:13:11] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:12] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[05/03/2024 10:13:12] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:13] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[05/03/2024 10:13:13] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:14] PowerShell - Arguments: -NoProfile -Command Get-InstalledModule
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Version    Name                                Repository           Description                                        
-------    ----                                ----------           -----------                                        
1.0.18     SpeculationControl                  https://www.power... This module provides the ability to query the sp...
[05/03/2024 10:13:14] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:17] Winget - Arguments:  update --include-unknown  --accept-source-agreements
       Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.39 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.39 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.39 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.39 MB
  ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.39 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.39 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.39 MB
  █████████████████████████▒▒▒▒▒  8.00 MB / 9.39 MB
  ████████████████████████████▒▒  9.00 MB / 9.39 MB
  ██████████████████████████████  9.39 MB / 9.39 MB
   - 
   | 
   - 
   | 
Name                                                        Id                Version    Available     Source
-------------------------------------------------------------------------------------------------------------
<REMOVED>
4 upgrades available.
[05/03/2024 10:13:17] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:17] Scoop - Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop status
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Scoop is up to date.
Name Installed Version Latest Version Missing Dependencies Info
---- ----------------- -------------- -------------------- ----
git  2.43.0            2.44.0                                  
[05/03/2024 10:13:17] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:17] PowerShell - Arguments: 
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Program Files\WingetUI> 
PS C:\Program Files\WingetUI>                 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)
>>                         }
>>                     }
>>                 }
>>                 Get-InstalledModule | Test-GalleryModuleUpdate
>>                 exit
>>                 
Invoke-WebRequest : Invalid URI: The hostname could not be parsed.
At line:10 char:33
+ ...     $page = Invoke-WebRequest -Uri ($URLs[$Repository] + "/package/$N ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], UriFormatException
    + FullyQualifiedErrorId : System.UriFormatException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Split-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At line:11 char:61
+ ... -Path -Path ($page.Headers.Location -replace "$Name." -replace ".nupk ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Split-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Spli 
   tPathCommand
[05/03/2024 10:13:17] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:13:17] Winget - Arguments:  list  --accept-source-agreements
       Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.39 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.39 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.39 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.39 MB
  ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.39 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.39 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.39 MB
  █████████████████████████▒▒▒▒▒  8.00 MB / 9.39 MB
  ████████████████████████████▒▒  9.00 MB / 9.39 MB
  ██████████████████████████████  9.39 MB / 9.39 MB
   - 
   | 
   - 
Name                                   Id                                     Version              Available     Source
-----------------------------------------------------------------------------------------------------------------------
<REMOVED>
[05/03/2024 10:13:17] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:06] Scoop - Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop list
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Installed apps:
Name         Version Source Updated             Info
----         ------- ------ -------             ----
7zip         23.01   main   2023-09-27 12:33:45     
git          2.44.0  main   2024-03-05 10:13:58     
scoop-search 1.4.1   main   2024-02-13 11:08:41     
[05/03/2024 10:16:06] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:07] Chocolatey - Arguments:  outdated
       Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
Chocolatey v2.2.2
Outdated Packages
 Output is package name | current version | available version | pinned?
Chocolatey has determined 0 package(s) are outdated. 
[05/03/2024 10:16:07] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:08] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[05/03/2024 10:16:08] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:09] Winget - Arguments:  update --include-unknown  --accept-source-agreements
       Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
   \ 
   / 
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.39 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.39 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.39 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.39 MB
  ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.39 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.39 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.39 MB
  █████████████████████████▒▒▒▒▒  8.00 MB / 9.39 MB
  ████████████████████████████▒▒  9.00 MB / 9.39 MB
  ██████████████████████████████  9.39 MB / 9.39 MB
   - 
   | 
Name                                                        Id                Version    Available     Source
-------------------------------------------------------------------------------------------------------------
<REMOVED>
4 upgrades available.
[05/03/2024 10:16:09] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:11] PowerShell - Arguments: 
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Program Files\WingetUI> 
PS C:\Program Files\WingetUI>                 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)
>>                         }
>>                     }
>>                 }
>>                 Get-InstalledModule | Test-GalleryModuleUpdate
>>                 exit
>>                 
Invoke-WebRequest : Invalid URI: The hostname could not be parsed.
At line:10 char:33
+ ...     $page = Invoke-WebRequest -Uri ($URLs[$Repository] + "/package/$N ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], UriFormatException
    + FullyQualifiedErrorId : System.UriFormatException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Split-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At line:11 char:61
+ ... -Path -Path ($page.Headers.Location -replace "$Name." -replace ".nupk ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Split-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Spli 
   tPathCommand
[05/03/2024 10:16:11] Exit Code: 0
=========================================
=========================================
[05/03/2024 10:16:30] Scoop - Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop status
       Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
Scoop is up to date.
Everything is ok!
[05/03/2024 10:16:30] Exit Code: 0
=========================================

Relevant information

Package Managers enabled: WinGet

  • https://storeedgefd.dsx.mp.microsoft.com/v9.0
  • https://cdn.winget.microsoft.com/cache Scoop
  • Scoop sources is empty
  • Current scoop version v0.3.1 / main bucket version update to version 1.27.4 Chocolatey
  • https://community.chocolatey.org/api/v2/
  • WinGetUI Choco version 2.2.2 PowerShell
  • https://www.powershellgallery.com/api/v2

Screenshots and videos

No response

RonnyTNL avatar Mar 05 '24 09:03 RonnyTNL

Hello,

What is the output of running Get-PSRepository in a powershell prompt?

marticliment avatar Mar 05 '24 14:03 marticliment

PS C:\Users\<REMOVED>> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2

RonnyTNL avatar Mar 05 '24 14:03 RonnyTNL

Just checking, this wasn't fixed in Beta 1?

RonnyTNL avatar Mar 08 '24 11:03 RonnyTNL

It shouldn't have been fixed, I did not touch the powershell file. Maybe this was caused by your powershell installation?

marticliment avatar Mar 08 '24 14:03 marticliment

Confirmed as not fixed in Beta 1.

I'm not sure what I should check for what would be special for my Powershell installation?

RonnyTNL avatar Mar 08 '24 14:03 RonnyTNL

Please share your logs again with Beta 1

marticliment avatar Mar 08 '24 15:03 marticliment

C:\Users\<REMOVED>\AppData\Local\WingetUI\CachedLangFiles\lang_en.json
Loaded language locale: en
Api auth token: <REMOVED>
Starting update check
Downloaded icons and screenshots successfully!
WingetUI is up to date
Api running on http://localhost:7058
Lang files were updated successfully
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Npm
█ Enabled: False
█ THE MANAGER IS DISABLED
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Pip
█ Enabled: False
█ THE MANAGER IS DISABLED
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: .NET Tool
█ Enabled: False
█ THE MANAGER IS DISABLED
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Winget
█ Enabled: True
█ Found: True
█ Fancye exe name: winget.exe
█ Executable path: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
█ Call arguments: 
█ Version: 
█   v1.7.10582
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Scoop
█ Enabled: True
█ Found: True
█ Fancye exe name: scoop
█ Executable path: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█ Call arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop
█ Version: 
█   Current Scoop version:
█   v0.3.1 - Released at 2022-11-15
█   
█   'main' bucket:
█   db854632e syncthing: Update to version 1.27.4
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: PowerShell
█ Enabled: True
█ Found: True
█ Fancye exe name: powershell.exe
█ Executable path: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█ Call arguments: -NoProfile -Command
█ Version: 
█   Name                           Value                                                                                   
█   ----                           -----                                                                                   
█   PSVersion                      5.1.19041.4046                                                                          
█   PSEdition                      Desktop                                                                                 
█   PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
█   BuildVersion                   10.0.19041.4046                                                                         
█   CLRVersion                     4.0.30319.42000                                                                         
█   WSManStackVersion              3.0                                                                                     
█   PSRemotingProtocolVersion      2.3                                                                                     
█   SerializationVersion           1.1.0.1
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Chocolatey
█ Enabled: True
█ Found: True
█ Fancye exe name: choco.exe
█ Executable path: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
█ Call arguments: 
█ Version: 
█   2.2.2
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface.
Language ur not in list, maybe has not been added yet?
Unknown source!
Unknown source!
Unknown PowerShell source!

RonnyTNL avatar Mar 08 '24 15:03 RonnyTNL

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:30] Winget ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
█  Arguments:  source list
Name    Argument
-----------------------------------------------------
msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
winget  https://cdn.winget.microsoft.com/cache
[08/03/2024 16:31:30] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:32] Scoop ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop bucket list
Name Source                                 Updated             Manifests
---- ------                                 -------             ---------
main https://github.com/ScoopInstaller/Main 3/5/2024 9:26:51 AM      1293
[08/03/2024 16:31:32] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:32] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -Command Get-PSRepository
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[08/03/2024 16:31:32] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:32] Chocolatey ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
█  Arguments:  source list
Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
[08/03/2024 16:31:32] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:35] Winget ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
█  Arguments:  source list
Name    Argument
-----------------------------------------------------
msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
winget  https://cdn.winget.microsoft.com/cache
[08/03/2024 16:31:35] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:37] Chocolatey ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
█  Arguments:  source list
Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
[08/03/2024 16:31:37] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:39] Scoop ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop bucket list
Name Source                                 Updated             Manifests
---- ------                                 -------             ---------
main https://github.com/ScoopInstaller/Main 3/5/2024 9:26:51 AM      1293
[08/03/2024 16:31:39] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:39] Chocolatey ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
█  Arguments:  outdated
Chocolatey v2.2.2
Outdated Packages
 Output is package name | current version | available version | pinned?
Chocolatey has determined 0 package(s) are outdated. 
Did you know the proceeds of Pro (and some proceeds from other
 licensed editions) go into bettering the community infrastructure?
 Your support ensures an active community, keeps Chocolatey tip-top,
 plus it nets you some awesome features!
 https://chocolatey.org/compare
[08/03/2024 16:31:39] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:39] Scoop ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop list
Installed apps:
Name         Version Source Updated             Info
----         ------- ------ -------             ----
7zip         23.01   main   2023-09-27 12:33:45     
git          2.44.0  main   2024-03-05 10:13:58     
scoop-search 1.4.1   main   2024-02-13 11:08:41     
[08/03/2024 16:31:39] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:39] Scoop ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop list
Installed apps:
Name         Version Source Updated             Info
----         ------- ------ -------             ----
7zip         23.01   main   2023-09-27 12:33:45     
git          2.44.0  main   2024-03-05 10:13:58     
scoop-search 1.4.1   main   2024-02-13 11:08:41     
[08/03/2024 16:31:39] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:40] Chocolatey ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\choco-cli\bin\choco.exe
█  Arguments:  list
Chocolatey v2.2.2
0 packages installed.
[08/03/2024 16:31:40] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:41] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -Command Get-PSRepository
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[08/03/2024 16:31:41] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:42] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -Command Get-PSRepository
Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                
[08/03/2024 16:31:42] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:44] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -Command Get-InstalledModule
Version    Name                                Repository           Description                                        
-------    ----                                ----------           -----------                                        
1.0.18     SpeculationControl                  https://www.power... This module provides the ability to query the sp...
[08/03/2024 16:31:44] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:45] Winget ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
█  Arguments:  update --include-unknown  --accept-source-agreements
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.40 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.40 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.40 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.40 MB
  ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.40 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.40 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.40 MB
  █████████████████████████▒▒▒▒▒  8.00 MB / 9.40 MB
  ████████████████████████████▒▒  9.00 MB / 9.40 MB
  ██████████████████████████████  9.40 MB / 9.40 MB
   - 
   | 
   - 
Name                                                        Id                Version    Available     Source
-------------------------------------------------------------------------------------------------------------
<REMOVED>
4 upgrades available.
[08/03/2024 16:31:45] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:45] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: 
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Program Files\WingetUI> 
PS C:\Program Files\WingetUI>                 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)
>>                         }
>>                     }
>>                 }
>>                 Get-InstalledModule | Test-GalleryModuleUpdate
>>                 exit
>>                 
Invoke-WebRequest : Invalid URI: The hostname could not be parsed.
At line:10 char:33
+ ...     $page = Invoke-WebRequest -Uri ($URLs[$Repository] + "/package/$N ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], UriFormatException
    + FullyQualifiedErrorId : System.UriFormatException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Split-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At line:11 char:61
+ ... -Path -Path ($page.Headers.Location -replace "$Name." -replace ".nupk ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Split-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Spli 
   tPathCommand
[08/03/2024 16:31:45] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:46] Winget ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
█  Arguments:  list  --accept-source-agreements
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
   / 
   \ 
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.40 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.40 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.40 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.40 MB
  ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.40 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.40 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.40 MB
  █████████████████████████▒▒▒▒▒  8.00 MB / 9.40 MB
  ████████████████████████████▒▒  9.00 MB / 9.40 MB
  ██████████████████████████████  9.40 MB / 9.40 MB
   - 
   | 
   - 
Name                                   Id                                     Version              Available     Source
-----------------------------------------------------------------------------------------------------------------------
<REMOVED>
[08/03/2024 16:31:46] Exit Code: 0
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀ [08/03/2024 16:31:47] Scoop ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments: -NoProfile -ExecutionPolicy Bypass -Command scoop status
WARN  Scoop bucket(s) out of date. Run 'scoop update' to get the latest changes.
[08/03/2024 16:31:47] Exit Code: 0


RonnyTNL avatar Mar 08 '24 15:03 RonnyTNL

Please run the following code on a powershell prompt:

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)
         }
     }
 }
 Get-InstalledModule | Test-GalleryModuleUpdate
exit

marticliment avatar Mar 09 '24 19:03 marticliment

Assumedly the issue is because of the installed Module "SpeculationControl" as the repository property is showing a URL and not "PSGallery" meaning in the function when indexing into the hashtable it's returning a null for the URL to use in Invoke-WebRequest

image

I'd reinstall that module as a test as it could be it was just installed at a point where the repository was messed up locally. Alternatively from a code fixing perspective changing the function to retrieve the repos dynamically to populate the hash would work:

function Test-GalleryModuleUpdate {
    param (
        [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
        [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [version] $Version,
        [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Repository,
        [switch] $NeedUpdateOnly
    )
    process {
        $URLs = @{}
        @(Get-PSRepository).ForEach({$URLs[$_.Name] = $_.SourceLocation})
        $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)
        }
    }
}
Get-InstalledModule | Test-GalleryModuleUpdate

JAK1047 avatar Mar 09 '24 23:03 JAK1047

Your approach is possibly the safest option, thanks!

marticliment avatar Mar 10 '24 10:03 marticliment

No problem. Mind you if the installed module source repository no longer matches any current repository you have listed this still doesn't fully fix it, so @RonnyTNL I'd still recommend reinstalling that particular module for your issue.

JAK1047 avatar Mar 10 '24 14:03 JAK1047

@marticliment @JAK1047

I have fiddled around a bit with this; seems there is a difference in output for Get-InstalledModule when run as standard/limited user v.s. Administrator.

PS C:\WINDOWS\system32> Get-InstalledModule

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
1.0.18     SpeculationControl                  PSGallery            This module provides the ability to query the sp...

PS C:\Users\<REMOVED>> Get-InstalledModule

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
1.0.18     SpeculationControl                  https://www.power... This module provides the ability to query the sp...

RonnyTNL avatar Mar 11 '24 10:03 RonnyTNL

to reproduce install in Admin powershell

Install-Module SpeculationControl

Open a standard/limited account user powershell and query get-installedmodule

RonnyTNL avatar Mar 11 '24 10:03 RonnyTNL

image

I can't replicate it. Does Get-PSRepository change for you between the two?

JAK1047 avatar Mar 11 '24 12:03 JAK1047

Ah, amazing, I tried to reproduce an a clean VM which did not work, both show PSGallery, so I have to assume some left-over is messing up my main machine.

RonnyTNL avatar Mar 11 '24 12:03 RonnyTNL

weird stuff on the machine with the issue ran from limited account

PS C:\Users\<REMOVED>> (Get-InstalledModule speculationcontrol).RepositorySourceLocation
https://www.powershellgallery.com/api/v2/
PS C:\Users\<REMOVED>> (Get-InstalledModule speculationcontrol).Repository
https://www.powershellgallery.com/api/v2/
PS C:\WINDOWS\system32> (Get-InstalledModule speculationcontrol).RepositorySourceLocation
https://www.powershellgallery.com/api/v2/
PS C:\WINDOWS\system32> (Get-InstalledModule speculationcontrol).Repository
PSGallery

It seems it's looking for RepositorySourceLocation instead of Repository from the SpeculationControl\PSGetModuleInfo.xml If I change the RepositorySourceLocation and query .Repository then it will break. So for some reason it doesn't look for the "Repository" line but the "RepositorySourceLocation"

      <S N="RepositorySourceLocation">https://www.powershellgallery.com/api/v2</S>
      <S N="Repository">PSGallery</S>
      <S N="PackageManagementProvider">NuGet</S>

Here I renamed the RepositorySourceLocation and query for the (Get-InstalledModule speculationcontrol).Repository and it breaks, I would have expected the break on the (Get-InstalledModule speculationcontrol).RepositorySourceLocation

PS C:\Users\<REMOVED>> (Get-InstalledModule speculationcontrol).Repository
WARNING: Cannot bind argument to parameter 'source' because it is an empty string.
WARNING: Cannot validate argument on parameter 'Location'. The argument is null or empty. Provide an argument that is
not null or empty, and then try the command again.
WARNING: Cannot bind argument to parameter 'Source' because it is an empty string.
WARNING: The property 'RepositorySourceLocation' cannot be found on this object. Verify that the property exists.
PackageManagement\Get-Package : No match was found for the specified search criteria and module names
'speculationcontrol'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2253 char:9
+         PackageManagement\Get-Package @PSBoundParameters | Microsoft. ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...lets.GetPackage:GetPackage) [Get-Package], Exception
    + FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackage

RonnyTNL avatar Mar 11 '24 14:03 RonnyTNL