Power shell: Import-Module

一笑奈何 提交于 2019-12-05 02:51:17
Torbjörn Bergstedt

Modules and their commands is a feature in Powershell 2 only, so you can be quite certain you're running this version. I guess you're confused because the Powershell.exe is located in a "1.0" directory; that's only to make version 2.0 backwards compatible.

You need to specify the exact location of the module to load: Import-Module [-Force] path-to-module-file`

Even better is have it available via the $PSModulePath environment variable. Try a Get-Module -ListAvailable to see what modules are available. Since the one you're trying to load does not seem to be listed, try setting the $PSModulePath to the folder above the directory holding the module file.

When you're satisfied with having the correct module path, set it via Computer Properties.

I installed AppFabric and the folder shows up at C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DistributedCacheAdministration

Yet Import-Module DistributedCacheAdministration doesn't work and the module isn't listed in Get-Module -ListAvailable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!