Open mobilejon opened 2 months ago
I found that this would exist either way:
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
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