Intro
I am making backups of some USB drives using a script that uses Robocopy. It places the files on the USB onto an external hard drive in a folder named by the date of the backup. When I looked at the external hard drive in file explorer I couldn't find the backup. However, when doing 'dir -force' in PowerShell I can see the files are definitely there:
Notice that the folders I am missing are in Mode d--hs.
Question
How do I prevent Robocopy from copying to a mode d--hs folder and instead to a d----?
Code
$Day = "{0:yyyy-MM-dd}" -f (get-date)
$usb1 = 'E:'
$usb2 = 'F:'
$usb3 = 'H:'
$usb4 = 'I:'
$usb5 = 'J:'
$usb6 = 'K:'
$usblist = $usb1,$usb2,$usb3,$usb4,$usb5,$usb6
$usblist | ForEach-Object -Parallel {
$usb = $_
$Day = "{0:yyyy-MM-dd}" -f (get-date)
Robocopy /z /r:3 /w:3 /E "$usb" "U:\$Day" *.png /S |Out-Null| Out-Default
Robocopy /z /r:3 /w:3 /E "$usb" "X:\$Day" *.png /S |Out-Null| Out-Default
Robocopy /z /r:3 /w:3 /E "$usb" "Y:\$Day" *.png /S |Out-Null| Out-Default
}-ThrottleLimit 6
System info
OS: Windows 11
Powershell: 7.3.0-preview.3