我試圖在TC中使用Powershell Runner運行一些PS腳本,並將自己的腳本定義爲「源代碼」而不是腳本文件。 我的劇本很簡單,只要:TeamCity Powershell亞軍 - 無法運行源代碼
"Hello World!"
林在Windows Server 2008 R2的運行,並以香港專業教育學院的嘗試:
- 運行它的x86 + x64的
- 使用「與執行的.ps1「 - 文件」的說法‘+’把腳本到PowerShell的標準輸入與‘指令 - ’參數
- 香港專業教育學院設置的安全策略,以無限制,企圖得到它的工作,但沒有運氣
如果我不是使用命令行亞軍和例如寫道:
powershell -Command Get-ExecutionPolicy
它工作正常。
即時得到(取決於2種執行模式的即時通訊使用)的錯誤是:
Starting: C:\...\cmd.exe /c C:\...\powershell.exe -NonInteractive -Command
- "<C:\...\powershell3889347351955805274.ps1" && exit /b %ERRORLEVEL%
in directory: C:\...\e18dda4054c166c7
'-' was specified with the -Command parameter; no other arguments to -Command are permitted.
OR
Starting: C:\...\cmd.exe /c C:\...\powershell.exe -NonInteractive -File
"C:\...\powershell8264270201473986040.ps1" && exit /b %ERRORLEVEL%
in directory: C:\...\e18dda4054c166c7
The term 'f' is not recognized as the name of a cmdlet, function, script file,
它看起來對我來說,TC把什麼東西在實際的腳本本身,但我不知道。我卡住了,我不知道我在這裏缺少什麼點:S。
任何人都可以幫忙嗎?
另請參見http://stackoverflow.com/questions/9165658/cant-get-basic-powershell-script-running-inside-team-city(首先用我的搜索keyworkds命中,但真正的問題是,把它放入標準輸入模式扼流器的一些事情,例如,如果在TC 7.0塊) – 2012-04-10 10:07:09