{"id":9057,"date":"2025-02-27T10:08:41","date_gmt":"2025-02-27T02:08:41","guid":{"rendered":"https:\/\/www.jameseduard.com\/?p=9057"},"modified":"2025-02-27T10:08:41","modified_gmt":"2025-02-27T02:08:41","slug":"how-to-install-powershell-on-windows-linux-and-macos","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=9057","title":{"rendered":"How to Install PowerShell on Windows, Linux, and macOS"},"content":{"rendered":"\n\n\n<p class=\"wp-block-paragraph\">PowerShell is a powerful scripting language and command-line shell designed for task automation and configuration management. It is available on multiple platforms, including Windows, Linux, and macOS. In this blog post, I&#8217;ll guide you through the steps to install PowerShell on each of these operating systems.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Installing PowerShell on Windows<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">There are several methods to install PowerShell on Windows, depending on your needs:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Using WinGet (Recommended)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a terminal and run the following command to search for the latest version of PowerShell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">winget search Microsoft.PowerShell<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install PowerShell using the&nbsp;<code>id<\/code>&nbsp;parameter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">winget install --id Microsoft.PowerShell --source winget<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>Using the MSI Package<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download the MSI package from the PowerShell GitHub releases page.<\/li>\n\n\n\n<li>Run the installer and follow the prompts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">3. <strong>Using the ZIP Package<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download the ZIP package from the PowerShell GitHub releases page.<\/li>\n\n\n\n<li>Extract the contents and run&nbsp;<code>pwsh.exe<\/code>&nbsp;from the extracted folder.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">4. <strong>Using the Microsoft Store<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the Microsoft Store app and search for &#8220;PowerShell&#8221;.<\/li>\n\n\n\n<li>Click &#8220;Get&#8221; to download and install PowerShell.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Installing PowerShell on Linux<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">PowerShell can be installed on various Linux distributions. Here are the steps for some popular ones:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Ubuntu<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update the package list and install prerequisites:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt update\nsudo apt install -y wget apt-transport-https software-properties-common<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Import the Microsoft GPG key and register the Microsoft repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">wget -q https:\/\/packages.microsoft.com\/config\/ubuntu\/20.04\/packages-microsoft-prod.deb\nsudo dpkg -i packages-microsoft-prod.deb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Powershell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt update\nsudo apt install -y powershell<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>Red Hat Enterprise Linux (RHEL)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable the Microsoft repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo rpm --import https:\/\/packages.microsoft.com\/keys\/microsoft.asc\nsudo sh -c 'echo -e \"[packages-microsoft-com-prod]\\nname=packages-microsoft-com-prod\\nbaseurl=https:\/\/packages.microsoft.com\/yumrepos\/microsoft-rhel7.3-prod\\nenabled=1\\ngpgcheck=1\\ngpgkey=https:\/\/packages.microsoft.com\/keys\/microsoft.asc\" &gt; \/etc\/yum.repos.d\/microsoft.repo'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Powershell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo yum install -y powershell<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">3. Debian<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update the package list and install prerequisites:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt update\nsudo apt install -y wget apt-transport-https software-properties-common<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Import the Microsoft GPG key and register the Microsoft repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">wget -q https:\/\/packages.microsoft.com\/config\/debian\/10\/packages-microsoft-prod.deb\nsudo dpkg -i packages-microsoft-prod.deb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Powershell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt update\nsudo apt install -y powershell<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Installing PowerShell on macOS<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To install PowerShell on macOS, follow these steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Using Homebrew (Recommended)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install Homebrew if you haven&#8217;t already<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Powershell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">brew install --cask powershell<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using the PKG Installer<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download the PKG installer from the PowerShell GitHub releases page.<\/li>\n\n\n\n<li>Run the installer and follow the prompts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By following these steps, you can easily install PowerShell on Windows, Linux, and macOS. Enjoy the power and flexibility that PowerShell brings to your scripting and automation tasks!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope this guide helps! If you have any questions or need further assistance, feel free to ask<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell is a powerful scripting language and command-line shell designed for task automation and configuration management. It is available on multiple platforms, including Windows, Linux, and macOS. In this blog post, I&#8217;ll guide you through the steps to install PowerShell on each of these operating systems. Installing PowerShell on Windows There are several methods to<\/p>\n","protected":false},"author":1,"featured_media":9061,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[995,52,47,73,1069],"tags":[87,1065,1066,1067,22,628,102,1068,325],"class_list":["post-9057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-devops","category-how-tos","category-powershell","category-scripting-and-automation","tag-automation","tag-command-line-tools-2","tag-cross-platform-2","tag-installation-guide","tag-linux","tag-macos","tag-powershell","tag-scripting","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/9057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9057"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/9057\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}