diff --git a/baosign.ps1 b/baosign.ps1 index c3f8ff587..24ad07fa4 100644 --- a/baosign.ps1 +++ b/baosign.ps1 @@ -123,14 +123,10 @@ function Copy-ToSSH { [string]$LocalPath, [string]$RemoteTarget ) - if (Test-Path $LocalPath) { try { - # Using scp for file transfer - $scpCommand = "scp `"$LocalPath`" `"$RemoteTarget`"" Write-Status " Copying: $LocalPath -> $RemoteTarget" - - $result = Invoke-Expression $scpCommand 2>&1 + $result = & scp $LocalPath $RemoteTarget 2>&1 if ($LASTEXITCODE -eq 0) { Write-Success " Successfully copied: $(Split-Path $LocalPath -Leaf)" return $true