Thanks for the reply I really appreciate it.
Your reply got me thinking. I don't know whether it matters if its a system.object or not, aren't they both arrays?
I have simplified what I am trying to do, by removing the full function, to its bare minimum. I **think** I need to somehow make the AllowedIPAddresses an array rather than string. this is basically what I am struggling with
$SrcFWFile = 'c:\temp\Rules.csv'
$Srcdata = import-csv -path $SrcFWFile
# $Srcdata | Select-Object Ruleset, AllowedIPAddresses , Enabled
$Srcdata = import-csv -path $SrcFWFile
foreach ($currentsetting in $Srcdata) {
if($Srcdata -ne $null){
$Srcfwenabled = $Srcdata | Where-Object { $_.Ruleset -eq $CurrentSetting.Ruleset } | Select-Object Ruleset, Enabled
$SrcfwIpList = $Srcdata | Where-Object { $_.Ruleset -eq $CurrentSetting.Ruleset } | Select-Object Ruleset, AllowedIPAddresses
}
$type = $SrcfwIpList.AllowedIPAddresses
$SrcfwIpList.Ruleset, $type.GetType().Name, $SrcfwIpList.AllowedIPAddresses
}