Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] win_appx should handle when a query matches more than 1 items #64450

Closed
1 of 9 tasks
stavros-k opened this issue Jun 11, 2023 · 5 comments · Fixed by #64535
Closed
1 of 9 tasks

[BUG] win_appx should handle when a query matches more than 1 items #64450

stavros-k opened this issue Jun 11, 2023 · 5 comments · Fixed by #64535
Assignees
Labels
Bug broken, incorrect, or confusing behavior Execution-Module State-Module Windows

Comments

@stavros-k
Copy link

Description
A clear and concise description of what the bug is.

salt-call.exe --local appx.list

local:
    - Microsoft.HEIFImageExtension
    - Microsoft.HEVCVideoExtension
    - Microsoft.Paint
    - Microsoft.RawImageExtension
    - Microsoft.ScreenSketch
    - Microsoft.StorePurchaseApp
    - Microsoft.Todos
    - Microsoft.WebMediaExtensions
    - Microsoft.Windows.Photos
    - Microsoft.WindowsCamera
    - microsoft.windowscommunicationsapps
    - microsoft.windowscommunicationsapps
    - Microsoft.WindowsNotepad
    - Microsoft.WindowsNotepad
    - Microsoft.WindowsSoundRecorder
    - Microsoft.WindowsSoundRecorder
    - Microsoft.WindowsTerminal
    - Microsoft.XboxGameOverlay
    - Microsoft.XboxGamingOverlay
    - Microsoft.ZuneMusic
    - Microsoft.ZuneMusic
    - MicrosoftCorporationII.QuickAssist
    - MicrosoftCorporationII.QuickAssist
    - MicrosoftWindows.Client.WebExperience
    - MicrosoftWindows.Client.WebExperience

As you can see some of the above are listed twice.
Same happens with

Get-AppxPackage -AllUsers -PackageTypeFilter Bundle | select Name

Microsoft.WebMediaExtensions
Microsoft.ZuneMusic
Microsoft.XboxGameOverlay
MicrosoftCorporationII.QuickAssist
Microsoft.WindowsSoundRecorder
Microsoft.XboxGamingOverlay
Microsoft.RawImageExtension
Microsoft.WindowsNotepad
Microsoft.ScreenSketch
Microsoft.HEVCVideoExtension
MicrosoftWindows.Client.WebExperience
Microsoft.Paint
Microsoft.HEIFImageExtension
microsoft.windowscommunicationsapps
Microsoft.Windows.Photos
Microsoft.ZuneMusic
Microsoft.Todos
Microsoft.WindowsSoundRecorder
Microsoft.WindowsNotepad
Microsoft.WindowsCamera
Microsoft.StorePurchaseApp
MicrosoftWindows.Client.WebExperience
Microsoft.DesktopAppInstaller
MicrosoftCorporationII.QuickAssist
Microsoft.WindowsTerminal
microsoft.windowscommunicationsapps
Microsoft.WindowsStore

Applying

Remove MS Zune Music:
  appx.absent:
    - query: '*Microsoft.ZuneMusic*'

I get:

          ID: Remove MS Zune Music
    Function: appx.absent
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\state.py", line 2385, in call
                  ret = self.states[cdata["full"]](
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1280, in wrapper
                  return f(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\win_appx.py", line 109, in absent
                  status = __salt__["appx.remove"](
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 281, in remove
                  remove_package(package=pkg)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 264, in remove_package
                  if bundle and bundle["IsBundle"]:
              TypeError: list indices must be integers or slices, not str
     Started: 15:59:18.248566
    Duration: 1125.365 ms
     Changes:

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior

👀 See above

⚠️ Debug
[DEBUG   ] Reading configuration from C:\ProgramData\Salt Project\Salt\conf\minion
[DEBUG   ] Including configuration from 'C:\ProgramData\Salt Project\Salt\conf\minion.d\_schedule.conf'
[DEBUG   ] Reading configuration from C:\ProgramData\Salt Project\Salt\conf\minion.d\_schedule.conf
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Configuration file path: C:\ProgramData\Salt Project\Salt\conf\minion
[DEBUG   ] Grains refresh requested. Refreshing grains.
[DEBUG   ] Reading configuration from C:\ProgramData\Salt Project\Salt\conf\minion
[DEBUG   ] Including configuration from 'C:\ProgramData\Salt Project\Salt\conf\minion.d\_schedule.conf'
[DEBUG   ] Reading configuration from C:\ProgramData\Salt Project\Salt\conf\minion.d\_schedule.conf
[DEBUG   ] The functions from module 'core' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'disks' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'extra' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'lvm' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'mdadm' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'minion_process' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'opts' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'pending_reboot' are being loaded by dir() on the loaded module
[DEBUG   ] Override  __utils__: <module 'salt.loaded.int.grains.zfs' from 'C:\\Program Files\\Salt Project\\Salt\\Lib\\site-packages\\salt\\grains\\zfs.py'>
[DEBUG   ] Motherboard info not available on this system
[DEBUG   ] Connecting to master. Attempt 1 (infinite attempts)
[DEBUG   ] Master URI: tcp://10.1.1.51:4506
[DEBUG   ] Initializing new AsyncAuth for ('C:\\ProgramData\\Salt Project\\Salt\\conf\\pki\\minion', 'test2', 'tcp://10.1.1.51:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (9235)
[DEBUG   ] Setting zmq_reconnect_ivl to '9235ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] salt.crypt._get_key_with_evict: Loading private key
[DEBUG   ] Loaded minion key: C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pem
[DEBUG   ] SaltEvent PUB socket URI: 4510
[DEBUG   ] SaltEvent PULL socket URI: 4511
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pem
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] <salt.crypt.AsyncAuth object at 0x0000019080852470> Got new master aes key.
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] Connecting the Minion to the Master publish port, using the URI: tcp://10.1.1.51:4505
[DEBUG   ] <salt.transport.zeromq.PublishClient object at 0x0000019080853AC0> connecting to tcp://10.1.1.51:4505
[DEBUG   ] Sending event: tag = __master_connected; data = {'master': '10.1.1.51', '_stamp': '2023-06-11T13:02:19.294262'}
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pem
[DEBUG   ] Closing IPCMessageClient instance
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncAuth for ('C:\\ProgramData\\Salt Project\\Salt\\conf\\pki\\minion', 'test2', 'tcp://10.1.1.51:4506')
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pem
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] The functions from module 'jinja' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] The functions from module 'yaml' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] The functions from module 'state' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded state.apply
[DEBUG   ] The functions from module 'direct_call' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] The functions from module 'config' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded config.option
[DEBUG   ] The functions from module 'saltutil' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded saltutil.is_running
[DEBUG   ] Override  __grains__: <module 'salt.loaded.int.module.grains' from 'C:\\Program Files\\Salt Project\\Salt\\Lib\\site-packages\\salt\\modules\\grains.py'>
[DEBUG   ] The functions from module 'grains' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded grains.get
[DEBUG   ] Initializing new AsyncAuth for ('C:\\ProgramData\\Salt Project\\Salt\\conf\\pki\\minion', 'test2', 'tcp://10.1.1.51:4506')
[DEBUG   ] Gathering pillar data for state run
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncAuth for ('C:\\ProgramData\\Salt Project\\Salt\\conf\\pki\\minion', 'test2', 'tcp://10.1.1.51:4506')
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pem
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] Finished gathering pillar data for state run
[INFO    ] Loading fresh modules for state activity
[DEBUG   ] The functions from module 'jinja' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] The functions from module 'yaml' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] In saltenv 'base', looking at rel_path 'states/common/appx.sls' to resolve 'salt://states/common/appx.sls'
[DEBUG   ] In saltenv 'base', ** considering ** path 'C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\files\base\states\common\appx.sls' to resolve 'salt://states/common/appx.sls'
[DEBUG   ] compile template: C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\files\base\states\common\appx.sls
[DEBUG   ] Jinja search path: ['C:\\ProgramData\\Salt Project\\Salt\\var\\cache\\salt\\minion\\files\\base']
[PROFILE ] Time (in seconds) to render 'C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\files\base\states\common\appx.sls' using 'jinja' renderer: 0.0
[DEBUG   ] Rendered data from file: C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\files\base\states\common\appx.sls:
# TODO: Add link to docs when available
# https://learn.microsoft.com/en-us/windows/application-management/provisioned-apps-windows-client-os

Remove MS Zune Music:
  appx.absent:
    - query: '*Microsoft.ZuneMusic*'
 
