windows-powershell-docs icon indicating copy to clipboard operation
windows-powershell-docs copied to clipboard

Remove-AppxProvisionedPackage does not support -WhatIf

Open essentialexch opened this issue 3 years ago • 0 comments

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.

essentialexch avatar Feb 25 '22 18:02 essentialexch