I've created the following script to trigger on an upload to a specific directory. It does work from command-line with Powershell, but it will not work from the event trigger and returns an error of "Missing expression after unary operator '-'. At line:1 char:2". Any help?
$Source = "\\entsrv37vd\d$\xftp\sftp\EDI\in"
$Destination = "\\entsrv36vd\d$\EDI\inbound"
$ArchiveDir = "\\entsrv37vd\d$\xftp\sftp\EDI\archive"
$List = dir $Source
foreach($file in $list){
copy-item -Path $file.FullName -destination $Destination
move-item -Path $file.FullName -destination $ArchiveDir
}
Thanks in advance!
Bill