私は以下の活動をするジェンキンスジョブを持っています。サーバパスへジェンキンスワークスペースからコピーアイテム:プロセスがファイルにアクセスできない
- 停止WebServiceの
- 削除WebServiceの
- コピー項目
- スタートWebServiceの 以下
は私のPowerShellスクリプトでWebサービスを作成します。
Get-ChildItem "C:\Location\*"
$service = Get-Service -Name value -Computername $env:SERVER -ErrorAction SilentlyContinue
sc.exe \\$env:SERVER stop value
Write-Host "value STOPPED"
sc.exe \\$env:SERVER delete val
Write-Host "val DELETED"
Copy-Item "C:\Location\*" "\\$env:SERVER\d$\Location" -Force -Recurse
sc.exe \\$env:SERVER create val start=auto DisplayName ="val" binPath= D:\Location.exe
sc.exe \\$env:SERVER description value"value"
sc.exe \\$env:SERVER start value
Write-Host "value STARTED"
if ($error) { exit 1 }
の
エラーログ:
Copy-Item : The process cannot access the file '\\Location' because it is being used by another process. At C:\Users\Administrator\AppData\Local\Temp\hudson2059984936352103941.ps1:18 char:5 + Copy-Item "C:\Location\*" " ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Copy-Item], IOException + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand [SC] CreateService FAILED 1072: The specified service has been marked for deletion. [SC] ChangeServiceConfig2 FAILED 1072: The specified service has been marked for deletion. [SC] StartService FAILED 1058: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
は、あなたがこのエラーで私を助けてくださいことはできますか?プロセスが強制終了されるように展開サーバーを再起動する必要がありますか?もしそうなら、私はこれは関連性がなく、プロダクトサーバではできないと感じています。
dlをブロックしているプロセスを見つけてから停止してください。 – 4c74356b41
@ 4c74356b41その名前のプロセスが見つかりません。 – Kally