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

Get data from URL json in R
how to create json object in angular2
Extract value of single string record from PostgreSQL JSON column
Process json response in ruby
Getting 406 error when sending json response from controller
How To Intercept #RequestBody Binding
Why does my code panic when I type assert an interface?
Public VAT/BTW REST API
Custom Function to Extract Data from JSON API Based on Column Values in Excel VBA
“ЭThe app has not been configured with a WORKSPACE_ID environment variable” error for app on NodeJS in bluemix
Convert json list data's column datatype
Json Error In Laravel Ajax
How is India related to “Indira Gandhi”? (no need to find all existing relationships, but find at least an interesting one)
RAML - json schema error
Node Express & JSON Response Format
How to pass parameterized JSON value to the XSLT 2.0?

Categories

HOME
laravel-5
ssas-2012
admin-on-rest
ncurses
raspbian
boost-thread
fparsec
jbehave
amazon-product-api
vuex
flexbox
keystore
lagom
uiscrollview
public-key-encryption
local
cloudflare
eclipselink
statusbar
excel-2010
google-maps-android-api-2
tflearn
vcard
jboss5.x
ioc-container
spring-profiles
backup-strategies
von-neumann
remote-server
bing-maps-api
es-shell
mongoexport
magiczoomplus
haskell-pipes
infusionsoft
intellilock
stress-testing
python-idle
google-maps-ios
uicollectionviewlayout
castle-dynamicproxy
adler32
rxvt
spring-ioc
picasa
dojox.charting
pagekit
image-editing
coordinate-transformation
string-parsing
asp.net-mvc-2
except
android-snackbar
abas
team-build
scrollspy
httpie
pl-i
orientation-changes
rhel5
kendo-mvvm
fragment-tab-host
cg
collabnet
sid
android-looper
vertical-rhythm
iconv
digital-design
zend-lucene
awesomeprint
transitive-closure-table
cbcentralmanager
vim-powerline
serp
charts4j
cookieless
post-redirect-get
drawtext
asp.net-routing
hardware-acceleration
quick-search
unreachable-code
grooveshark
opcodes
writing

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