Powershell 7.2.2 show no installed modules but Powershell 5.1 show them, I cannot use custom instructions in Powershell 7.2.2

Captain Harlock 1 Reputation point
2022-03-28T14:47:34.613+00:00

Hi,

I don't understand why on powershell 7.2.2. shell, the command "Get-InstalledModule" return no modules installed but on powershell 5.1 it correctly report the modules, my problem started after the recent powershell update. the result is that now I cannot use the instructions coming from the modules in powershell 7.2.2.

I've checked the "$env:PSModulePath -split ';'" and it show same paths.

What should I check to fix the problem?

Regards

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2022-03-28T18:54:42.743+00:00

    Does Get-Module -ListAvailable show the modules?

    The Get-InstalledModule only lists the modules that have been installed by PowerShellGet (i.e. from repositories). There may be something in the cmdlet that lists only the modules using PowerShellGet that were installed while running version 7 (not all version 5 modules work with version 7 because 7 is a "cross-platform" version of PowerShell built on PowerShell Core, while version 5 modules are built on software available that may not be available on other platforms).

    0 comments No comments

  2. Captain Harlock 1 Reputation point
    2022-03-29T08:34:02.467+00:00

    Hi,

    thanks for the reply. I tried to reinstall the modules in powershell 7.2.2 but the Install-Module command return no output.
    For some strange reason custom command from one module works anyway. I created some pics, perhaps it can be more clear for you
    187827-2022-03-29-10-10-38.jpg

    Regards
    187853-2022-03-29-10-08-19.jpg

    0 comments No comments

  3. Rich Matheisen 47,901 Reputation points
    2022-03-29T14:57:24.13+00:00

    I'm not sure if this will fix your problem, but try using this in your script if you run it in Powershell 7:

    Import-Module CredentialManager -UseWindowsPowerShell
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.