How to pass parameters with spaces as an array to RoboCopy in Powershell? How to pass parameters with spaces as an array to RoboCopy in Powershell? powershell powershell

How to pass parameters with spaces as an array to RoboCopy in Powershell?


Can you try this, I can't test it but let me know..:

$Switches = @("/NP", "/NFL", "/NS", "/NDL", "/NJH", "/NJS", "/E", "/XF", "*.config")


My variant (more XD/XF parameters):

$RobocopyParams = @("/NP", "/NFL", "/NS", "/NDL", "/NJH", "/NJS", "/E")$XD = @("Cookies", "His6", "SendTo", "Temp", "Temporary Internet Files", "Windows")$XF = @("*.pif", "$UserName.INI", "$UserName.OPS", "$UserName.INI.*")robocopy.exe @params /XD @XD /XF @XF