Remove-CMAppVVirtualEnvironment
Removes an App-V virtual environment.
Syntax
Remove-CMAppVVirtualEnvironment
[-Force]
-InputObject <IResultObject>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMAppVVirtualEnvironment
[-Force]
-Id <Int32[]>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMAppVVirtualEnvironment
[-Force]
-Name <String>
[-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.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies an array of IDs of virtual environments.
Type: | Int32[] |
Aliases: | CIId, CI_ID |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specifies an App-V virtual environment object.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies an array of names of App-V virtual environment objects. You can use a wildcard.
Type: | String |
Aliases: | LocalizedDisplayName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | True |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object