Test-AzCommunicationServiceNameAvailability

Checks that the CommunicationService name is valid and is not already in use.

Syntax

Test-AzCommunicationServiceNameAvailability
    [-SubscriptionId <String>]
    -Name <String>
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Checks that the CommunicationService name is valid and is not already in use.

Examples

Example 1: Checks if already in use resource name ContosoAcsResource1 is available

Test-AzCommunicationServiceNameAvailability -Name ContosoAcsResource1

Message                               NameAvailable Reason
-------                               ------------- ------
Requested name is unavailable for the requested type False         AlreadyExists

Verified that the CommunicationService name is valid and is not already in use.

Example 2: Checks if new resource name ContosoAcsResource2 is available

Test-AzCommunicationServiceNameAvailability -Name ContosoAcsResource2

Message                               NameAvailable Reason
-------                               ------------- ------
Requested name is available for the requested type True         NameAvailable

Verified that the requested CommunicationService name already in use.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The CommunicationService name to validate. e.g."my-CommunicationService-name-here"

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

INameAvailability