开发者

How can I make PowerShell run the original Start-Process cmdlet rather than the PSCX Start-Process cmdlet?

I have PowerShell v2.0 installed and on top of that, PSCX is installed. PSCX is the PowerShell Community Extensions (http://pscx.codeplex.com/Wikipage).

It seems that I have two cmdlets called Start-Process installed and I'm guessing one is the original and the other is from PSCX. When I invoke Start-Process, the PSCX cmdlet is made to run. How can I make PowerShell run the original version instead?

Helpful Evidence:

When I run get-help start-process i get:

Name                              Category  Synopsis
----                              --------  --------
Start-Process                     Cmdlet    PSCX Cmdlet: Starts a new process.
Start-Process                     Cmdlet    Starts one or more processes on the local compute开发者_开发技巧r.

When I run get-command start-process I get:

CommandType     Name                                                          Definition
-----------     ----                                                          ----------
Cmdlet          Start-Process                                                 Start-Process [[-Path] <String>] [[-Arguments] <String>] [...


If you grab the module-based version (PSCX 2.0 Beta), you can choose not to import the Pscx.Deprecated module which contains the three PSCX cmdlets that clash with the built-in PowerShell cmdlets: Start-Process, Select-Xml and Get-Random. Note the PSCX 2.0 Beta is an xcopy deploy requiring you to only do this:

  1. Download the Pscx-2.0-Beta2.zip
  2. Open its properties in Windows Explorer and press the Unblock located on the General tab. This is required otherwise you'll get a lot of errors when you import the module.
  3. Extract the files (preserving the folder structure) into ~\WindowsPowerShell\Modules
  4. Import-Module Pscx

That's it. If you need to re-enable the "Open PowerShell Here" context menu entry in Windows Explorer then run the command Enable-OpenPowerShellHere.


I have these aliases set up:

new-alias start-pscxprocess pscx\start-process 
new-alias start-msprocess microsoft.powershell.management\start-process  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