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
-------                      ------------- ------
Resource name already exists 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
------- ------------- ------
        True

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 name of the resource for which availability needs to be checked.

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

-SubscriptionId

The ID of the target subscription. The value must be an UUID.

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

ICheckNameAvailabilityResponse