githubEdit

Cheatsheet

Basics

  • Search Commands

    #list all powershell cmdlets, functions and alias
    Get-Command
    
    #search ommands that starts with get
    Get-Command get*
    
    #search commands that ends with object
    Get-Command *object
    
    #search command for a verb
    Get-Command -Verb Get
    
    #search command for a noun
    Get-Command -Noun Object
    
  • Help

    #get help for the command New-Object
    Get-Help New-Object
    
    #List Examples for New-Object
    Get-Help New-Object -Example
    
    #get detailed help for New-Object 
    Get-Help New-Object -Detailed
    
    #get online help for the command
    Get-Help New-Object -Online
  • Alias

    # Print all alias
    Get-Alias
    
    #search alias
    Get-Alias search_term
  • Variables

    #Storging values/object/data in variable
    $myobj = Get-Childitem
    $myobj = Get-Location
    $myobj = "Doctor Dragon"

Filesystem

  • Filesystem Navigation

Classes and Objects

  • Creating a Class in Powershell

  • Creating objects from a class

  • List Properties and Methods of Objects

  • Accessing Properties and methods of object

  • Selecting Objects

  • Filtering Objects

Format Object

  • Format-List

  • Format-Table

Running Scripts

  • Local Scripts

  • Remote Scripts

Language Mode

Last updated