Edit

Share via


Remove-CMAppVVirtualEnvironment

Removes an App-V virtual environment.

Syntax

SearchByValueMandatory (Default)

Remove-CMAppVVirtualEnvironment
    -InputObject <IResultObject>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByIdMandatory

Remove-CMAppVVirtualEnvironment
    -Id <Int32[]>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByNameMandatory

Remove-CMAppVVirtualEnvironment
    -Name <String>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

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

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Remove a virtual environment by name

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

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

Example 2: Remove a virtual environment by ID

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

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

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

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

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.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies an array of IDs of virtual environments.

Parameter properties

Type:

Int32[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:CIId, CI_ID

Parameter sets

SearchByIdMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies an App-V virtual environment object.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByValueMandatory
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

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

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:LocalizedDisplayName

Parameter sets

SearchByNameMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object