Why I have to create a path if not present using Move-Item
Why we need to create a path prior to moving a file from one location to other, if the destination doesn't have the relative path created using Move-item in powershell scripting.
For e.g. I have a source path as "E:\abc\0000\xyz.txt" and destination where it should be copied has a folder "D:\vfd". Now with Move Item I need to copy the xyz.txt using relative path as
Move-Item "E:\abc\0000\xyz.txt" -Destination "D:\vfd\0000\xyz.txt"
Now the above command will error since Destination doesn't have the 0000 directory.
In Unix if destination path is not present then it creates the required path and move the item. It just simple as that.