mtniehaus / RenameComputer

Rename a Hybrid AADJ computer after an Autopilot deployment
MIT License
56 stars 18 forks source link

Issue with the Exits #12

Open mobilejon opened 2 months ago

mobilejon commented 2 months ago

I found that this would exist either way:

Bail out if the prefix doesn't match (if specified)

Write-Host $Prefix $details = Get-ComputerInfo if (($Prefix -ne "") -and (-not $details.CsName.StartsWith($Prefix))) { Write-Host "Device name doesn't match specified prefix, bailing out. Prefix=$Prefix ComputerName=$($details.CsName)" Stop-Transcript Exit 0 } Write-Host "Oh!" exit 3