PowerShell Troubleshooting: Module does not autoload
Symptoms
- Powershell v 3.0 or later does not autoload modules
- $PSModuleAutoLoadingPreference has not been tampered with
- manual import of module works
- Get-Module -ListAvailable | Import-module works
Possible Cause:
custom module has been imported (ex: in C:\Windows\System32\WindowsPowerShell\v1.0\Modules) during OSD deployment or after and has an error in it
Troubleshooting:
- Starting PowerShell will display no error
- setting $PSModuleAutoLoadingPreference to "ALL" changes nothing
- insert into C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1:
- Get-Module -ListAvailable | Import-module
- Starting PowerShell will display error and module source for error
- Fix or delete proble Module