I have two stock Win10 VM's, both with stock Powershell environments. (IOW, no profile, no installed modules, etc. I have done an initial Update-Help.)
One one of them, starting PS and immediately doing a Get-Module shows
Each of those directories has the single appropriate sub-directory underneath it corresponding to the version that shows up in get-module (on the first VM).
On the second VM where I only two are loaded automatically, I can do an "Import-Module PowershellGet" and it will load both it and the PackageManagement module. I can load Microsoft.Powershell.Management manually, or it shows automatically after I do a CD somewhere.
The question is why aren't those modules loading automatically in the second VM?
Is there a way to troubleshoot PS's startup, i.e. it's initial loading of the modules, what it does before presenting the first prompt to the user?
And, unrelated, but how does it know not to load Pester automatically?
From a troubleshooting angle, I'd launch it with the noprofile switch as a start. I'd then load modules manually with -Verbose and see if anything interesting popped up. It's also worth comparing $PSVersionTable on them both.
The topic ‘Some startup modules not loaded at startup’ is closed to new replies.