Getting Started

Getting Started with PowerShell Core#

Embarking on your PowerShell journey begins with setting up the environment. Here’s a simple guide on how to download and install PowerShell Core, a cross-platform automation tool, on different operating systems.

Downloading and Installing PowerShell Core#

PowerShell Core is the open-source version of PowerShell that runs on various platforms including Windows, macOS, and Linux. Follow these steps to get started:

On Windows#

  1. Download the Latest Stable Version:
    • Download PowerShell 7.4.0 (the latest stable version as of this writing) directly from here .
    • If you are reading this at a later time, you can find and download the latest version ending in win-x64.msi from PowerShell Releases page on GitHub
  2. Install:
    • Run the downloaded Powershell-<version>-win-x64.msi file and follow the installation prompts to complete the setup. Other versions

On macOS#

  1. Download: Open the Terminal and run brew install --cask powershell if you have Homebrew installed. If not, download the package from the GitHub release page .
  2. Install: If using Homebrew, it handles the installation. Otherwise, open download and run the downloaded powershell-<version>-osx-x64.pkg package and follow the installation instructions.

On Linux#

PowerShell Core can be installed on various Linux distributions. For Ubuntu, the process is:

  1. Download: Open a terminal and run the following commands:
    # Update the list of packages
    sudo apt-get update
    # Install pre-requisite packages
    sudo apt-get install -y wget apt-transport-https software-properties-common
    # Download the Microsoft repository GPG keys
    wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
    # Register the Microsoft repository GPG keys
    sudo dpkg -i packages-microsoft-prod.deb
    # Update the list of packages after we added packages.microsoft.com
    sudo apt-get update
    # Install PowerShell
    sudo apt-get install -y powershell
    
  2. Install: Follow the commands above to complete the installation.

Verifying the Installation#

Once installed, verify that PowerShell Core is correctly installed:

  1. Open PowerShell:

    • On Windows, search for pwsh in the Start menu.
    • On macOS and Linux, open a Terminal and type pwsh.
  2. Check Version: In the PowerShell window, type $PSVersionTable.PSVersion and press Enter. This command displays the installed PowerShell version.

  3. Get OS Information: To know your operating system details, type Get-ComputerInfo in PowerShell.

Congratulations! You have successfully set up PowerShell Core on your system. You are now ready to start exploring the world of automation with PowerShell.

Next Steps#

Join us as we dive into the exciting world of PowerShell Core, unlocking the power of automation one command at a time!