ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
35 stars 3 forks source link

Get-PSResource returns no Modules when used in PSU #1842

Closed Viajaz closed 1 year ago

Viajaz commented 1 year ago

Steps to Reproduce

Executing:

Get-PSResource -Scope AllUsers

-in Environment C:\Program Files\PowerShell\7\pwsh.exe yields no Modules because it only looks in:

[verbose] Retrieving directories in the path 'C:\Program Files\WindowsPowerShell\Modules' 
[verbose] Retrieving directories in the path 'C:\Program Files\WindowsPowerShell\Scripts' 

If I run the same in a C:\Program Files\PowerShell\7\pwsh.exe instance outside of PowerShell Universal, it looks in the correct places and finds the PowerShell 7 modules.

VERBOSE: Retrieving directories in the path 'C:\Program Files\PowerShell\Modules'
VERBOSE: Retrieving directories in the path 'C:\Program Files\PowerShell\Scripts'

Would this have something to do with PSU's version of PowerShellGet being 3.0.12 instead of 3.0.17? Or perhaps Windows PowerShell Compatiblity being enabled?

Expected behavior

For `Get-PSResource -Scope AllUsers` to look into the PowerShell 7 modules path, not just Windows PowerShell module path.

Actual behavior

`Get-PSResource -Scope AllUsers` only looks into the Windows PowerShell module path.

Environment data

Windows Server 2019 PowerShell Universal 3.6.1 with PowerShellGet 3.0.12 PowerShellGet 3.0.17 in PS7 Module Path

Visuals

No response

Viajaz commented 1 year ago

The behaviour remains unchanged in 3.6.4 @adamdriscoll

Viajaz commented 1 year ago

The behaviour remains unchanged in 3.7.6 @adamdriscoll