Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. $sourcePath = 'C:\Users\steve\Desktop\New folder'
  3.  
  4.  
  5. Get-Childitem $sourcePath -File | Foreach-Object `
  6. {
  7. $target = -join($sourcePath,"\", $_.FullName.Substring($_.FullName.LastIndexOf("."), $_.FullName.Length - $_.FullName.LastIndexOf(".")).Substring(1))
  8. echo $target
  9. echo $_
  10. mkdir $target
  11. cd $sourcePath
  12. $filefix = $_.fullname.replace("[", "``[").replace("]", "``]")
  13. echo $filefix
  14. Move-Item $filefix -Destination $target
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement