1. Very Simple Powershell

    Basic Powershell

    Variable

    $<name>=<value>

    $usrname='John'
    $len=32
    

    $null -> null value

    $true -> boolean true

    $false -> boolean false

    $_ -> the variable currently being processed

    Data Structure

    Array

    $var=@(<element>,<element>,...)
    $var[0]
    $var[100]=2333
    

    Hash Table

    $var=@{<key>=<value>,...}
    $var[<key>]
    $var.key
    

    Process Control

    Branch

    if()
    {
        ...
    }
    elseif()
    {
        ...
    }
    else …
    Tagged as : powershell

Pages