Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Power shell: Import-Module

I have been trying to us the app fabric caching on a win2008 standard server. When I execute the follwowing command I get: Import-Module DistributedCacheAdministration Import-Module : The specified module 'DistributedCacheAdministration' was not loaded because no valid module file was found in any module directory.

Where is this directory located and how can I use that module

Also, it appears that I have powershell 1. I cant seem to install powershell 2

like image 224
H20rider Avatar asked Apr 11 '11 14:04

H20rider


1 Answers

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.

like image 173
Torbjörn Bergstedt Avatar answered Oct 12 '22 15:10

Torbjörn Bergstedt