How to Run Powershell

Powershell is a command-line shell used for task automation via a scripting language based on Microsoft's .NET framework. Powershell uses commands called cmdlets to integrate with scripts or applications.https://technet.microsoft.com/en-...

Method 1 of 4:

Running Powershell (Windows)

  1. Picture 1 of How to Run Powershell
    Hit Win+R. This will open a Run command window.
    1. If you don't want to use the Run command, you can also search the Start menu for 'Powershell'.
    2. Powershell is included with versions of Windows 7 or later.
  2. Picture 2 of How to Run Powershell
    Enter 'Powershell' into the text field.
  3. Picture 3 of How to Run Powershell
    Click 'OK'. A new Powershell window will open.
Method 2 of 4:

Running Powershell (Mac)

  1. Picture 4 of How to Run Powershell
    Go to https://github.com/PowerShell/PowerShell in your web browser. This is the official github page for Powershell.
  2. Picture 5 of How to Run Powershell
    Download and install the .pkg file for Mac. You must be running OSX 10.11 or newer.
  3. Picture 6 of How to Run Powershell
    Open the Launchpad. This is the rocket icon in the bottom dock.
  4. Picture 7 of How to Run Powershell
    Enter "Terminal" into the search field. You can also find the Terminal in "Applications > Utilities".
  5. Picture 8 of How to Run Powershell
    Launch Terminal. A blank terminal window will appear.
  6. Picture 9 of How to Run Powershell
    Enter 'powershell' and hit Enter. A powershell prompt will appear with 'PS' displayed. This means that powershell is running and you can use the Terminal to enter cmdlets.
Method 3 of 4:

Running Powershell (Ubuntu)

  1. Picture 10 of How to Run Powershell
    Go to https://github.com/PowerShell/PowerShell in your web browser. This is the official github page for Powershell.
  2. Picture 11 of How to Run Powershell
    Download the .deb file for your corresponding version of Linux. Powershell is available for Ubuntu 14.04 or 16.04. They have separate installers listed on the page.
  3. Picture 12 of How to Run Powershell
    Open a Terminal window. You can hit Win+Alt+T or click 'Home' and search for 'Terminal'.
  4. Picture 13 of How to Run Powershell
    Enter 'sudo dpkg -i [installer filename]' and hit Enter. You will be prompted to enter your computer password when using the 'sudo' command. You may see a failure with unmet dependencies, but this will be resolved soon.
    1. The installer filename will look like 'powershell_6.0.0-alpha.10-1ubuntu1.16.04.1_amd64.deb' or 'powershell_6.0.0-alpha.10-1ubuntu1.14.04.1_amd64.deb' depending on which version of Ubuntu you are running.
  5. Picture 14 of How to Run Powershell
    Enter 'sudo apt-get install -f' and hit Enter. This Powershell configuration will complete.
  6. Picture 15 of How to Run Powershell
    Enter 'powershell' and hit Enter. A powershell prompt will appear and you can run cmdlets in the Terminal.
Method 4 of 4:

Using Basic Powershell Commands

  1. Picture 16 of How to Run Powershell
    Use 'Get-Command' to find cmdlets. On its own, this cmdlet will display all other cmdlets. You can narrow your search using modifiers.
    1. For example: 'Get-Command Name *Disable*' will display only cmdlets with 'disable' in the name.
    2. All cmdlets are entered by typing them into the Powershell window and hitting Enter.
  2. Picture 17 of How to Run Powershell
    Use 'Get-Help' to get info on a certain cmdlet. This cmdlet will give you all the information regarding another cmdlet, most importantly syntax for how the target cmdlet is used.
    1. For example: 'Get-Help Get-Process' will display all the usable information for the 'Get-Process' cmdlet.
  3. Picture 18 of How to Run Powershell
    Use 'Get-Process' to use a process running on a computer. Alone this will display a full list of processes running on your computer. With a modifier, you can single out processes coming from a specific application.
    1. For example: 'Get-Process winword' will display all processes being run by Microsoft Word.
    2. Similarly, 'Start-Process' can be used to launch an instance of an application/process.
  4. Picture 19 of How to Run Powershell
    Use 'Get-Member' to see properties or methods of an object. This cmdlet needs an object 'piped' to it in order to be useful. This is done by adding a '|' between an object and the 'Get-Member' cmdlet.
    1. For example: 'Get-Process | Get-Member' will pipe the Get-Process cmdlet to Get-Member, and Get-Member will list all of the properties and methods you can utilize when scripting with Get-Process.
  5. Picture 20 of How to Run Powershell
    Use 'Where-Object' to select objects based on criteria. The criteria in Where-Object is set by using the following formatting: '{$_[object] [operator] [parameter] }'. Where-Object also needs an object piped to it.
    1. For example: 'Get-Process | Where-Object { $_.name -eq 'notepad' }' will run Get-Process with the limitation where the object's name is equal to 'notepad'.
    2. Other operators include: '-lt' (less than), '-gt' (greater than), '-le' (less than or equal to), '-ge' (greater than or equal to), '-ne' (not equal to), or '-like' (pattern matching).[2]
    3. Parameters using strings (words) must be enclosed in quotations marks. This is not necessary for integers (numbers).
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile