I have a Powershell script that does a lot of things, and one of them moves files:
$from = $path + '\' + $_.substring(8) $to = $quarantaine + '\' + $_.substring(8) Move-Item $from $to
But the directory structure no longer exists in the $to path. Therefore, I would like Powershell to create it with this commando. I tried Move-Item -Force $from $to , but that didn't help.
What can I do to make sure Powershell creates the necessary directories to make everything work?
Hope I clarify if not, please ask!
powershell
Michiel
source share