a guest Nov 14th, 2019 93 Never
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
RAW Paste Data