在slave上運行Jenkins作業時,我得到了這個控制檯輸出。該工作應該創建一個文件並將其放入c:\foo\services.csv
。在slave上運行powershell命令 - Jenkins
這裏是工作PowerShell命令:
Get-Service | Export-CSV c:\foo\service.csv
注意在這個控制檯輸出詞「搭橋」。我無法擺脫它。我認爲這是問題:
[AnonymousJWTApi] $ powershell.exe -nonInteractive -ExecutionPolicy 搭橋 「& 'C:\用戶\ XXX \應用程序數據\本地的\ Temp \ hudson1582303083838020200.ps1'」
我在網上發現,在從站上運行坐在主站上的腳本時發生錯誤。
所以我手動創建了奴隸的腳本,並把它放在c:\foo\listServices.ps1
。然後在Jenkins(master)中,這個命令在slave上運行:「C:\foo\listServices.ps1」
來調用腳本直接從slave運行。
我仍然得到相同的控制檯輸出...關於「繞過」的東西似乎仍然導致它無法正常工作。 csv文件沒有放在foo文件夾中。它是否阻止了它的工作,如果是這樣,那麼解決方案是什麼?
並全面控制檯輸出:
Started by user anonymous
Building remotely on slave1 in workspace C:\Jenkins\Master\workspace\AnonymousJWTApi
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url C:\Users\xxx\Source\Repos\AnonymousJWTApi # timeout=10
Fetching upstream changes from C:\Users\xxx\Source\Repos\AnonymousJWTApi
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress C:\Users\xxx\Source\Repos\AnonymousJWTApi +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/master
Seen 1 remote branch
Checking out Revision a7087f81af855cc96b8763a5ec66b96c19a44a30 (origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f a7087f81af855cc96b8763a5ec66b96c19a44a30
> git.exe rev-list a7087f81af855cc96b8763a5ec66b96c19a44a30 # timeout=10
[AnonymousJWTApi] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Users\xxx\AppData\Local\Temp\hudson1582303083838020200.ps1'"
Finished: SUCCESS
編輯:該文件得到保存到主...:P
似乎從沒有打算舉辦PowerShell腳本或他們的輸出,我不知道。
您是否登錄過從站並嘗試手動運行該命令?怎麼了? –
@ChrisN是的,它在那麼做的時候 – BeniaminoBaggins