[PROFILE ] Time (in seconds) to render 'C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\files\base\states\common\appx.sls' using 'yaml' renderer: 0.0
[DEBUG   ] The functions from module 'config' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded config.option
[DEBUG   ] The functions from module 'cmd' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded cmd.shell_info
[DEBUG   ] The functions from module 'appx' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded appx.absent
[INFO    ] Running state [Remove MS Zune Music] at time 16:02:19.779805
[INFO    ] Executing state appx.absent for [Remove MS Zune Music]
[DEBUG   ] The functions from module 'appx' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded appx.list
[INFO    ] Executing command '"powershell"' in directory 'C:\Users\test2'
[DEBUG   ] stdout: [
    {
        "Name":  "Microsoft.HEIFImageExtension",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "1.0.61171.0",
        "PackageFamilyName":  "Microsoft.HEIFImageExtension_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.HEIFImageExtension_1.0.61171.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.HEIFImageExtension_1.0.61171.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.HEVCVideoExtension",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2.0.60961.0",
        "PackageFamilyName":  "Microsoft.HEVCVideoExtension_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.HEVCVideoExtension_2.0.60961.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.HEVCVideoExtension_2.0.60961.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.Paint",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "11.2302.18.0",
        "PackageFamilyName":  "Microsoft.Paint_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.Paint_11.2302.18.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.Paint_11.2302.18.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.RawImageExtension",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2.1.60611.0",
        "PackageFamilyName":  "Microsoft.RawImageExtension_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.RawImageExtension_2.1.60611.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.RawImageExtension_2.1.60611.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.ScreenSketch",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2022.2303.17.0",
        "PackageFamilyName":  "Microsoft.ScreenSketch_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.ScreenSketch_2022.2303.17.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.ScreenSketch_2022.2303.17.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.StorePurchaseApp",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "12303.1401.1.0",
        "PackageFamilyName":  "Microsoft.StorePurchaseApp_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.StorePurchaseApp_12303.1401.1.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.StorePurchaseApp_12303.1401.1.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.Todos",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2.97.61391.0",
        "PackageFamilyName":  "Microsoft.Todos_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.Todos_2.97.61391.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.Todos_2.97.61391.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WebMediaExtensions",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "1.0.42192.0",
        "PackageFamilyName":  "Microsoft.WebMediaExtensions_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WebMediaExtensions_1.0.42192.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WebMediaExtensions_1.0.42192.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.Windows.Photos",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2023.11050.16005.0",
        "PackageFamilyName":  "Microsoft.Windows.Photos_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.Windows.Photos_2023.11050.16005.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.Windows.Photos_2023.11050.16005.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsCamera",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2022.2304.11.0",
        "PackageFamilyName":  "Microsoft.WindowsCamera_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsCamera_2022.2304.11.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsCamera_2022.2304.11.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "microsoft.windowscommunicationsapps",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "16005.14326.21434.0",
        "PackageFamilyName":  "microsoft.windowscommunicationsapps_8wekyb3d8bbwe",
        "PackageFullName":  "microsoft.windowscommunicationsapps_16005.14326.21434.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\microsoft.windowscommunicationsapps_16005.14326.21434.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "microsoft.windowscommunicationsapps",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "16005.14326.21472.0",
        "PackageFamilyName":  "microsoft.windowscommunicationsapps_8wekyb3d8bbwe",
        "PackageFullName":  "microsoft.windowscommunicationsapps_16005.14326.21472.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\microsoft.windowscommunicationsapps_16005.14326.21472.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsNotepad",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "11.2304.26.0",
        "PackageFamilyName":  "Microsoft.WindowsNotepad_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsNotepad_11.2304.26.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsNotepad_11.2304.26.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsNotepad",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "11.2303.40.0",
        "PackageFamilyName":  "Microsoft.WindowsNotepad_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsNotepad_11.2303.40.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsNotepad_11.2303.40.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsSoundRecorder",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2021.2304.25.0",
        "PackageFamilyName":  "Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsSoundRecorder_2021.2304.25.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsSoundRecorder_2021.2304.25.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsSoundRecorder",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2021.2302.26.0",
        "PackageFamilyName":  "Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsSoundRecorder_2021.2302.26.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsSoundRecorder_2021.2302.26.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.WindowsTerminal",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "3001.17.11461.0",
        "PackageFamilyName":  "Microsoft.WindowsTerminal_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.WindowsTerminal_3001.17.11461.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_3001.17.11461.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.XboxGameOverlay",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "1.54.4001.0",
        "PackageFamilyName":  "Microsoft.XboxGameOverlay_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.XboxGameOverlay_1.54.4001.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.XboxGameOverlay_1.54.4001.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.XboxGamingOverlay",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "5.823.3261.0",
        "PackageFamilyName":  "Microsoft.XboxGamingOverlay_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.XboxGamingOverlay_5.823.3261.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.XboxGamingOverlay_5.823.3261.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.ZuneMusic",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "11.2303.10.0",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2303.10.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.ZuneMusic_11.2303.10.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "Microsoft.ZuneMusic",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "11.2304.2.0",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2304.2.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\Microsoft.ZuneMusic_11.2304.2.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "MicrosoftCorporationII.QuickAssist",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2023.531.2326.0",
        "PackageFamilyName":  "MicrosoftCorporationII.QuickAssist_8wekyb3d8bbwe",
        "PackageFullName":  "MicrosoftCorporationII.QuickAssist_2023.531.2326.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.QuickAssist_2023.531.2326.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "MicrosoftCorporationII.QuickAssist",
        "Publisher":  "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "8wekyb3d8bbwe",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "2023.214.104.0",
        "PackageFamilyName":  "MicrosoftCorporationII.QuickAssist_8wekyb3d8bbwe",
        "PackageFullName":  "MicrosoftCorporationII.QuickAssist_2023.214.104.0_neutral_~_8wekyb3d8bbwe",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.QuickAssist_2023.214.104.0_neutral_~_8wekyb3d8bbwe",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "MicrosoftWindows.Client.WebExperience",
        "Publisher":  "CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "cw5n1h2txyewy",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "423.11600.0.0",
        "PackageFamilyName":  "MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy",
        "PackageFullName":  "MicrosoftWindows.Client.WebExperience_423.11600.0.0_neutral_~_cw5n1h2txyewy",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\MicrosoftWindows.Client.WebExperience_423.11600.0.0_neutral_~_cw5n1h2txyewy",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-21-2185153782-2315794458-3144474182-1001 [test2]: Installed"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    },
    {
        "Name":  "MicrosoftWindows.Client.WebExperience",
        "Publisher":  "CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
        "PublisherId":  "cw5n1h2txyewy",
        "Architecture":  11,
        "ResourceId":  "~",
        "Version":  "423.13900.0.0",
        "PackageFamilyName":  "MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy",
        "PackageFullName":  "MicrosoftWindows.Client.WebExperience_423.13900.0.0_neutral_~_cw5n1h2txyewy",
        "InstallLocation":  "C:\\Program Files\\WindowsApps\\MicrosoftWindows.Client.WebExperience_423.13900.0.0_neutral_~_cw5n1h2txyewy",
        "IsFramework":  false,
        "PackageUserInformation":  [
                                       "S-1-5-18 [S-1-5-18]: Staged"
                                   ],
        "IsResourcePackage":  false,
        "IsBundle":  true,
        "IsDevelopmentMode":  false,
        "NonRemovable":  false,
        "Dependencies":  [

                         ],
        "IsPartiallyStaged":  false,
        "SignatureKind":  3,
        "Status":  0
    }
]
[INFO    ] Executing command '"powershell"' in directory 'C:\Users\test2'
[DEBUG   ] stdout: [
    {
        "Name":  "Microsoft.ZuneMusic",
        "Version":  "11.2304.2.0",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2304.2.0_x64__8wekyb3d8bbwe",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "IsBundle":  false,
        "IsFramework":  false
    },
    {
        "Name":  "Microsoft.ZuneMusic",
        "Version":  "11.2303.10.0",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2303.10.0_x64__8wekyb3d8bbwe",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "IsBundle":  false,
        "IsFramework":  false
    }
]
[DEBUG   ] Removing 2 packages
[INFO    ] Executing command '"powershell"' in directory 'C:\Users\test2'
[DEBUG   ] stdout: [
    {
        "Name":  "Microsoft.ZuneMusic",
        "Version":  "11.2304.2.0",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2304.2.0_neutral_~_8wekyb3d8bbwe",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "IsBundle":  true,
        "IsFramework":  false
    },
    {
        "Name":  "Microsoft.ZuneMusic",
        "Version":  "11.2303.10.0",
        "PackageFullName":  "Microsoft.ZuneMusic_11.2303.10.0_neutral_~_8wekyb3d8bbwe",
        "PackageFamilyName":  "Microsoft.ZuneMusic_8wekyb3d8bbwe",
        "IsBundle":  true,
        "IsFramework":  false
    }
]
[DEBUG   ] An exception occurred in this state: list indices must be integers or slices, not str
Traceback (most recent call last):
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\state.py", line 2385, in call
    ret = self.states[cdata["full"]](
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1280, in wrapper
    return f(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\win_appx.py", line 109, in absent
    status = __salt__["appx.remove"](
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 281, in remove
    remove_package(package=pkg)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 264, in remove_package
    if bundle and bundle["IsBundle"]:
TypeError: list indices must be integers or slices, not str
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\state.py", line 2385, in call
    ret = self.states[cdata["full"]](
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1280, in wrapper
    return f(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\win_appx.py", line 109, in absent
    status = __salt__["appx.remove"](
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 281, in remove
    remove_package(package=pkg)
  File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 264, in remove_package
    if bundle and bundle["IsBundle"]:
TypeError: list indices must be integers or slices, not str

[INFO    ] Completed state [Remove MS Zune Music] at time 16:02:21.014297 (duration_in_ms=1234.492)
[DEBUG   ] File C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\accumulator\1720148909296 does not exist, no need to cleanup
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] The functions from module 'cmd' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded cmd.run
[INFO    ] Executing command attrib in directory 'C:\Users\test2'
[DEBUG   ] output:
[DEBUG   ] The functions from module 'state' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded state.check_result
[DEBUG   ] Initializing new AsyncAuth for ('C:\\ProgramData\\Salt Project\\Salt\\conf\\pki\\minion', 'test2', 'tcp://10.1.1.51:4506')
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] The functions from module 'highstate' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded highstate.output
local:
----------
          ID: Remove MS Zune Music
    Function: appx.absent
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\state.py", line 2385, in call
                  ret = self.states[cdata["full"]](
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1280, in wrapper
                  return f(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\win_appx.py", line 109, in absent
                  status = __salt__["appx.remove"](
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 281, in remove
                  remove_package(package=pkg)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\modules\win_appx.py", line 264, in remove_package
                  if bundle and bundle["IsBundle"]:
              TypeError: list indices must be integers or slices, not str
     Started: 16:02:19.779805
    Duration: 1234.492 ms
     Changes:

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   1.234 s

See above

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
PASTE HERE

Additional context
Add any other context about the problem here.

@stavros-k stavros-k added Bug broken, incorrect, or confusing behavior needs-triage labels Jun 11, 2023
@stavros-k
Copy link
Author

@twangboy Tagging you here, as you originally wrote this state!
Thanks for making it available! Apart from this it is working great for me

@twangboy
Copy link
Contributor

How is your environment set up where you are seeing multiple listings for the same package? What are the results of the following command?

salt-call.exe --local appx.list field=PackageFullName

@stavros-k
Copy link
Author

How is your environment set up where you are seeing multiple listings for the same package? What are the results of the following command?

salt-call.exe --local appx.list field=PackageFullName

It's a fresh/clean Win 11 Pro installation on a VM.
Its about 2months old, but it was only used for Salt testing

PS C:\Users\test2> salt-call.exe --local appx.list field=PackageFullName
local:
    - Microsoft.HEIFImageExtension_1.0.61171.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.HEVCVideoExtension_2.0.60961.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.Paint_11.2302.18.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.RawImageExtension_2.1.60611.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.ScreenSketch_2022.2303.17.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.StorePurchaseApp_12303.1401.1.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.Todos_2.97.61391.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WebMediaExtensions_1.0.42192.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.Windows.Photos_2023.11050.16005.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsCamera_2022.2304.11.0_neutral_~_8wekyb3d8bbwe
    - microsoft.windowscommunicationsapps_16005.14326.21434.0_neutral_~_8wekyb3d8bbwe
    - microsoft.windowscommunicationsapps_16005.14326.21472.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsNotepad_11.2303.40.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsNotepad_11.2304.26.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsSoundRecorder_2021.2302.26.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsSoundRecorder_2021.2304.25.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.WindowsTerminal_3001.17.11461.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.XboxGameOverlay_1.54.4001.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.XboxGamingOverlay_5.823.3261.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.ZuneMusic_11.2303.10.0_neutral_~_8wekyb3d8bbwe
    - Microsoft.ZuneMusic_11.2304.2.0_neutral_~_8wekyb3d8bbwe
    - MicrosoftCorporationII.QuickAssist_2023.214.104.0_neutral_~_8wekyb3d8bbwe
    - MicrosoftCorporationII.QuickAssist_2023.531.2326.0_neutral_~_8wekyb3d8bbwe
    - MicrosoftWindows.Client.WebExperience_423.11600.0.0_neutral_~_cw5n1h2txyewy
    - MicrosoftWindows.Client.WebExperience_423.13900.0.0_neutral_~_cw5n1h2txyewy

@twangboy
Copy link
Contributor

Could you try this patch?
appx.patch

@twangboy
Copy link
Contributor

Or you can get the patched file from the above PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module State-Module Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants