Add a function that creates a connItems from an ADO connection and creates a UDL file from it.
$connItems = @{}
$filteredContent -split ';' | ForEach-Object {
$keyValue = $_ -split '='
if ($keyValue.Count -eq 2) {
$key = $keyValue[0].Trim()
$value = $keyValue[1].Trim()
if ($key -ne '') {
$connItems [$key] = $value
}
}
}
$connStr = ($masterConnItems.GetEnumerator() | ForEach-Object {
"$($_.Key)=$($_.Value)"
}) -join ';'
$udlContent = @"
[oledb]
; Everything after this line is an OLE DB initstring
$connStr
"@
$udlContent | Out-File -FilePath $udlFilePath -Encoding Unicode
Add a function that creates a connItems from an ADO connection and creates a UDL file from it.