Install a PowerShell MSI package in offline mode

Follow these steps to install a PowerShell MSI package on a Windows server without any internet connection.

  1. From a server connected to the internet, download a Microsoft PowerShell MSI package from the Microsoft website.
  2. Copy the PowerShell MSI setup file to an external media or find a way to get it onto your target system with no internet access.
  3. Copy the PowerShell MSI setup package on your target computer under C:\Packages.
  4. Start a command prompt with administrator privileges.
  5. Run the cd C:\Packages command.
  6. Run the msiexec.exe /package <YourMsiSetup> /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1 ADD_PATH=1 command, where <YourMsiSetup> is the name of your PowerShell MSI setup file copied in step 3. For example, PowerShell-7.2.6-win-x64.msi. The other settings in the command above are:
    • ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL: This property controls the option for adding the Open PowerShell item to the context menu in Windows Explorer.
    • ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL: This property controls the option for adding the Run with PowerShell item to the context menu in Windows Explorer.
    • ENABLE_PSREMOTING: This property controls the option for enabling PowerShell remoting during installation.
    • REGISTER_MANIFEST: This property controls the option for registering the Windows Event Logging manifest.
    • ADD_PATH: This property controls the option for adding PowerShell to the Windows PATH environment variable.
  7. The installation is done. ✅