a guest Nov 15th, 2019 102 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
- echo $_
- mkdir $target
- cd $sourcePath
- $filefix = $_.fullname.replace("[", "``[").replace("]", "``]")
- echo $filefix
- Move-Item $filefix -Destination $target
RAW Paste Data