スレーブでJenkinsジョブを実行しているときに、このコンソール出力を取得しています。ジョブはファイルを作成してc:\foo\services.csv
に配置する必要があります。スレーブでpowershellコマンドを実行する - Jenkins
Get-Service | Export-CSV c:\foo\service.csv
(注)このコンソール出力のワード「バイパス」:ここでは
は、ジョブのPowerShellコマンドです。私はそれを越えることはできません。私はそれが問題だと思う:[AnonymousJWTApi] $たpowershell.exe -NonInteractive -ExecutionPolicy バイパス "& 'C:\ Users \ユーザーxxxは\のAppData \ローカル\の一時\のhudson1582303083838020200.ps1'"
スレーブのマスターに座っているスクリプトを実行しているときにエラーが発生することがオンラインで判明しました。
私は手動でスレーブにスクリプトを作成し、c:\foo\listServices.ps1
に入れました。次にJenkins(マスター)では、このコマンドはスレーブで実行されます。“C:\foo\listServices.ps1”
スレーブから直接実行するスクリプトを起動します。
私はまだ同じコンソール出力を取得しています...「バイパス」に関する何かがまだ動作していないようです。 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
EDIT:ファイルがマスターに救われる...:P
スレーブがPowerShellスクリプトをホストすることを意図していないようです私が気づいていなかったそれらの出力、またはそれらの出力。
スレーブにログインして、そのコマンドを手動で実行しようとしましたか?何が起こるのですか? –
@ChrisNはい、そのときに動作します – BeniaminoBaggins