Remove-​Azure​Environment

Deletes an Azure environment from Windows PowerShell.

Syntax

Remove-AzureEnvironment
      [-Force]
      -Name <String>
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

Description

The Remove-AzureEnvironment cmdlet deletes an Azure environment from your roaming profile so Windows PowerShell can't find it. This cmdlet does not delete the environment from Microsoft Azure, or change the actual environment in any way.

An Azure environment an independent deployment of Microsoft Azure, such as AzureCloud for global Azure and AzureChinaCloud for Azure operated by 21Vianet in China. You can also create on-premises Azure environments by using Azure Pack and the WAPack cmdlets. For more information, see Azure Pack (http://www.microsoft.com/server-cloud/products/windows-azure-pack/default.aspx).

Examples

Example 1: Delete an environment

PS C:\> Remove-AzureEnvironment -Name ContosoEnv

This command deletes the ContosoEnv environment from Windows PowerShell.

Example 2: Delete multiple environments

PS C:\> Get-AzureEnvironment | Where-Object EnvironmentName -like "Contoso*" | ForEach-Object {Remove-AzureEnvironment -Name $_.EnvironmentName }

This command deletes environments whose names begin with "Contoso" from Windows PowerShell.

Required Parameters

-Name

Specifies the name of the environment to remove. This parameter is required. This parameter value is case-sensitive. Wildcard characters are not permitted.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Force

Suppresses the confirmation prompt.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

You can pipe input to this cmdlet by property name, but not by value.

Outputs

None or System.Boolean

If you use the PassThru parameter, this cmdlet returns a Boolean value. Otherwise, it does not return any output.