I just started using powershell and i want to write basic shell script to delete Windows 10 defaults apps,, like XBOX,Instagram and others, this is how my script looks like.
$appXPackage = "Get-AppXPackage -Name"
$appXPackage + ' Microsoft.XboxGameCallableUI' | Remove-AppxPackage
Getting this Error:
Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (
Exception from HRESULT: 0x80073CFA)
Package Manager aborted the Remove operation because an invalid argument was passed: Get-AppXPackage -Name Microsoft.Xb
oxGameCallableUI.
NOTE: For additional information, look for [ActivityId] eb445625-b0a9-0002-d590-44eba9b0d301 in the Event Log or use th
e command line Get-AppxLog -ActivityID eb445625-b0a9-0002-d590-44eba9b0d301
At C:\Users\Viktor\Desktop\Remove Windows 10 Apps.ps1:11 char:50
+ $appXPackage + ' Microsoft.XboxGameCallableUI' | Remove-AppxPackage
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Get-AppXPackage...xGameCallableUI:String) [Remove-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand
EDIT: And how can i story applications names inside array and loop through it
Get-AppXPackage -Namein a string? Why not just call the cmdlet directly?