Arrays

Array ("@")

@('test', 'test2') 
# test
# test2

Array: check value in array

@('test', 'test2').contains("test")
# True

Array: Write-Host array in color

Write-Host @('test', 'test2', 'dummy', 'trial') -Separator ", " -ForegroundColor red -BackgroundColor white #colours not shown here
# test, test2, dummy, trial

Array: Sort

@('test', 'test2') | sort -Descending
# test2
# test

Array: Group

@('test', 'test') | group-object $_ 
# Count Name                      Group
# ----- ----                      -----
#     2 test                      {test, test}

Array: Measure

@('test', 'test') | measure
# Count    : 2
# Average  :
# Sum      :
# Maximum  :
# Minimum  :
# Property :

results for ""

    No results matching ""