Yes, but I'm doing this from the msstore and winget repo's and not an actual .appx file if that matters.
This will install the app store along with winget. There's a bit more to this if you're trying to install it on a server or images missing Microsoft VCLibs. There are guides for this if that's what you want to do.
-ExecutionPolicy Bypass (Get-AppxProvisionedPackage -Online -LogLevel Warnings | Where-Object -Property DisplayName -EQ Microsoft.DesktopAppInstaller).InstallLocation -replace '%SYSTEMDRIVE%', $env:SystemDrive | Add-AppxPackage -Register -DisableDevelopmentMode
Once you have winget installed you can use this script to install apps. Just modify the name, ID, and type to match the winget/msstore info which you can find by opening up powershell/terminal and running "winget search appname":
# Define the apps to install
$apps = @(
@{Name = "Google Chrome"; Id = "Google.Chrome"; Type = "winget"},
@{Name = "Mozilla Firefox"; Id = "Mozilla.Firefox"; Type = "winget"},
@{Name = "Microsoft 365 (Office)"; Id = "Microsoft.365Desktop"; Type = "winget"},
@{Name = "Microsoft Teams"; Id = "MicrosoftTeams"; Type = "winget"},
@{Name = "Notepad++"; Id = "Notepad++.Notepad++"; Type = "winget"},
@{Name = "PowerToys"; Id = "Microsoft.PowerToys"; Type = "winget"},
@{Name = "Greenshot"; Id = "Greenshot.Greenshot"; Type = "winget"}
@{Name = "Windows Calc"; Id = "9WZDNCRFHVN5"; Type = "msstore"}
)
# Install the apps silently for all users
foreach ($app in $apps) {
if ($app.Type -eq "winget") {
Write-Host "Installing $($app.Name) from winget..."
winget install $app.Id -e -s winget --silent --accept-package-agreements --accept-source-agreements --force
} elseif ($app.Type -eq "msstore") {
Write-Host "Installing $($app.Name) from Microsoft Store..."
Add-AppxPackage -Register "C:\Program Files\WindowsApps\Microsoft.$($app.Id)_*" -DisableDevelopmentMode
}
}
# Verify the apps were installed
foreach ($app in $apps) {
if ($app.Type -eq "winget" -and (Get-Command $app.Id -ErrorAction SilentlyContinue)) {
Write-Host "$($app.Name) was installed successfully from winget."
} elseif ($app.Type -eq "msstore" -and (Get-AppxPackage "Microsoft.$($app.Id)" -ErrorAction SilentlyContinue)) {
Write-Host "$($app.Name) was installed successfully from Microsoft Store."
} else {
Write-Warning "$($app.Name) was not installed."
}
}
And last if you want to automatically keep these apps up to date you can use GPO to schedule a task that runs however often you'd like them to update:
powershell.exe winget upgrade --all --silent --include-unknown