0

So we have a PowerShell script that moves a file to an external FTP\Server.

The task also moves said files to an Archive directory

However I only want the script to move the file to the archive directory when the first part is successful. I have no knowledge on powershell.. so would love some help.

The first line was the original script provided by a third party, the 2nd line to archive was added by me however just archives every single time.

Current Script

azcopy copy "$env:ftpPath/P1/hotfolder/B2B/B2BRegionAvailabilityFeed/*"  "https://$env:p1BlobUser.blob.core.windows.net/hybris/master/wacoal/hotfolder/B2BRegionAvailabilityFeed/$env:p1Params" --recursive

Move-Item -Path \\m25\data\ERPData\AZCopy\P1\hotfolder\B2B\B2BRegionAvailabilityFeed\*.csv -Destination \\m25\data\ERPData\AZCopy\P1\hotfolder\B2B\Archive\B2BRegionAvailabilityFeed\

I've tried looking online ... However I lack very little knowledge so struggling.

Thanks

0 Answers0