install windows app powershell code example

Example 1: install windows app powershell

Add-AppxPackage <PackageName>.AppxBundle

Example 2: install powershell msi comand

$MSIInstallArguments = @(
    "/i"
    '"c:\alkane.msi"'
    "/qb!"
    "/norestart"
    "/l*v"
    '"C:\Temp\alkane_install_log.log"'
)
Start-Process "msiexec.exe" -ArgumentList $MSIInstallArguments -Wait -NoNewWindow 


$MSIUninstallArguments = @(
    "/x"
    "{0233CEF0-B5CD-40BB-AEAD-A131A547112E}"
    "/qb!"
    "/norestart"
    "/l*v"
    '"C:\Temp\alkane_uninstall_log.log"'
)
Start-Process "msiexec.exe" -ArgumentList $MSIUninstallArguments -Wait -NoNewWindow

Tags:

Misc Example