• Home
  • About
  • Contact
  • Resources
  • News
  • Home
  • About
  • Contact
  • Resources
  • News
Powershell Newbie

Get | Set | Start

Get-command of it

5/4/2017

0 Comments

 
What will do what you need to do? This is the exact question that the Get-Command cmdlet answers. Try it. Open PowerShell and type:
Get-Command *process*
Picture
This provides us some possible commands to get, start, or stop a process or multiple processes.
Next we could use Get-Process to find a process that we might want to stop.
Put it in practice(hit enter at the end of each line and learn from watching the results):
Get-Command *process*
Get-Process *notepad*
notepad.exe
Get-Process *notepad*
Get-Process *notepad* | Stop-Process
First you get the commands. Next you use a command to get a result (or in our case, no result until notepad is open. Finally you use the results to cause an administrative action by piping from one command and resulting object to another command.
Now, go have fun and see what other commands you can discover!

0 Comments



Leave a Reply.

    Joshua B. Jones, VCP6-DCV

    Professional PowerShell Fan, Automation & Virtualization Expert

    Archives

    February 2018
    January 2018
    December 2017
    November 2017
    May 2017
    August 2016

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.