windows-powershell-docs
windows-powershell-docs copied to clipboard
Remove-AppxProvisionedPackage does not support -WhatIf
Remove-AppxProvisionedPackage does not support -WhatIf which is required by common PowerShell standards. It does appear to support all the other <CommonParameters>.
WhatIf is not in the parameter list:
PS C:\scripts> ( gcm Remove-AppxProvisionedPackage ).Parameters
Key Value
PackageName System.Management.Automation.ParameterMetadata AllUsers System.Management.Automation.ParameterMetadata Path System.Management.Automation.ParameterMetadata Online System.Management.Automation.ParameterMetadata WindowsDirectory System.Management.Automation.ParameterMetadata SystemDrive System.Management.Automation.ParameterMetadata LogPath System.Management.Automation.ParameterMetadata ScratchDirectory System.Management.Automation.ParameterMetadata LogLevel System.Management.Automation.ParameterMetadata Verbose System.Management.Automation.ParameterMetadata Debug System.Management.Automation.ParameterMetadata ErrorAction System.Management.Automation.ParameterMetadata WarningAction System.Management.Automation.ParameterMetadata InformationAction System.Management.Automation.ParameterMetadata ErrorVariable System.Management.Automation.ParameterMetadata WarningVariable System.Management.Automation.ParameterMetadata InformationVariable System.Management.Automation.ParameterMetadata OutVariable System.Management.Automation.ParameterMetadata OutBuffer System.Management.Automation.ParameterMetadata PipelineVariable System.Management.Automation.ParameterMetadata
And attempting to use it generates an error:
PS C:\scripts> Remove-AppxProvisionedPackage -Online -WhatIf -PackageName x Remove-AppxProvisionedPackage : A parameter cannot be found that matches parameter name 'WhatIf'. At line:1 char:39
- Remove-AppxProvisionedPackage -Online -WhatIf -PackageName x
~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Remove-AppxProvisionedPackage], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand
PS C:\scripts>
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 4b2f47d8-18df-1393-36b4-16e2d83bafb5
- Version Independent ID: f27cda42-9366-2d0f-a332-8b494962fe25
- Content: Remove-AppxProvisionedPackage (DISM)
- Content Source: docset/winserver2022-ps/dism/Remove-AppxProvisionedPackage.md
- Product: w10
- Technology: windows
- GitHub Login: @JasonGerend
- Microsoft Alias: jgerend