Windows 7 및 PowerGUI Script Editor를 사용하여 ps1을 작성하고 있습니다. 여기 내 코드의 일부입니다 :복잡한 사전에 대한 foreach 루프가 올바르지 않습니다.
#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!
}
}
그것은 여기 매우 이상하다 왜하지 않는 KeyValuePair
Dic_CountsSingle
이지만, 그냥 같은 Dic_Counts
로이다 ??
대단히 감사합니다!
당신이 설명 할 수 있습니까? –