Open
Description
in the code here :
$DsnArray = Get-OdbcDsn -DriverName 'SQL Server Native Client 10.0'
ForEach ($Dsn in $ DsnArr) {
Remove-OdbcDsn -InputObject $Dsn
# You can change the property array as well,
# if DSN attributes have been changed in the new driver version
Add-OdbcDsn -Name $Dsn.Name -DsnType $Dsn.DsnType -Platform $Dsn.Platform -DriverName 'SQL Server Native Client 12.0' -SetPropertyValue $Dsn.PropertyValue
}
The properties SetPropertyValue $Dsn.PropertyValue doesn't work if ClientCertificate
is set to null.
In this case an error is poped:
dd-OdbcDsn : Erreur de syntaxe dans le paramètre SetPropertyValue {ClientCertificate=}. Le paramètre doit être au
format "MyKey=MyValue".
Au caractère Ligne:1 : 1
+ Add-OdbcDsn -name $dsn.Name -DriverName $dsn.DriverName -SetPropertyV ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_OdbcDsnTask:Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], CimExc
eption
+ FullyQualifiedErrorId : MI RESULT 1,Add-OdbcDsn
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 5e1a60eb-a37d-8b59-5b67-fa4bde46cb17
- Version Independent ID: c67b845b-c7d3-d084-52ba-154f7ddb4ab2
- Content: Add-OdbcDsn (Wdac)
- Content Source: docset/winserver2022-ps/wdac/Add-OdbcDsn.md
- Product: w10
- Technology: windows
- GitHub Login: @JasonGerend
- Microsoft Alias: jgerend