Hi,
I am using the powershell example on the support site to try to create Dynamic Folders for WebConnections. I have no issue creating the base object from a CSV, but I’m getting stuck at adding other properties.
From the examples for Dynamic Folders I’ve modified it to create a webconnection, but trying to add in other properties does not work. For example in the code below, it imports and runs with no errors, but IgnoreCertificateErrors = True does not do anything. Similar if using UseDedicatedEngine = True also does not check that check box.
$ErrorActionPreference = "Stop"
$computers = Import-Csv "$CustomProperty.CSVPath$"
$connections = @()
ForEach ($computer in $computers) {
$name = $computer.Name
$computerName = $computer.ComputerName
$username = $computer.Username
$password = $computer.Password
$connection = New-Object pscustomobject -Property @{
"Type" = "WEBConnection";
"Name" = $name;
"ComputerName" = "HTTPS://" + $computerName + "/xui";
"IgnoreCertificateErrors" = "True";
}
$connections += $connection
}
@{
Objects = $connections
} |
ConvertTo-Json -Depth 100 |
Write-Host
If anyone has any ideas please let me know.
Many Thanks!