powershell rename code example

Example 1: powershell rename replace

ls *.csv | Rename-Item -NewName {$_.name -replace "Default","VOD"}

Example 2: powershell rename item

Rename-Item
      [-Path] <String>
      [-NewName] <String>
      [-Force]
      [-PassThru]
      [-Credential <PSCredential>]
      [-WhatIf]
      [-Confirm] 
      [<CommonParameters>]

Example 3: rename file powershell

mv original_filename.whatever new_filename.whatever

Example 4: powershell rename computer

Rename-Computer -NewName "Server044" -DomainCredential Domain01\Admin01 -Restart