簡體   English   中英

如何使PowerShell運行原始的Start-Process cmdlet而不是PSCX Start-Process cmdlet?

[英]How can I make PowerShell run the original Start-Process cmdlet rather than the 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>] [...

如果獲取基於模塊的版本(PSCX 2.0 Beta),則可以選擇不導入Pscx.Deprecated模塊,該模塊包含與內置PowerShell cmdlet沖突的三個PSCX cmdlet:Start-Process,Select-Xml和Get -隨機。 請注意,PSCX 2.0 Beta是xcopy部署,僅要求您執行以下操作:

  1. 下載Pscx-2.0-Beta2.zip
  2. 在Windows資源管理器中打開其屬性,然后按“常規”選項卡上的“取消阻止”。 這是必需的,否則導入模塊時會出現很多錯誤。
  3. 將文件提取(保留文件夾結構)到〜\\ WindowsPowerShell \\ Modules
  4. 導入模塊Pscx

而已。 如果需要在Windows資源管理器中重新啟用“在此處打開PowerShell”上下文菜單項,請運行命令Enable-OpenPowerShellHere

我設置了以下別名:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM