This would be why I said I wasn't clear on your quoting requirements. :-)
I know the whole Cygwin thing combined with PowerShell combined with cmd.exe
can be a little....strange.
This seems to work, on my system.
$arrayPaths = "administrator/", "administrator.WXP000/", "All Users/"
$Options = "--verbose --recursive --times --partial --progress --compress
--human-readable --del --ignore-errors --force --bwlimit=0 --timeout=300
--chmod=D=rwx,F=rw"
foreach ($path in $arrayPaths)
{
$source = '"' + "/cygdrive/c/Documents and Settings/$path" + '"'
$dest = '"' + "192.168.0.10::test" + "/Documents and Settings/$path" +
'"'
$prog = "rsync.exe"
pushd "c:\program files\cwrsync"
$param = $options + " " + $source + " " + $dest
cmd.exe /c $prog $param
"cmd.exe /c $prog $param"
popd
}
-----Original Message-----
From: Joseph L. Casale [mailto:[email protected]]
Sent: Thursday, January 14, 2010 4:21 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
>is there a particular reason you want to use II? And I'm not completely clear
>about your quoting requirements, but I'd do something like this:
Nope, I actually don't know any better:)
>cmd.exe /c c:\Program Files\cwRsync\rsync.exe $options "$source" "$dest"
Having an issue with this, so I amended it to a local machine and test data:
$arrayPaths = "administrator/", "administrator.WXP000/", "All Users/"
$Options = '--verbose --recursive --times --partial --progress --compress
--human-readable --del --ignore-errors --force --bwlimit=0 --timeout=300
--chmod=D=rwx,F=rw'
foreach ($path in $arrayPaths)
{
$source = "/cygdrive/c/Documents and Settings/$path"
$dest = "192.168.0.10::test" + '"' + "/Documents and Settings/$path" + '"'
cmd.exe /c start /wait "c:\Program Files\cwRsync\rsync.exe $options
"$source" "$dest""
}
I get a windows error:
The system cannot find the file /cygdrive/c/Documents and
Settings/administrator/ 192.168.0.13::test/Documents.
...
Any idea?
Thanks Michael!
jlc
~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~
<http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~