创建字符串, 数组, 哈希表和自定义对象的方法
字符串(头上的@"必须单独一行, 末尾的"@必须顶格写):
$string = @"
I am a string
again
"@
数组:
$array = @( 'I am array[0]'
'I am array[1]')
或者:$array = 1, 'element', 3
哈希表:
$ht = @{ ID = 'ZhangSan'; Sex = 'Male'; Age = 23 }
自定义对象:
$psco = [PSCustomObject]@{ 'ID' = 'ZhangSan'; 'Age' = 23 }, [PSCustomObject]@{ 'ID' = 'LiSi'; 'Age' = 11 }