Remove-CMAppVVirtualEnvironment

Remove-CMAppVVirtualEnvironment

Removes an App-V virtual environment.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMAppVVirtualEnvironment -Id <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMAppVVirtualEnvironment -Name <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMAppVVirtualEnvironment -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-CMAppVVirtualEnvironment cmdlet removes one or more Microsoft Application Virtualization (App-V) virtual environment objects from Microsoft System Center 2012 SP1 Configuration Manager. You can specify App-V virtual environments by name or ID, or you can provide an App-V virtual environment object.

Parameters

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of IDs of virtual environments.

Aliases

CIId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies an App-V virtual environment object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies an array of names of App-V virtual environment objects. You can use a wildcard.

Aliases

LocalizedDisplayName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecuredScopeNames<String>

Specifies the name of security scopes. A security scope can be Default or the name of a custom-created security scope.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

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.

Outputs

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

Examples

Example 1: Remove a virtual environment by name

This command removes an App-V virtual environment named Test.

PS C:\> Remove-CMAppVVirtualEnvironment -Name "Test"

Example 2: Remove a virtual environment by ID

This command removes an App-V virtual environment that has the ID 16781806.

PS C:\> Remove-CMAppVVirtualEnvironment -Id "16781806"

Example 3: Remove a virtual environment by name by using a wildcard

The first command gets all App-V virtual environments that have names that begin with the letter T and stores them in the $AppV variable.

The second command removes all the environments stored in $AppV.

PS C:\> $AppV = Get-CMAppVVirtualEnvironment -Name "T*"
PS C:\> Remove-CMAppVVirtualEnvironment -InputObject $AppV

Get-CMAppVVirtualEnvironment

New-CMAppVVirtualEnvironment

Set-CMAppVVirtualEnvironment