2013-04-10 23 views
3

我已經編寫了一個簡單的powershell腳本來啓動一個winform(在powershell腳本中編寫的Winform代碼,例如showContent.ps1文件)&顯示了一些內容。 我需要在啓動Winform後隱藏powershell.exe命令提示符。在Winform啓動後隱藏或最小化PowerShell提示

搜索網絡中的某些情況下,我嘗試了以下方案: 1)我試圖執行「powershell.exe -Command -windowstyle隱藏」在腳本文件的開頭「showContent.ps1」

2)創建一個新的腳本文件EXA:LaunchWinForm.ps1和所提到的命令: PowerShell.exe -windowstyle隱藏showContent.ps1

這是行不通的。

我使用PowerShell 3.0

誰能告訴了什麼錯誤或提出任何辦法做到這一點。

回答

4

試試這個方法:

powershell.exe -WindowStyle Hidden -File c:\showContent.ps1 
+0

它的工作完美的我...謝謝 – usr021986 2013-04-10 11:04:34