Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. $sourcePath = 'C:\Users\steve\Desktop\New folder'
  2.  
  3. Get-ChildItem $sourcePath -Recurse -Include '*.*' | Foreach-Object `
  4. {
  5. $target = -join($sourcePath,"\",$_.Extension.Substring(1))
  6.  
  7. mkdir $target
  8. Move-Item $_ -Destination $target
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement