Powershell 5.1.16299.98 on Win10 1709.
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
Microsoft.Powershell.Management, 220.127.116.11 Microsoft.Powershell.Utility, 18.104.22.168 PackageManagement, 22.214.171.124 PowerShellGet, 126.96.36.199 PSReadline, 1.2
On the other, I only get two of the modules
Microsoft.Powershell.Utility, 188.8.131.52 PSReadline, 1.2
I’ve checked the C:\Program Files\WindowsPowerShell\Modules directory on both, and as near as I can tell, they look identical. Both machines have five directories:
Microsoft.PowerShell.Operation.Validation PackageManagement Pester PowerShellGet PSReadline
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?