Ok after working on it I was able to parse the ini file and get the information i needed by using the below code. I don't know if this is the best method. But it gives me the below the only thing I am having an issue with is taking 3 of the string and making it one string. i used a foreach and then join but it is not working.
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
True True String System.Object
Code: Select all
$ConfigFile = sls -path .\file.ini -Pattern 'Primary', 'Secondary' -SimpleMatch
foreach ($a in $ConfigFile.line)
{
if (!(
$a -match "remove1" -or
$a -match "remove2" -or
$a -match "remove3" -or
$a -match "remove4" -or
$a -match "remove5" -or
$a -match "remove6" -or
$a -match "remove7" -or
$a -match "remove8"))
{
$Needed = $a|%{$_ -replace ".*="}
$Needed
}
}