PowerShell Core is a automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language and a framework for processing cmdlets. This article will serve as an informative guide and give you a clear understanding of how to perform a silent installation of PowerShell Core from the command line using the MSI installers.
How to Install PowerShell Core Silently
PowerShell Core 32-bit Silent Install (MSI)
- Navigate to: https://github.com/PowerShell/PowerShell/releases
- Select the x86 version of your choice
- Download the PowerShell-x.y.z-win-x86.msi to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command: MsiExec.exe /i PowerShell-x.y.z-win-x86.msi /qn
- Press Enter
After a few moments you will find PowerShell entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | PowerShell Core |
Vendor: | Microsoft Corporation |
Architecture: | x86 |
Installer Type: | MSI |
Silent Install Switch: |
|
Silent Uninstall Switch: | MsiExec.exe /x PowerShell-x.y.z-win-x86.msi /qn |
Repair Command: | MsiExec.exe /fa PowerShell-x.y.z-win-x86.msi /qn |
Download Link: | https://github.com/PowerShell/PowerShell/releases |
PowerShell Script: | https://silentinstallhq.com/powershell-core-install-and-uninstall-powershell/ |
PowerShell Core 64-bit Silent Install (MSI)
- Navigate to: https://github.com/PowerShell/PowerShell/releases
- Select the x64 version of your choice
- Download the PowerShell-x.y.z-win-x64.msi to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command: MsiExec.exe /i PowerShell-x.y.z-win-x64.msi /qn
- Press Enter
After a few moments you will find PowerShell entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | PowerShell Core |
Vendor: | Microsoft Corporation |
Architecture: | x64 |
Installer Type: | MSI |
Silent Install Switch: |
|
Silent Uninstall Switch: | MsiExec.exe /x PowerShell-x.y.z-win-x64.msi /qn |
Repair Command: | MsiExec.exe /fa PowerShell-x.y.z-win-x64.msi /qn |
Download Link: | https://github.com/PowerShell/PowerShell/releases |
PowerShell Script: | https://silentinstallhq.com/powershell-core-install-and-uninstall-powershell/ |
The information above provides a quick overview of the software title, vendor, silent install, and silent uninstall switches. The download link provided take you directly to the vendors website. Continue reading if you are interested in additional details and configurations.
Additional Configurations
Create a PowerShell Core Installation Log File
The PowerShell Core MSI installers offer the option to generate a log file during installation to assist with troubleshooting should any problems arise. You can use the following commands to create a verbose log file with details about the installation.
PowerShell Core 32-bit Silent Install with Logging
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi /qn /L*v "%WINDIR%\Temp\PowerShellCorex86-Install.log" |
PowerShell Core 64-bit Silent Install with Logging
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi /qn /L*v "%WINDIR%\Temp\PowerShellCorex64-Install.log" |
Do Not Add PowerShell to Path Environment Variable
PowerShell Core 32-bit Silent Install with No PATH Environment Variable
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi ADD_PATH=0 /qn |
PowerShell Core 64-bit Silent Install with No PATH Environment Variable
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi ADD_PATH=0 /qn |
Do Not Register Windows Event Logging Manifest
PowerShell Core 32-bit
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi REGISTER_MANIFEST=0 /qn |
PowerShell Core 64-bit
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi REGISTER_MANIFEST=0 /qn |
Enable PowerShell Remoting
PowerShell Core 32-bit Silent Install with PowerShell Remoting Enabled
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi ENABLE_PSREMOTING=1 /qn |
PowerShell Core 64-bit Silent Install with PowerShell Remoting Enabled
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi ENABLE_PSREMOTING=1 /qn |
Add ‘Open Here’ Context Menu to Explorer
PowerShell Core 32-bit Silent Install with Explorer Context Menu
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 /qn |
PowerShell Core 64-bit Silent Install with Explorer Context Menu
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 /qn |
Add ‘Run with PowerShell 7’ Context Menu for PowerShell Files
PowerShell Core 32-bit
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 /qn |
PowerShell Core 64-bit
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 /qn |
Disable Updating PowerShell through Microsoft Update or WSUS
PowerShell Core 32-bit Silent Install with PowerShell Updating Disabled
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi ENABLE_MU=0 /qn |
PowerShell Core 64-bit Silent Install with PowerShell Updating Disabled
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi ENABLE_MU=0 /qn |
Disable Using Microsoft Update When Checking for Updates
PowerShell Core 32-bit Silent Install with Update Checks Disabled
MsiExec.exe /i PowerShell-x.y.z-win-x86.msi USE_MU=0 /qn |
PowerShell Core 64-bit Silent Install with Update Checks Disabled
MsiExec.exe /i PowerShell-x.y.z-win-x64.msi USE_MU=0 /qn |
How to Uninstall PowerShell Core Silently
Check out the PowerShell Core Install and Uninstall (PowerShell) post for a scripted solution.
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Enter one of the following commands:
PowerShell Core 32-bit Silent Uninstall (MSI)
|
PowerShell Core 64-bit Silent Uninstall (MSI)
|
Always make sure to test everything in a development environment prior to implementing anything into production. The information in this article is provided “As Is” without warranty of any kind.