Search code examples
powershellrsynccwrsync

Powershell: "set home=PATH"


i try to migrate a cmd Batch file to powershell, but powershell don't accept the SET HOME command. The Script

SET HOME=c:\home\user
$destination=user@server:/cygdrive/c/Build
$source=/cygdrive/c/Build

rsync -av -e "./ssh" $source $destination

./ssh don't access to HOME, but the same Script run as cmd-Bash, any suggestion to set a Home Path like the cmd-bash SET HOME?

Regards Rene


Solution

  • $Env:HOME = 'C:\home\user'
    $destination = 'user@server:/cygdrive/c/Build'
    $source = '/cygdrive/c/Build'
    
    rsync -av -e ./ssh $source $destination
    

    What you have there is neither PowerShell nor a batch file, actually.