PDF download Download Article PDF download Download Article

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. PowerShell is included natively with Windows and can be opened from the Run command, while Mac and Linux users will need to install it and run it through the Terminal. Once running, there are some basic cmdlets that you can use to familiarize yourself with PowerShell.

Method 1
Method 1 of 4:

Running PowerShell (Windows)

PDF download Download Article
  1. This will open a Run command window.
    • If you don't want to use the Run command, you can also search the Start menu for “PowerShell”.
    • PowerShell is included with versions of Windows 7 or later.
  2. Advertisement
  3. A new PowerShell window will open.
  4. Advertisement
Method 2
Method 2 of 4:

Running PowerShell (Mac)

PDF download Download Article
  1. Go to https://github.com/PowerShell/PowerShell in your web browser. This is the official github page for PowerShell.
  2. You must be running OSX 10.11 or newer.
  3. This is the rocket icon in the bottom dock.
  4. You can also find the Terminal in "Applications > Utilities".
  5. A blank terminal window will appear.
  6. A powershell prompt will appear with “PS” displayed. This means that powershell is running and you can use the Terminal to enter cmdlets.
  7. Advertisement
Method 3
Method 3 of 4:

Running PowerShell (Ubuntu)

PDF download Download Article
  1. Go to https://github.com/PowerShell/PowerShell in your web browser. This is the official github page for PowerShell.
  2. PowerShell is available for Ubuntu 14.04 or 16.04. They have separate installers listed on the page.
  3. You can hit Win+Alt+T or click “Home” and search for “Terminal”.
  4. 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.
    • 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. This PowerShell configuration will complete.
  6. A powershell prompt will appear and you can run cmdlets in the Terminal.
  7. Advertisement
Method 4
Method 4 of 4:

Using Basic PowerShell Commands

PDF download Download Article
  1. On its own, this cmdlet will display all other cmdlets. You can narrow your search using modifiers.
    • For example: “Get-Command Name *Disable*” will display only cmdlets with ‘disable’ in the name.
    • All cmdlets are entered by typing them into the PowerShell window and hitting Enter.
  2. This cmdlet will give you all the information regarding another cmdlet, most importantly syntax for how the target cmdlet is used.
    • For example: “Get-Help Get-Process” will display all the usable information for the ‘Get-Process’ cmdlet.
  3. 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.
    • For example: “Get-Process winword” will display all processes being run by Microsoft Word.
    • Similarly, “Start-Process” can be used to launch an instance of an application/process.
  4. 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.
    • 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. The criteria in Where-Object is set by using the following formatting: “{$_[object] [operator] [parameter] }”. Where-Object also needs an object piped to it.
    • 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”.
    • 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).[1]
    • Parameters using strings (words) must be enclosed in quotations marks. This is not necessary for integers (numbers).
  6. Advertisement

Community Q&A

Search
Add New Question
  • Question
    What is the main function of power shell?
    Community Answer
    Community Answer
    Powershell is a coding program (for advanced users) and it is relative to CMD, but with admin all the time.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

You Might Also Like

Install the Google Play Store on an Amazon Fire Add the Google Play Store to an Amazon Fire Tablet
Check Browsing History on a WiFi RouterCheck Browsing History on a WiFi Router
Remove Write Protection from a USB Drive Remove Write Protection from a USB Pen Drive
Connect PC to TV with HDMIConnect PC to TV with HDMI
Bypass Screen Time Passcode Bypass Your Screen Time Passcode: Reset, Remove, or Hack Screen Time
Pair Jbl Earbuds6 Ways to Pair Your JBL Earbuds: Guide & Troubleshooting Tips
Read Dump FilesEasy Ways to Read Crash Dump Files & Troubleshoot Crashes
Find the Publication Date of a Website3 Easy Ways to Find the Publication Date of a Website
Turn on Keyboard Light Lenovo Turn on Backlit Keyboard on Lenovo
Format a Write–Protected Pen DriveFormat a Write–Protected Pen Drive
Listen to Police Radio Listen to Police Radio Online: Best Apps & Websites
Create a Desktop Shortcut Create Desktop Shortcuts for Files & Websites
Guess a Password Guess a Password
Cheat a Step Counter on a Phone10 Genius Ways to Cheat a Step Counter on a Phone (No Walking Required)
Advertisement

About This Article

wikiHow Staff
Co-authored by:
wikiHow Staff Writer
This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow's Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards. This article has been viewed 40,896 times.
How helpful is this?
Co-authors: 6
Updated: April 3, 2023
Views: 40,896
Thanks to all authors for creating a page that has been read 40,896 times.

Is this article up to date?

Advertisement