Odin/scripts/claim-nightwing-usb-moves.ps1
2026-06-16 00:45:48 +01:00

24 lines
564 B
PowerShell

param(
[string] $SshTarget = "nightwing",
[string] $HostAddress = ""
)
$ErrorActionPreference = "Stop"
$scriptPath = Join-Path $PSScriptRoot "nightwing-claim-usb-moves.sh"
$sshExe = Join-Path $env:SystemRoot "System32\OpenSSH\ssh.exe"
$remoteArgs = ""
if (-not [string]::IsNullOrWhiteSpace($HostAddress)) {
$remoteArgs = " " + ($HostAddress -replace "'", "'\''")
}
$command = '"' + $sshExe + '" -o BatchMode=yes -o ConnectTimeout=5 ' +
$SshTarget +
' "sh -s' +
$remoteArgs +
'" < "' +
$scriptPath +
'"'
cmd.exe /c $command
exit $LASTEXITCODE