chcp 65001 $srcUser = "wyc" $srcHost = "192.168.1.8" $srcPath = "/aenv/proj/plant_sun_cat/cmake-build-ubuntu_20_04-release2/ecap_server" $dstUser = "heco" $dstHost = "192.168.1.102" $dstPath = "/home/heco/ys_ecap_server/v1.0.2/" #$dstPath = "/home/heco/ys_ecap_server/test/" #scp "${srcUser}@${srcHost}:${srcPath}" "${dstUser}@${dstHost}:${dstPath}" #$dstPath = "C:\Users\wyc\Desktop\version_control" scp "vm_ubuntu_2004:${srcPath}" "${dstUser}@${dstHost}:${dstPath}" #scp "vm_ubuntu_2004:${srcPath}" "$dstPath" if ($LASTEXITCODE -eq 0) { Write-Host "SCP_DONE OK!" } else { Write-Host "SCP_FAILED:$LASTEXITCODE" }