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

Angular2 RC5: get json data from web service not working
Loop through list of URLs using .Open (Parsing JSON in VBA)
Get unique records where column type is JSONB
Convert complex JSON (with arrays and different data types) to CSV using JQ 1.4
is there away to make json return the search for one character?
How to parse to TDateTime a date time returned from a JSON String in Delphi XE 10 [duplicate]
Extracting all the information from an uncommon JSON structure in R
XSLT output JSON instead of XML
ObjectMapper won't unwrap JSON for REST
Looping a request that returns results in order they were put in
How to convert array of dictionary to JSON?
Can not load the image from JSON using carousel bootstrap
How can I generate or import multiple json files in one, with webpack?
Firebase 3 orderByChild not working with ionic2
qml append json stream to listmodel
Read JSON Data With String Key: Angular2

Categories

HOME
shopify
puzzle
nlp
wildcard
bing
label
wms
deep-linking
cocos2d-x-3.0
angular2-directives
snap.svg
keystore
onsen-ui2
phoenix
sign
mod-pagespeed
jquery-terminal
mule-studio
alfresco-share
kadanes-algorithm
tweets
koa
autolayout
philips-hue
iis-10
java-ee-7
helper
hotmail
openpgp
redhat-datavirt
alchemy.js
soundjs
bing-translator-api
catia
z3py
aqgridview
amazon-machine-learning
sapui
scd
jszip
emoticons
iron.io
cleditor
multifile-uploader
dojox.charting
windows-nt
kendo-combobox
dbscan
codesign
dac
sun-codemodel
handlebars.java
getrusage
persistence.xml
android-viewholder
vips
mysqldumpslow
paypal-nvp
lines-of-code
apache-mina
scrollspy
hiera
adodb
ctrlp
lexicographic
libsndfile
fragment-tab-host
ember-addon
getimagedata
ssms-addin
late-static-binding
winrt-httpclient
cilk-plus
goinstant
manage.py
fraud-prevention
qtgui
socketstream
maven-ear-plugin
radchart
pstree
icefaces-3
nintendo
hashalgorithm
selectmanycheckbox
associative
out-of-browser
trampolines
visual-c++-2008-express





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss