diff --git a/badAppXPackages.yaml b/badAppXPackages.yaml new file mode 100644 index 0000000..54762f8 --- /dev/null +++ b/badAppXPackages.yaml @@ -0,0 +1,22 @@ +- DellPrinter.DellDocumentHub +- Microsoft.Getstarted +- Microsoft.MicrosoftOfficeHub +- Microsoft.MicrosoftSolitaireCollection +- Microsoft.Office.OneNote +- Microsoft.SkypeApp +- Microsoft.Wallet +- Microsoft.Xbox.TCUI +- Microsoft.XboxApp +- Microsoft.XboxGameOverlay +- Microsoft.XboxGamingOverlay +#- Microsoft.XboxIdentityProvider +- Microsoft.XboxSpeechToTextOverlay +- Microsoft.YourPhone +- Microsoft.ZuneMusic +- Microsoft.ZuneVideo +- Microsoft.People +#- microsoft.windowscommunicationsapps +- Microsoft.OneConnect +- Microsoft.Messaging +- king.com.FarmHeroesSaga +- king.com.CandyCrushFriends diff --git a/removeAppXPackages.sls b/removeAppXPackages.sls new file mode 100644 index 0000000..eb17bac --- /dev/null +++ b/removeAppXPackages.sls @@ -0,0 +1,28 @@ +{% import_yaml "badAppXPackages.yaml" as packages %} + +{# +# {% for pkg in packages %} +# Remove {{ pkg }}: +# cmd.run: +# - names: +# - Get-AppxPackage -AllUsers {{pkg}} | Remove-AppxPackage +# - Get-AppxProvisionedPackage -Online | where-object DisplayName -eq "{{pkg}}" | Remove-AppxProvisionedPackage -Online +# - shell: powershell +# {% endfor %} +#} + +{% set installed_packages = salt['cmd.powershell']('(Get-AppxPackage -AllUsers).Name') %} +{% for pkg in packages|intersect(installed_packages) %} +Remove {{ pkg }}: + cmd.run: + - name: Get-AppxPackage -AllUsers {{pkg}} | Remove-AppxPackage + - shell: powershell +{% endfor %} + +{% set provisioned_packages = salt['cmd.powershell']('(Get-AppxProvisionedPackage -Online).DisplayName') %} +{% for pkg in packages|intersect(provisioned_packages) %} +Remove provisioned {{ pkg }}: + cmd.run: + - name: Get-AppxProvisionedPackage -Online | where-object DisplayName -eq "{{pkg}}" | Remove-AppxProvisionedPackage -Online + - shell: powershell +{% endfor %} diff --git a/top.sls b/top.sls index e849612..60cbd78 100644 --- a/top.sls +++ b/top.sls @@ -22,4 +22,5 @@ base: - printers - chocolatey-packages - removeShortcuts + - removeAppXPackages - update-fusion360