Add-WindowsFeature, Get-WindowsFeature modules not recognized in powershell.
Hi, I have several Windows Server 2008 R2 servers running in a test lab environment. I have installed the RTM version of 2008 r2. I am building an exchange 2010 lab to test out the new features in it. I was doing some troubleshooting on some of the exchange processes and ran across a page using the Add-WindowsFeature cmdlet in powershell. However when I type in that command in powershell I get a message that says:

The term 'Add-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch
eck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:19
+ Add-WindowsFeature <<<<
    + CategoryInfo          : ObjectNotFound: (Add-WindowsFeature:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I am also getting the same message with the Get-WindowsFeature command.

What do I need to do on these servers to fix this?

Thanks.
February 2nd, 2010 4:14pm

You first need to run:
PS>import-module servermanager
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2010 4:18pm

That did it. What I want to know is why 3 hours of searching for that answer to that question is that isn't listed anywhere as having to use that command before you use Add-WindowsFeature or Get-WindowsFeature.

Anyways thanks for helping!
February 2nd, 2010 4:31pm

That did it. What I want to know is why 3 hours of searching for that answer to that question is that isn't listed anywhere as having to use that command before you use Add-WindowsFeature or Get-WindowsFeature.

Anyways thanks for helping!

A valid question that I can't exactly help to give an official answer.  That's how non-core-OS PowerShell features are added in v2.  Same for AD, IIS, Clustering, etc.
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2010 4:34pm

Well - and in way that makes sense to make powershell more flexible and dynamic. But so far I haven't really found any documentation relating which functions belong under which module blocks. Oh well, I guess it all is still pretty new.
February 2nd, 2010 4:46pm

Hi,

For your information, expert from the article below:

"You must load the Server Manager module into each new Windows PowerShell session before working with Server Manager cmdlets. To do this, in a Windows PowerShell session opened with elevated user rights, type Import-Module Servermanager, and then press ENTER."

What's New in Server Manager
http://technet.microsoft.com/en-us/library/dd378896%28WS.10%29.aspx 

Thanks.

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 1:51am

You first need to run:
PS>import-module servermanager

can not run nor the features

PS C:\Users\Administrator> import-module servermanager
Import-Module : The specified module 'servermanager' was not loaded because no valid module file was found in any modul
e directory.
At line:1 char:14
+ import-module <<<<  servermanager
    + CategoryInfo          : ResourceUnavailable: (servermanager:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

 

 

PS C:\Users\Administrator> Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Met
abase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compress
ion,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart
The term 'Add-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch
eck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:19
+ Add-WindowsFeature <<<<  NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,
Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Acti
vation,RPC-Over-HTTP-Proxy -Restart
    + CategoryInfo          : ObjectNotFound: (Add-WindowsFeature:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

 

guide please

February 1st, 2012 12:52am

You can list what modules are available by running:

get-module -list

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   ActiveDirectory           {}
Manifest   AppLocker                 {}
Manifest   BitsTransfer              {}
Manifest   PSDiagnostics             {}
Manifest   TroubleshootingPack       {}

I am on Win7 x64 SP1, so I do not have the server manager.

Free Windows Admin Tool Kit Click here and download it now
February 1st, 2012 1:47pm

Thanks Marco :D Solved :D

December 18th, 2012 8:39am

is this issue really resolved ??

we are hitting same issue again ..

please reply the solution

Free Windows Admin Tool Kit Click here and download it now
June 10th, 2015 11:10am

This thread has been closed for 5 years.  You need to start your own topic.
June 10th, 2015 11:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics