package remove-windows-appx

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

December 11, 2020 - 11:56

Good morning,
I'm getting errors installing the remove-windows-appx package on a small part of my network. Is there a PowerShell equivalent to "run_notfatal"?

Example :
If needed, removing: Microsoft.BingSports
If needed, removing: Microsoft.BingWeather
Traceback (most recent call last):
File "C:\wapt\common.py", line 3876, in install_wapt
exitstatus = setup.install()
File "c:\windows\temp\waptyl5ecp\setup.py", line 93, in install
File "C:\wapt\setuphelpers_windows.py", line 840, in run_powershell
raise CalledProcessErrorOutput(e.returncode,cmd,e.output)
CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(Get-AppXProvisionedPackage -Online | where DisplayName -EQ "Microsoft.BingWeather" | Remove-AppxProvisionedPackage -Online) | ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> S="Error">Remove-AppxProvisionedPackage: The path sp\xe9cifi\xe9 was not found._x000D__x000A_
CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(Get-AppXProvisionedPackage -Online | where DisplayName -EQ "Microsoft.BingWeather" | Remove-AppxProvisionedPackage-Online) | 'ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> S="Error">Remove-AppxProvisionedPackage: The path specified could not be found._x000D__x000A_
florentR2
Messages: 100
Registration: February 13, 2020 - 5:23 PM

December 11, 2020 - 1:58 PM

I haven't tried it, but I would have tried this:

Code: Select all

MyCommand > $null
Or

Code: Select all

MyCommand > c:\quelquepart.log

Or

Code: Select all

Mycommand | out-null
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

December 11, 2020 - 4:08 PM

I still have some positions where it doesn't work:
For example:
Removing undesired Windows Store applications...
If needed, removing: Microsoft.3DBuilder
If needed, removing: Microsoft.Print3D
If needed, removing: Microsoft.Microsoft3DViewer
If needed, removing: Microsoft.MixedReality.Portal
If needed, removing: Microsoft.YourPhone
If needed, removing: Microsoft.WindowsFeedbackHub
If needed, removing: Microsoft.Windows.Cortana
If needed, removing: Microsoft.GetHelp
If needed, removing: Microsoft.BingFinance
If needed, removing: Microsoft.BingNews
If needed,
If needed, removing: Microsoft.BingWeather
Traceback (most recent call last):
File "C:\wapt\common.py", line 3876, in install_wapt
exitstatus = setup.install()
File "c:\windows\temp\wapth6yiqi\setup.py", line 93, in install
File "C:\wapt\setuphelpers_windows.py", line 840, in run_powershell
raise CalledProcessErrorOutput(e.returncode,cmd,e.output)
CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(Get-AppXProvisionedPackage -Online | where DisplayName -EQ "Microsoft.BingWeather" | Remove-AppxProvisionedPackage -Online | out-null) | ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> S="Error">Remove-AppxProvisionedPackage: The path sp\xe9cifi\xe9 was not found._x000D__x000A_
CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(Get-AppXProvisionedPackage -Online | where DisplayName -EQ "Microsoft.BingWeather" | Remove-AppxProvisionedPackage-Online | out-null) | 'ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> S="Error">Remove-AppxProvisionedPackage: The path specified could not be found._x000D__x000A_
With this code:

Code: Select all

def install():
    print("Removing undesired Windows Store applications...")
    for app in apps:
        print("If needed, removing: %s" % app)
        #print('Get-AppxPackage -Name "%s" -AllUsers | Remove-AppxPackage' % app)
        run_powershell('Get-AppxPackage -Name "%s" -AllUsers | Remove-AppxPackage | out-null' % app)
        #print('Get-AppXProvisionedPackage -Online | where DisplayName -EQ "%s" | Remove-AppxProvisionedPackage -Online' % app)
        run_powershell('Get-AppXProvisionedPackage -Online | where DisplayName -EQ "%s" | Remove-AppxProvisionedPackage -Online | out-null' % app)


def session_setup():
    print("Removing undesired Windows Store applications...")
    for app in apps:
        print("If needed, removing: %s" % app)
        #print('Get-AppxPackage -Name "%s" | Remove-AppxPackage' % app)
        run_powershell('Get-AppxPackage -Name "%s" | Remove-AppxPackage | out-null' % app)
Last edited by gaelds on Dec 11, 2020 - 5:06 PM, edited 1 time.
florentR2
Messages: 100
Registration: February 13, 2020 - 5:23 PM

December 11, 2020 - 5:06 PM

Yes
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

December 12, 2020 - 5:04 PM

Sorry, but none of the solutions work.

Using run_notfatal eliminates the error, but it seems to install too quickly to actually work...

Code: Select all

def install():
    print("Removing undesired Windows Store applications...")
    for app in apps:
        print("If needed, removing: %s" % app)
        run_notfatal('powershell.exe Get-AppxPackage -Name "%s" -AllUsers | Remove-AppxPackage' % app)
        run_notfatal('powershell.exe Get-AppXProvisionedPackage -Online | where DisplayName -EQ "%s" | Remove-AppxProvisionedPackage -Online' % app)
Locked