RedditPP Mascot

RedditPP

r/sysadmin • … • u/Hangman_Matt

how tf do I install app installer via powershell?

Edit: we are not using intune or a domain. We are using Google Workspace Credential provider and GoTo resolve for software deployment/management

Edit 2: App installer is missing out of the box on these Dell machines. It is missing before I have run any scripts or installed/uninstalled a single thing.

Going to preface this with how much this is making me want to scream and just quit my job.

I am using GoTo Resolve to do automated deployment and it has been working fine until about the last month or so when suddenly my winget commands aren't working. Found out it was because every computer I have been getting direct from dell over the last month doesn't have app installer actually installed which I didn't know was possible since it's supposed to be part of Windows 11. I have been manually going into the store and installing app installer until about a week ago when I suddenly can't find it in the store. I am beyond frustrated but thankfully I found a command to install it direct from GitHub. However, it would seem that you can't run the Add-AppxPackage as system, only as a user. This led me down the PowerShell rabbit hole of trying to get Start-Process working which that also apparently can't be run as system because system can't impersonate a user, invoke command which is just saying it cannot connect to the client, and a million other variations on whatever script I can find to try to get this stupid thing to work.

This is the output for the `whoami` command

PS C:\> whoami

nt authority\system

this is the script I am running that is getting **access is denied**. this script works fine if run locally but not when run as system

PS C:\> $machinename = $env:computername PS C:\> $username = "$machinename\username" PS C:\> $password = ConvertTo-SecureString "password" -AsplainText -Force PS C:\> $credential = New-Object System.Management.Automation.PSCredential($username, $password) PS C:\> Start-Process -Filepath "powershell.exe" -ArgumentList "-NoProfile -Command Add-AppxPackage https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -Credential $credential

Start-Process : This command cannot be run due to the error: Access is denied.

Other stuff I have tried is adding System to the **Impersonate a client after authentication** policy as well as running `install-module runasuser` which didn't help either.

If someone can help me figure this out, I know it is probably something stupidly simple and I am just an idiot.

— 0