Я использую Windows 7 и PowerGUI Script Editor для написания ps1.Вот часть моих кодов:
#In global scope
$Type_Trans = "System.Collections.Generic.Dictionary[System.String,PSObject]"
$Type_Farms = "System.Collections.Generic.Dictionary[System.Int32,$Type_Trans]"
$Dic_Counts = New-Object $Type_Farms
#...puts some data in $Dic_Counts here...
#It is no problem with printing out it in console
#Now call the function below
Write-Data $Dic_Counts
Function Write-Data
{
param(
$Dic_Counts
)
Foreach($Dic_CountsSingle in $Dic_Counts)
{
Write-DataSingle $Dic_CountsSingle #THIS LINE!
}
}
Здесь очень странно: почему Dic_CountsSingle
не KeyValuePair
, а точно так же как Dic_Counts
??
Спасиботебе очень нравится!