如何在通过 Add-OdbcDsn (Powershell) 添加 DSN 时在 -SetPropertyValue 中添加文件路径

问题描述 投票:0回答:1

我使用下面的 pwoershell 脚本为 ODBC 驱动程序添加了 DSN

Add-OdbcDsn -Name "My_Connew" -DriverName "Simba ODBC Driver for Google BigQuery" -DsnType "System" -Platform "64-bit" -SetPropertyValue @("[email protected]", "Key File Path=C:\vocus-sandpit-dfa36ce40776.json") 

一切正常,但无法添加文件路径。

enter image description here

想知道如何通过 -SetPropertyValue 添加文件路径?

powershell google-bigquery odbc simba
1个回答
0
投票

UI 使用的标签可能与配置模式中的实际键名不一一对应 - 例如,

Key File Path
的真实键名只是
KeyFilePath

要弄清楚要使用什么,只需查阅 文档 并在 UI 中找到给定配置选项的适当键名,然后使用它们,例如:

Set-OdbcDsn -Name "My_Connew" -SetPropertyValue @(
    "[email protected]", 
    "KeyFilePath=C:\vocus-sandpit-dfa36ce40776.json",
    "Catalog=vocus-sandpitvocus-sandpit",
    "DefaultDataset=vocus_rawnew"
)
© www.soinside.com 2019 - 2024. All rights reserved.