Reputation: 177
I have a Path C:\dir1\dir2\dir3\dir4
.
I want to split the path and create each of the folder like in the shown structure.
Has anyone any ideas how to do this?
Upvotes: 0
Views: 203
Reputation: 13217
No need to split the path, you can create all the folders and sub-folders in one command:
New-Item -ItemType Directory -Path C:\dir1\dir2\dir3\dir4 -Force
Upvotes: 3