Install Msix Powershell All Users [2026]

:使用以下核心语法将 MSIX 包预配给所有用户,其中 -SkipLicense 参数可避免因许可证问题导致的安装失败。命令如下:

To check if the package is successfully staged for all users, run: powershell

To confirm that the package has been successfully provisioned for the system, run: powershell

try # Define the path to your MSIX package $msixPath = "C:\Path\To\YourApp.msix" install msix powershell all users

$fullPath = Resolve-Path ".\MyApp.msix" Add-AppxProvisionedPackage -Online -FolderPath $fullPath

Once provisioned, you can manage or verify the installation using these administrative commands: Verify Installation : To see if the package is correctly provisioned, use Get-AppxProvisionedPackage powershell

Get-AppxProvisionedPackage -Online | Where-Object $_.DisplayName -like "*YourAppName*" Use code with caution. powershell Close the application in all user sessions,

$cert = (Get-AuthenticodeSignature -FilePath ".\MyApp.msix").SignerCertificate $store = [System.Security.Cryptography.X509Certificates.X509Store]::new("Root","LocalMachine") $store.Open("ReadWrite") $store.Add($cert) $store.Close()

<# .SYNOPSIS Installs an MSIX package for all users on a Windows machine. .DESCRIPTION Uses Add-AppxProvisionedPackage to machine-wide install an MSIX. .NOTES Must be run as Administrator. #>

Do not rely on relative paths. Use:

To ensure the MSIX package was properly installed for all users, you can check the provisioned packages. powershell

Close the application in all user sessions, or add the -ForceApplicationShutdown parameter if using Add-AppxPackage .

: Ensure your PowerShell Execution Policy allows scripts to run (e.g., Set-ExecutionPolicy RemoteSigned ). Set-ExecutionPolicy RemoteSigned ).

Go to Top