Skip to content

Test-Guid

SYNOPSIS

Validates whether a given string is a GUID.

SYNTAX

__AllParameterSets

Test-Guid [-String] <string> [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

Checks if the input string matches the standard GUID format. The function returns $true if the string is a valid GUID, otherwise $false.

EXAMPLES

EXAMPLE 1

"550e8400-e29b-41d4-a716-446655440000" | Test-Guid

Returns $true since the provided string is a valid GUID.

EXAMPLE 2

"not-a-guid" | IsGuid

Returns $false because the input is not a valid GUID.

EXAMPLE 3

Test-Guid -String "550e8400-e29b-41d4-a716-446655440000"

Directly checks if the provided string is a valid GUID and returns $true.

PARAMETERS

-String

The string to validate as a GUID.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

{{ Fill in the Description }}

OUTPUTS

System.Boolean

{{ Fill in the Description }}

NOTES