Computeractive

How I Use 636 2

Jun 28th, 2022 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. $search=$args[0]
  2. $newname=$args[1]
  3. if ($null -eq $newname)
  4. {
  5. Echo ("Error, I need two inputs, something to search for and the new text")
  6. }
  7. Else
  8. {
  9. dir $search | rename-item -newname { $newname + $_.Name }
  10.  
  11. }
  12.  
Add Comment
Please, Sign In to add comment