2012-09-26 221 views
0

我有一個PowerShell腳本,它需要一個輸入參數(int)。該腳本將根據此輸入參數更新服務的狀態。 我一直在使用powergui編輯器來處理這個任務。從PowerGUI的窗口Powershell腳本沒有執行

擷取畫面

enter image description here

enter image description here

每當我試着從PowerShell中的文件的命令行運行腳本,沒有什麼真實被PowerShell的報道。沒有輸出..沒什麼。
從PowerShell窗口的Screencap

enter image description here 請你讓我知道這裏可能發生了什麼。

感謝

+0

這是回答我的問題 http://stackoverflow.com/questions/6016436/in-powershell-how-do-i-define-a-function-in-a-file-and-呼叫它 - 來自該powersh – Gagan

回答

0

也許你叫命令行的PROGRAMM Services.exe的。您可能會嘗試重命名您的功能。

您可能知道以下所有內容,但是在調用函數之前是否解析了PowerShell腳本?這是必要的,可以將你的函數加入到shell中。您必須調用D:\ ps>。\ myScript.ps,然後才能使用該功能。