This is a very short article in hopes, that it gets picked up by search engine and helps someone else or my future self.
After the holidays I was making sure everything was up-to-date before start any work, but of course, things are never that easy and I ran into the following error, while updating my IIS configurations in PowerShell:
The specified module ‘WebAdministration’ was not loaded because no valid module file was found in any module directory.
Things I’ve tried that didn’t help or weren’t relevant:
- Remove & re-add IIS via the Windows features settings
- Using the often mentioned
Add-PSSnapin
doesn’t even work on Windows 10 and is always mentioned for older Windows Server versions - Enabling IIS 6 scripting Windows features
But after search for some more time, I finally found some more recent posts mentioning stuff about PowerShell module paths, which lead me to the correct solution.
- Open the System Properties > Advanced tab
- Click on “Environment Variables”
- Alternatively, just Windows search for “Environment Variables”
- In the “System variables” section find the
PSModulePath
variable - Make sure the system PowerShell module path is included in the list
C:\Windows\System32\WindowsPowerShell\v1.0\Modules
- Check the variable in a new PowerShell window with
$env:PSModulePath