Skip to main content
< All Topics

Get Started with Powershell

There are multiple ways to install PowerShell in Windows. Each install method is designed to support different scenarios and workflows. View all the install or update options on Microsoft PowerShell on Windows or check out the official product documentation for PowerShell on learn.microsoft.com/en-us/powershell

Install Windows Powershell

PowerShell 7: PowerShell 7 is the latest cross-platform version of PowerShell. It can be installed on Windows, macOS, and Linux.

  • Open the PowerShell website: https://github.com/PowerShell/PowerShell/releases/
  • Scroll down to the “Assets” section of the latest release and download the installer package for Windows (usually an MSI file).
  • Run the installer and follow the on-screen instructions.

Windows PowerShell (Built-in on most Windows versions):
Windows PowerShell is already installed on most Windows versions. To open it, search for “PowerShell” in the Start menu.

Update Powershell

Check Version
Get-Host

Search for PowerShell Versions
winget search Microsoft.PowerShell

Update PowerShell
winget install –id Microsoft.Powershell –source winget
winget install –id Microsoft.Powershell.Preview –source winget

Powershell

About PowerShell

PowerShell is a powerful scripting and automation framework developed by Microsoft for managing and automating tasks on Windows systems. It provides a command-line interface (CLI) as well as a scripting language.

Here are the basic steps to get started with PowerShell:

  1. Opening PowerShell:
    • Windows Search: Type “PowerShell” in the Windows search bar and select “Windows PowerShell” or “Windows PowerShell (ISE)” from the results.
    • Start Menu: Navigate to the Start Menu, expand the “Windows PowerShell” folder, and select “Windows PowerShell” or “Windows PowerShell (ISE).”
  2. PowerShell Modes:
    • Console Mode (PowerShell): This is the basic command-line interface.
    • Integrated Scripting Environment (ISE): This provides a more feature-rich scripting environment with script editor and debugger.
  3. Running Commands:
    • In the PowerShell window, you can start typing commands.
    • Commands follow a verb-noun syntax, like Get-Process, Set-Location, New-Item, etc.
    • Press Enter to execute the command.
  4. Getting Help:
    • Use the Get-Help cmdlet to get help about commands. For example: Get-Help Get-Process.
  5. Variables:
    • You can create variables by using the $ symbol, like $variableName = "Hello, PowerShell!".
    • Variables can store different types of data, such as strings, numbers, arrays, and objects.
  6. Basic Commands:
    • Get-Process: Lists running processes.
    • Get-ChildItem: Lists files and folders in the current directory.
    • Set-Location or cd: Changes the current directory.
    • New-Item: Creates a new file, directory, or other item.
    • Remove-Item: Deletes a file or directory.
  7. Pipelines:
    • PowerShell supports piping, where the output of one command can be used as the input of another.
    • For example, you can use Get-Process | Where-Object { $_.WorkingSet -gt 100MB } to list processes using more than 100MB of memory.
  8. Scripting:
    • You can create and run PowerShell scripts by saving commands in a .ps1 file.
    • Make sure to set the execution policy using Set-ExecutionPolicy if you encounter script execution issues.
  9. Modules:
    • PowerShell modules are collections of cmdlets, functions, and scripts that extend its functionality.
    • You can use Import-Module to load a module and gain access to its commands.
  10. Getting Advanced:
    • PowerShell supports advanced scripting, including loops, conditional statements, functions, and more.
    • You can integrate PowerShell with other technologies like .NET and REST APIs.

Remember that PowerShell can interact with the file system, the Windows Registry, services, processes, and more, making it a powerful tool for managing and automating various tasks on Windows systems. As you become more comfortable, you can explore more advanced features and capabilities of PowerShell.

Table of Contents
Scroll to Top