Remove-CMVhd
Remove-CMVhd
Removes VHD images.
Syntax
Parameter Set: SearchByIdMandatory
Remove-CMVhd -Id <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Remove-CMVhd -Name <String> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMVhd -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMVhd cmdlet removes one or more virtual hard disk (VHD) images from the operating system deployment feature. This cmdlet does not delete VHD images.
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 VHD images.
Aliases |
PackageId |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies a VHD image object. To obtain a VHD image object, use the Get-CMVhd cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of a VHD image.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SecuredScopeNames<String>
Specifies the name of a secured scope. A secured scope name can be Default or the name of a custom-created secured 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 VHD image
This command removes the virtual hard disk (VHD) image named Windows 10 Enterprise. The Force parameter is included in order to suppress the prompt that requires you to confirm the removal of the VHD.
PS C:\> Remove-CMVhd -Name "Windows 10 Enterprise" -Force