This is probably because the PowerShell script is being launched from a 32 bit instance of PowerShell. The ServerManager commands are only available from 64 bit version of PowerShell. See: Can’t access ServerManager module via PowerShell
–Edit – To add to jbsmith’s comments—
Extra things to try:
When you ran the Get-Command cmdlt:
gcm | ? { $_.ModuleName -eq 'ServerManager' }
It will return nothing because the ServerManager module has not been loaded.
Try running this instead. It will list all available modules to load:
Get-Module -ListAvailable | ? { $_.Name -eq 'ServerManager' }
The other thing to try is to use the “Force” option (Re-imports a module and its members, even if the module or its members have an access mode of read-only):
Import-Module ServerManager -Force;
Get-WindowsFeature;