
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert Hashtable to JSON Format using PowerShell
To convert the hashtable to the JSON format we can use the ConvertTo-Json command. First, we have the following hashtable,
Example
$Body = [PSCustomObject]@{ AppName = 'StorageXIO' AppID ='xo2ss-12233-2nn12' License = 'valid' }
To convert the hashtable to the JSON format,
$Body | ConvertTo-Json
Once you run the above command, properties are converted to the JSON format.
Output
{ "AppName": "StorageXIO", "AppID": "xo2ss-12233-2nn12", "License": "valid" }
Advertisements