Difference between revisions of "Global Knowledge PowerShell Training"

From RiceFamily Wiki
Jump to: navigation, search
(Notes)
(Objects)
Line 64: Line 64:
  
 
== Objects ==
 
== Objects ==
 +
get-process | *get-member*
 +
 +
Get-Member will output the member properties for an Object
 +
 +
-----
 +
 
get-service | Format-Table *
 
get-service | Format-Table *
  
 
get-service spooler | Format-list
 
get-service spooler | Format-list
 +
 +
-----
 +
 +
  
  

Revision as of 19:36, 8 June 2015

General Information about PowerShell

Notes

Different versions of PowerShell are available for different OS's. Microsoft is using PowerShell as a way to drive people to upgrade to the latest version of Windows. Newer versions of Powershell work better with Newer versions of Microsoft Windows.

Two versions of the Powershell interface.

  • Console
    • Basic Command-Line
    • Maximum support for PowerShell
    • Minimal editing capabilities
  • ISE
    • Script Editor and Console Combination
    • Some PowerShell features not supported
    • Rich editing cap
  • Third Party hosting apps/Editors

help dir -Online

help dir -ShowWindow

The "-WhatIf" option will allow you to "Dry Run" a command that might modify something on the system.

The "-Confirm" option allows for a Y/N query per item for any command that MODIFIES the system.


get-command

get-command | measure-object

get-command | out-gridview

Show-Command Get-ChildItem

The "back tick" character (above the TAB key) is the "Line Continued Below" reference.

help dir `
-ShowWindow

is the same as

help dir -ShowWindow


get-service | sort-object -Property Status | Out-File Service.txt

same as ...

get-service | sort-object -Property Status > C:\Service.txt


get-service | sort-object -Property Status | Out-File Service.txt -Append

same as ...

get-service | sort-object -Property Status >> C:\Service.txt

Objects

get-process | *get-member*

Get-Member will output the member properties for an Object


get-service | Format-Table *

get-service spooler | Format-list