For most scenarios involving direct installation of MSIX files for all users, especially in an enterprise environment, you might consider using tools like Microsoft Intune, Group Policy, or System Center Configuration Manager (SCCM) for more controlled and efficient deployment.
Write-Host "Provisioning MSIX for all users..." -ForegroundColor Cyan Add-AppxProvisionedPackage -Online -FolderPath (Split-Path $MsixPath -Parent) -SkipLicense install msix powershell all users
Ensure your script or application checks for and requests administrative privileges before attempting to install. For most scenarios involving direct installation of MSIX