chef: Powershell Add-AppxPackage not working for standard user (only admin)

Hopefully this is the right place (sorry if its not). I am currently trying to side load an appx (UWP) in test kitchen. However it does not work for a standard user. When I set it to an admin account, it works (but that only installs the app for that admin user - I need it installed for a deescalated user). I suspect this is a bug in remote Powershell?

Output:

STDERR: C:\Users\....\AppData\Local\Temp\chef-script20181023-3108-f0qjq7.ps1 : Win32 internal error "Access is denied" 0x5 
       
       occurred while reading the console output buffer. Contact Microsoft Customer Support Services.

Code:

powershell_script 'Install Appx' do
     code 'Add-AppxPackage Example_1.0.0.0.appx'
     cwd 'C:\...'
     user "standardUserHere"
     password "password"
     sensitive false
end

Edit: The command also works on the box itself when I login as the standard user and it copy into powershell

About this issue

Most upvoted comments

I’m not sure if this will apply to your problem or not, but I’ve just managed to resolve a similar issue (with Install-WindowsFeature rather than Add-AppxPackage), by disabling the progress bar display beforehand:

$ProgressPreference = "SilentlyContinue"

Might be worth a try.

Incase someone else finds this. I thought it might be related to the -NoProfile when powershell_script runs, but I tried (below) with no luck

file "c:/app-install.ps1" do
    content <<-EOH
        cd -path "C:/Test"

        Add-AppxPackage Example_1.0.0.0_x64.appx -DependencyPath "Dependencies\\x64\\A.appx","Dependencies\\x64\\B.appx","Dependencies\\x64\\C.appx"
    EOH
end
execute 'App Install' do
    command "powershell.exe -NoLogo -NonInteractive -ExecutionPolicy Bypass -InputFormat None -File c:/app-install.ps1"
    user "standardUser"
    password "standardPass"
    cwd "c:/Test"
    #elevated true
    sensitive false
end