1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| Set-StrictMode -Version Latest $color='blue' Set-Variable -Name color -Value blue Get-Variable -Name color $foo=$null $LASTEXITCODE Get-Variable -Name *Preference $ErrorActionPreference='SilentlyContinue' $foo=1 $foo='one' $foo=$true
$num=1 $num.GetType().name $num=1.5 $num.GetType().name [Int32]$num
"$color" '$color'
Select-Object -InputObject $color -Property * $color.Length Get-Member -InputObject $color Get-Member -InputObject $color -Name Remove $color.Remove(1,1)
$colorPicker=@('blue','white','yellow','black') $colorPicker[0] $colorPicker[1..3] $colorPicker=$colorPicker+'orange' $colorPicker+='brown' $colorPicker+=@('pink','cyan')
$colorPicker=[System.Collections.ArrayList]@['blue','white','yellow','black'] $null=$colorPicker.Add('gray') $colorPicker.Remove('gray')
$users=@{ abertram='Adam Betram'; raquelcer='Raquel Cerillo'; zheng21='Justin Zheng' } $users['abertram'] $users.abertram $users.Keys $users.Values $users.Add('natice','Natalie Ice') $users['phrigo']='Phil Rigo' $users.ContainsKey('johnnyq') $users.Remove('natice')
$myFirstCustomObject=New-Object -TypeName PSCustomObject $myFirstCustomObject=[PSCustomObject]@{OSBuild='x';OSVersion='y'} $myFirstCustomObject.OSBuild
|