我正在尝试将调用的 Hashtable 传递$SqlInstanceParams给 Invoke-DbaQuery dbatools 命令:
Invoke-DbaQuery -SqlInstance "X" -Database "X" -Query "Set-SQLInstance" -SqlParameters $SqlInstanceParams -CommandType StoredProcedure
显示我填充的哈希表变量,一切看起来都很好,但是当查询执行时,我得到了这个错误:
No mapping exists from object type System.Version to a known managed provider native type.
我是否需要以某种方式转换此哈希表或单独列出每个参数,而不是仅传递哈希表变量:
$SqlInstanceParams = @{IsClustered = $SqlInstanceParams["IsClustered"];
ServerName = $SqlInstanceParams["ServerName"] etc}