I'm trying to export my SSIS catalog environment to a JSON file (with PowerShell). When I select the right columns I see "String" and "Int16" as value for the Type: but when I convert to JSON with ConvertTo-Json it shows the int values instead of the string values: Any suggestions?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Looks like the Type
values are of type [System.Data.DbType]
. ConvertTo-Json
converts the value names to the underlying numerical value of the DbType
enum.
You can override this behavior with the Select-Object
statement:
$Environment.Variables |Select-Object Name,Description,@{Name='Type';Expression={"$($_.Type)"}},Sensitivity,Value |ConvertTo-Json