I'm having real issues trying to add multiple serverbindings to a single website using powershell!
Currently i have the following code:
function UpdateMetaBaseProperties($dirEntry, $Properties)
{
foreach($Prop in $Properties)
{
$KeyValue = $Prop.Split('=');
$dirEntry.psbase.Invoke("Put", ($KeyValue[0], $KeyValue[1]));
$dirEntry.psbase.Invoke("SetInfo");
Write-Host "Setting property: $KeyValue";
}
}
which is working for single valued properties but i can't seem to work out how to add as multiple.
I've tried
- Passing as array (throws exception)
- Passing as comma seperated string (puts all the string into 1 host entry)
- Passing as semi-colon seperated string (puts all the string into 1 host entry)
- Running the put twice (only saves the last host entry)
I've been searching an searching on google but nothing seems to work!
Please help!! :(