14 lines
247 B
PowerShell
14 lines
247 B
PowerShell
|
|
Param(
|
|
[string] $NewName,
|
|
[switch] $NotApply = $False
|
|
)
|
|
|
|
|
|
|
|
if ($NotApply){
|
|
Write-Host "Not renaming machine"
|
|
} else {
|
|
Write-Host "Machine is going to be renamed as $NewName"
|
|
Rename-Computer -NewName $NewName -Force -Restart
|
|
} |