我安装了PowerShell v2.0,最重要的是,安装了PSCX。 PSCX是PowerShell社区扩展(http://pscx.codeplex.com/Wikipage)。
似乎我有两个名为Start-Process的cmdlet,我猜测一个是原始的,另一个来自PSCX。当我调用Start-Process时,PSCX cmdlet将运行。 如何让PowerShell改为运行原始版本?
有用的证据:
当我运行get-help start-process
时,我得到:
Name Category Synopsis
---- -------- --------
Start-Process Cmdlet PSCX Cmdlet: Starts a new process.
Start-Process Cmdlet Starts one or more processes on the local computer.
当我运行get-command start-process
时,我得到:
CommandType Name Definition
----------- ---- ----------
Cmdlet Start-Process Start-Process [[-Path] <String>] [[-Arguments] <String>] [...
答案 0 :(得分:4)
如果您获取基于模块的版本(PSCX 2.0 Beta),则可以选择不导入Pscx.Deprecated模块,该模块包含与内置PowerShell cmdlet冲突的三个PSCX cmdlet:Start-Process,Select- Xml和Get-Random。请注意,PSCX 2.0 Beta是一个xcopy部署,要求您只执行此操作:
就是这样。如果需要在Windows资源管理器中重新启用“在此处打开PowerShell”上下文菜单条目,请运行命令Enable-OpenPowerShellHere
。
答案 1 :(得分:3)
我设置了这些别名:
new-alias start-pscxprocess pscx\start-process
new-alias start-msprocess microsoft.powershell.management\start-process