如何使 PowerShell 运行原始 Start-Process cmdlet 而不是 PSCX Start-Process cmdlet?
我安装了 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>] [...
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 computer.
When I run get-command start-process
I get:
CommandType Name Definition
----------- ---- ----------
Cmdlet Start-Process Start-Process [[-Path] <String>] [[-Arguments] <String>] [...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用基于模块的版本 (PSCX 2.0 Beta),则可以选择不导入 Pscx.Deprecated 模块,该模块包含与内置 PowerShell cmdlet 冲突的三个 PSCX cmdlet:Start-Process、Select-Xml 和 Get -随机的。请注意,PSCX 2.0 Beta 是 xcopy 部署,要求您仅执行以下操作:
然后按位于
常规选项卡。这是必需的
否则你会得到很多错误
当您导入模块时。
结构)进入
~\WindowsPowerShell\Modules
就是这样。如果您需要在 Windows 资源管理器中重新启用“在此处打开 PowerShell”上下文菜单条目,请运行命令
Enable-OpenPowerShellHere
。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:
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.
structure) into
~\WindowsPowerShell\Modules
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: