json


Preserve datatype name when converting to JSON with ConvertTo-Json


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?
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

Related Links

systemjs configuration error leading to a file not found error
how to process JSON from Axios call in Scala
Extract JSON fields without looping in Talend
Adding no arg constructor to Scala enumerations
Get only the content of each commit in a json ? ( git diff json)
Parse specific output from json with jq
No Matching Action Clause to Process Request error on HTTPoison.patch
Creating JAR file with Maven and bundling json files into it
How to get Twitter organic impressions data from Twitter analytics API
How to reduce whitespace from JSON on the command line without installing a tool
Parsing a JSON string that is bigger than the memory
Why I don't get any response in console log?
JSON structure output
SQL 2008 remove smart quotes before data insert
Using JSONPath as a SOLR filter
How to use jsonp WP Rest API

Categories

HOME
batch-processing
vhdl
nlp
rotation
agile
decorator
recyclerview
phaser-framework
file-io
onenote-api
slim-3
powershell-v3.0
ndis
gatsby
symfony2-easyadmin
scenebuilder
ada
chocolatey
zend-framework-mvc
google-api-java-client
jogl
kadanes-algorithm
aws-cognito
multiple-columns
k2
explode
http-method
compare-and-swap
rhandsontable
owl-api
vcard
ggmap
data-conversion
multichoiceitems
superagent
devforce
helix-3d-toolkit
spring-profiles
pdflatex
freebase
web-audio-api
body-parser
fabric-digits
.net-assembly
wfp
office365connectors
discord.net
sonarqube-scan
strstr
installshield-2012
nsexception
react-native-router-flux
intersystems-ensemble
crop
worker
double-buffering
nsjsonserialization
walmart-electrode
livefyre
etherpad
react-native-fbsdk
paas
iphone-developer-program
opencpu
redux-router
qos
master
easing
ruby-2.0
qregexp
windows-nt
clob
spring-lemon
multilingual-app-toolkit
fps
emokit
date-format
spinlock
intellitest
cpu-cores
ejabberd-saas
odftoolkit
sortable
genetic-programming
getimagedata
boost-test
slick-2.0
factors
hamsterdb
exiv2
nsmatrix
sql-server-2012-web
localtime
backbone-relational
shortcuts
pascals-triangle
angularjs-timeout
zend-framework-modules
usn
parameterization
flash-cs5.5
ou
galaxy-tab
dcpu-16
search-path
pureftpd
carbide
hadoop-plugins
sitemappath
visual-c++-2008-express
openwysiwyg
outlook-form

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App