SHARE
TWEET

Untitled

a guest Nov 14th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $sourcePath = 'C:\Users\steve\Desktop\New folder'
  2.  
  3. Get-Childitem $sourcePath -File | Foreach-Object `
  4.     {
  5.      $target = -join($sourcePath,"\", $_.FullName.Substring($_.FullName.LastIndexOf("."), $_.FullName.Length - $_.FullName.LastIndexOf(".")).Substring(1))
  6.      echo $target
  7.      mkdir $target
  8.      cd $sourcePath
  9.      Move-Item $_ -Destination $target
  10.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top