21 lines
936 B
PowerShell
21 lines
936 B
PowerShell
# 先用 incoming 旧 jar 救活 8180,等待新 fat jar 覆盖
|
|
$ErrorActionPreference = 'Stop'
|
|
$IncomingJar = 'C:\Users\ytd_extdev_0903\incoming\jeecg-system-start-3.5.3.jar'
|
|
$Fat = 'E:\wwwroot\inquiry-new\jeecg-system-start-3.5.3.jar'
|
|
Get-CimInstance Win32_Process -Filter "Name='java.exe'" | ForEach-Object {
|
|
if ($_.CommandLine -and $_.CommandLine -like '*inquiry-new*jeecg-system-start*') {
|
|
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue
|
|
}
|
|
}
|
|
Start-Sleep -Seconds 2
|
|
if (Test-Path $IncomingJar) {
|
|
$len = (Get-Item $IncomingJar).Length
|
|
Write-Host ("incoming_jar_bytes=" + $len)
|
|
# 若 incoming 也是坏的(太小或等于损坏后大小),仍复制尝试
|
|
Copy-Item $IncomingJar $Fat -Force
|
|
Write-Host 'RESTORED_FROM_INCOMING'
|
|
} else {
|
|
throw 'no incoming jar to restore'
|
|
}
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File 'C:\Users\ytd_extdev_0903\incoming\_remote_wmi_start_ledger.ps1'
|