Remove-AzureEnvironment

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Remove-AzureEnvironment

Deletes an Azure environment from Windows PowerShell

Syntax

Parameter Set: Default
Remove-AzureEnvironment [-Name] <String> [[-PassThru] <String> ] [ <CommonParameters>]

Detailed 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 (https://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx).

Parameters

-Name<String>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PassThru<String>

Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

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

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None or System.Boolean

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

Examples

Example 1: Delete an environment

This command deletes the ContosoEnv environment from Windows PowerShell.

PS C:\> Remove-AzureEnvironment -Name ContosoEnv

Example 2: Delete multiple environments

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

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

Add-AzureEnvironment

Get-AzureEnvironment

Set-AzureEnvironment