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

How to avoid scientific notation in circe JSON serialization
Golang Godog REST API Test fails
How to document json/js object for intellisense in vscode?
Laravel return query to single object
Swift: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on accessing JSON URL
Passing the data of database in json object in laravel
spring restcontroller and responsebody returns list items like $ref
How do I fix the CRLF and LF warnings and permanently delete the index.lock file on the git bash command line?
How to consume a simple Restful service with Scala and Akka-Http 10.0.5
Merging two XML files on a key field
Jmeter - Json Extractor removing white space causes test to fail
Creating Dynamic HTML using json data in reactjs
API get return a loop of data in array format for json data
How to check if the change in nested data is permissible
Haproxy error 500 when use method POST with JSON, but works on backend
IIS doesn't serve JSON

Categories

HOME
json
caching
ocaml
translation
fparsec
cpu-architecture
decorator
laravel-5.2
docker-swarm
transparent
rocketmq
tizen-wearable-sdk
criteria
flexbox
informatica-powercenter
tee
webmethods
typeahead
reduction
off-canvas-menu
movies
jogl
distance
backpropagation
statusbar
facebook4j
bootstrap-typeahead
badge
non-deterministic
sumo
cgal
data-conversion
aurelia-binding
datadog
bxslider
getjson
ifstream
elfinder
jquery-multidatespicker
xbim
service-fabric-stateful
ttcn
context-free-language
startapp
amazon-clouddrive
automator
windows-firewall
livefyre
gauss
pinvoke
jenkins-jira-trigger
livescribe
ogre3d
android-bitmap
info
alter
visible
multiple-file-upload
com-interop
concur
fill
bluesnap
asymptote
plone-3.x
function-fitting
matcaffe
js-cookie
mogrify
ember-cli-addons
adodb
low-level
multipleselection
c++-actor-framework
adcolony
adaptive-compression
colt
codeigniter-a3m
delphi-xe3
opensocial
gfs
angulartics
multiple-conditions
argb
surveyor-gem
client-side-scripting
dynamics-ax-2009
gdataxml
pitch
applicationcontext
signals2
supersized
maven-ant-tasks
jquery-selectbox
wchar
webkit-transform
libavformat
pantheios
j-interop
delegatecommand
communicationexception
asp.net-mvc-controller
visual-studio-2010-beta-2
web-analytics-tools

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