質問

On my computer in PowerShell the command

import-module GroupPolicy

fails with

import-module <<<<  GroupPolicy
+ CategoryInfo          : ResourceUnavailable: (GroupPolicy:String) [Import-Module],     FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

I cannot find a solution to this issue, according to Microsoft this is the way to go.

Background info:

A colleague developed a Windows PowerShell Script on his Windows 7 32 bit. He installed RSAT. The first command in this script is "import-module GroupPolicy". On his Win7x86 the command works fine, from the command line and when running the script as a whole.

I'm trying to work on his script but I'm using a Windows 7 64 bit system. I also installed RSAT (Windows6.1-KB958830-x64-RefreshPkg.msu). But on my machine the command fails like described above. I cannot find any important differences regarding the content of C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Googling wasn't much help either. There were Postings about PowerShellV1 and running PowerShells x86 version on Win7x64, but neither helped solving this.

Help will be appreciated.

Regards, T.

役に立ちましたか?

解決

You mention installing RSAT, but not enabling any of it's features. So I suspect you had not done anything in that regard...?

If that is the case, got to control panel -> programs and features -> turn windows features on or off:

enter image description here

I suspect enabling marked option should do the job...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top