- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert the hashtable to the 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" }
- Related Articles
- How to convert JSON object to Hashtable format using PowerShell?
- How to convert command output to the Hashtable format in PowerShell?
- How to convert JSON to CSV file using PowerShell?
- How to convert Dictionary to Hashtable in PowerShell?
- How to convert JSON file to CSV file using PowerShell?
- How to format the disk using PowerShell?
- How to add multiple values in the Hashtable using PowerShell?
- How to convert Python date in JSON format?
- Explain JSON format in PowerShell.
- How to format string using PowerShell?
- Convert JSON to another JSON format with recursion JavaScript
- How to convert MySQL DATETIME value to JSON format in JavaScript?
- How to use Hashtable splatting in PowerShell?
- How to convert the JSON object to a bean using JSON-lib API in Java?
- How to convert string to JSON using Python?

Advertisements