Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sourcePath = 'C:\Users\steve\Desktop\New folder'
- Get-Childitem $sourcePath -File | Foreach-Object `
- {
- $target = -join($sourcePath,"\", $_.FullName.Substring($_.FullName.LastIndexOf("."), $_.FullName.Length - $_.FullName.LastIndexOf(".")).Substring(1))
- echo $target
- mkdir $target
- cd $sourcePath
- Move-Item $_ -Destination $target
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement