Page 1 sur 1

Paquet remove-windows-appx

Publié : 11 déc. 2020 - 11:56
par gaelds
Bonjour,
j'ai des erreurs à l'installation du paquet remove-windows-appx sur une petite partie de mon parc. Existe-t'il un équivalent du "run_notfatal" pour powershell ?

Exemple :
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 S="Error">Remove-AppxProvisionedPackage : Le chemin d'acc\xe8s sp\xe9cifi\xe9 est introuvable._x000D__x000A_</S><S S="Error">Au caract\xe8re Ligne:2 : 87_x000D__x000A_</S><S S="Error">+ ... icrosoft.BingWeather" | Remove-AppxProvisionedPackage -Online) | Conv ..._x000D__x000A_</S><S S="Error">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
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 S="Error">Remove-AppxProvisionedPackage : Le chemin d'accès spécifié est introuvable._x000D__x000A_</S><S S="Error">Au caractère Ligne:2 : 87_x000D__x000A_</S><S S="Error">+ ... icrosoft.BingWeather" | Remove-AppxProvisionedPackage -Online) | Conv ..._x000D__x000A_</S><S S="Error">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>

Re: Paquet remove-windows-appx

Publié : 11 déc. 2020 - 13:58
par florentR2
J'ai pas essayé mais j'aurais tenté ceci :

Code : Tout sélectionner

MyCommand > $null
ou

Code : Tout sélectionner

MyCommand > c:\quelquepart.log

ou

Code : Tout sélectionner

Mycommand | out-null

Re: Paquet remove-windows-appx

Publié : 11 déc. 2020 - 16:08
par gaelds
j'ai encore des postes où ça ne passe pas:
Par exemple:
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, 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\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 S="Error">Remove-AppxProvisionedPackage : Le chemin d'acc\xe8s sp\xe9cifi\xe9 est introuvable._x000D__x000A_</S><S S="Error">Au caract\xe8re Ligne:2 : 87_x000D__x000A_</S><S S="Error">+ ... icrosoft.BingWeather" | Remove-AppxProvisionedPackage -Online | out-n ..._x000D__x000A_</S><S S="Error">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
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 S="Error">Remove-AppxProvisionedPackage : Le chemin d'accès spécifié est introuvable._x000D__x000A_</S><S S="Error">Au caractère Ligne:2 : 87_x000D__x000A_</S><S S="Error">+ ... icrosoft.BingWeather" | Remove-AppxProvisionedPackage -Online | out-n ..._x000D__x000A_</S><S S="Error">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
Avec ce code :

Code : Tout sélectionner

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)

Re: Paquet remove-windows-appx

Publié : 11 déc. 2020 - 17:06
par florentR2
Oui

Re: Paquet remove-windows-appx

Publié : 12 déc. 2020 - 17:04
par gaelds
Désolé mais aucune des solutions ne fonctionne.

En utilisant run_notfatal je n'ai plus d'erreur, mais ça semble s'installer trop vite pour que ça fonctionne réellement...

Code : Tout sélectionner

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)