Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the Exits #12

Open
mobilejon opened this issue Aug 21, 2024 · 0 comments
Open

Issue with the Exits #12

mobilejon opened this issue Aug 21, 2024 · 0 comments

Comments

@mobilejon
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant