rename pc powershell code example
Example 1: powershell replace and rename file name
Get-ChildItem -Path "C:\All" -Filter "*.pdf" | Rename-Item -NewName { $_.BaseName.Replace(".","_") + $_.Extension }
Example 2: powershell rename computer
Rename-Computer -NewName "Server044" -DomainCredential Domain01\Admin01 -Restart