PowerShell, the full power of .NET, WMI and COM all from a command line. PowerShell has a steep learning curve, much like the tango, but oh, my, when you really start dancing... (Scott Hanselman)
PowerShell Community Extensions (PSCX) is aimed at providing a widely useful set of additional cmdlets, providers, aliases, filters, functions and scripts for Windows PowerShell that members of the community have expressed interest in. You can download the PSCX extensions here.
First, you have to know the location of your modules folder:
cd $PSHome\Modulesin my situation, my modules folder appears to be:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
ZIP file
Files downloaded from the web are usually blocked on Windows including
the Pscx-2.0.zip file. If you do not unblock the ZIP file first then
each of the files extracted from the ZIP will also be blocked. Open Windows Explorer and browse to the download folder in which the zip file of the PSCX extensions resides. Right-click on the file and select "Properties". On the General tab of the Properties dialog, locate the "Unblock" button
in
the lower right-hand corner and press it.
Once you have unblocked the Pscx-2.0.zip, extract the contents of the ZIP file to your $PSHome\Modules folder. Afterwards, you should have a $PSHome\Modules\Pscx folder !
Import
Use this command to import the extensions:
import-module Pscx
Now, you can use all kinds of community extensions, like the ones which are mentioned here. You also have some extra "Linux" commands now, like tail and less.
PS C:\Windows\System32\WindowsPowerShell\v1.0\Modules> dir
Directory: C:\Windows\System32\WindowsPowerShell\v1.0\Modules
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s 14/07/2009 5:46 PM AppLocker
d---s 14/07/2009 3:37 PM BitsTransfer
d---- 9/11/2010 4:41 PM CD
d---- 9/11/2010 4:41 PM DirectoryServices
d---- 9/11/2010 4:41 PM FileSystem
d---- 9/11/2010 4:41 PM GetChildItem
d---- 9/11/2010 4:41 PM GetHelp
d---- 9/11/2010 4:41 PM Net
d---- 9/11/2010 4:41 PM Prompt
d---- 9/11/2010 4:45 PM Pscx
d---- 14/07/2009 3:32 PM PSDiagnostics
d---- 9/11/2010 4:41 PM TabExpansion
d---- 9/11/2010 4:41 PM TranscribeSession
d---- 14/07/2009 3:37 PM TroubleshootingPack
d---- 9/11/2010 4:41 PM Utility
d---- 9/11/2010 4:41 PM Vhd
d---- 9/11/2010 4:41 PM Wmi
-a--- 9/11/2010 4:39 PM 2008 Pscx-2.0.0.1.zip
PS C:\Windows\System32\WindowsPowerShell\v1.0\Modules> Import-module Pscx
Import-Module : The specified module 'Pscx' was not loaded because no valid module file was found in any m
ry.
At line:1 char:14
+ Import-module <<<< Pscx
+ CategoryInfo : ResourceUnavailable: (Pscx:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Posted by: clueless | November 09, 2010 at 06:53 AM