question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cmdlet Remove-AppxPackage at command pipeline position 1 Supply values for the following parameters: Package:

See original GitHub issue

Prerequisites

Steps to reproduce

When running the below in PWSH 7.2.1 on Windows 10 as Administrator, it non-deterministically prompts: cmdlet Remove-AppxPackage at command pipeline position 1 Supply values for the following parameters: Package:

Which line of the below it stops to prompt for this can be any. It’s prompted on the first line, the fouth, etc. on the same machine.

However, it works perfectly fine on latest Windows PowerShell 5.1.x.

This is first time I’ve attempted to do remove-appxpackage on PWSH so don’t know it’s status on prior versions.

WORKAROUND: start-process powershell.exe -argumentlist “get-appxpackage -name ‘Microsoft.3dbuilder’ -allusers | remove-appxpackage -allusers” -windowstyle hidden -verb runas

Expected behavior

Import-Module -Name Appx -UseWindowsPowerShell
    get-appxpackage -name 'Microsoft.3dbuilder' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Advertising.Xaml' -allusers | remove-appxpackage -allusers
    get-appxpackage -name "Microsoft.BingFinance" -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.BingNews' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.BingSports' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.BingWeather' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.GetHelp' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Getstarted' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Messaging' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Microsoft3DViewer' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.MicrosoftOfficeHub' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.MicrosoftSolitaireCollection' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.MicrosoftStickyNotes' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.MixedReality.Portal' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.mspaint' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Office.OneNote' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Office.Sway' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.OneConnect' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.People' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Print3D' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.ScreenSketch' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.SkypeApp' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Wallet' -allusers | remove-appxpackage -allusers
    # Not uninstallable
    #get-appxpackage -name 'Microsoft.Windows.PeopleExperienceHost' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsAlarms' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsCamera' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsMaps' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsSoundRecorder' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'microsoft.windowscommunicationsapps' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Windows.Photos' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsCalculator' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsFeedbackHub' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsMaps' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.WindowsSoundRecorder' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.Xbox.TCUI' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.XboxApp' -allusers | remove-appxpackage -allusers
    # Not Uninstallable
    #get-appxpackage -name 'Microsoft.XboxGameCallableUI' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.XboxGameOverlay' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.XboxGamingOverlay' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.XboxIdentityProvider' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.XboxSpeechToTextOverlay' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.YourPhone' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.ZuneMusic' -allusers | remove-appxpackage -allusers
    get-appxpackage -name 'Microsoft.ZuneVideo' -allusers | remove-appxpackage -allusers
PS C:\Users\system

Actual behavior

PS C:\Users\system2> Import-Module -Name Appx -UseWindowsPowerShell
WARNING: Module Appx is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.
PS C:\Users\system2>     get-appxpackage -name 'Microsoft.3dbuilder' -allusers | remove-appxpackage -allusers
PS C:\Users\system2>     get-appxpackage -name 'Microsoft.Advertising.Xaml' -allusers | remove-appxpackage -allusers

cmdlet Remove-AppxPackage at command pipeline position 1
Supply values for the following parameters:
Package:

Error details

get-error
PS C:\Windows\System32>

Environment data

$psversiontable


Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
SeeminglySciencecommented, Dec 19, 2021

They did use Import-Module -UseWindowsPowerShell, they’re mentioning that piping between the commands imported this way doesn’t work. This is an unfortunate but expected consequence of serialization. Another work around is:

$session = New-PSSession -UseWindowsPowerShell
Invoke-Command -Session $session {
    all appx code here
}

$session | Remove-PSSession
1reaction
SeeminglySciencecommented, Dec 21, 2021

The issue isn’t something that can be resolved without porting the appx module. There is more discussion around that in #13138, though it is also closed as it’s not shipped with PowerShell or maintained by the PowerShell team.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmdlet Add-AppxPackage at command pipeline position 1 ...
cmdlet Add-AppxPackage at command pipeline position 1 Supply values for the following parameters: Path: when i try to reinstall cortana by ...
Read more >
Reinstall and Re-register Apps in Windows 10
cmdlet Add-AppxPackage at command pipeline position 1. Supply values for the following parameters: Path: Has anyone any ideas?
Read more >
[SOLVED] Modifying the Decrapifier - PowerShell
cmdlet Remove -AppxPackage at command pipeline position 1 Supply values for the following parameters: Package: Any ideas?
Read more >
[SOLVED] - Windows app store issue
At the PowerShell prompt, type the following then hit Enter: ... parameter cannot be found that accepts argument 'Get-AppXPackage'.
Read more >
Windows 10 PowerShell - Get-AppxPackage finds package ...
cmdlet Remove -AppxPackage at command pipeline position 1 Supply values for the following parameters: Package: FULL_PACKAGE_NAME.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found