JSON - When two game devs changed the world.
(Neither are named Jason.)
Welcome back, Shackers 👋
In the last article we wrestled with SOAP's rigid XML and resource-centric formats. This time we dive into the moment data learned to speak our language: JSON - born from JavaScript's object literals and duct-tape.
The Origin Story
In the early 2000s, Douglas Crockford and his colleague Chip Morningstar built Cartoon Orbit, a browser-based online card trading game for Cartoon Network. XML proved too verbose for client-side JavaScript, slowing down performance.
Crockford and Morningstar weren't writing proof of concept - they were building a real online card-trading world. They needed a data exchange that:
Was as intuitive as a JavaScript object literal
Avoided XML's verbosity in users' browsers
Could be parsed in milliseconds, not seconds
The result: JavaScript Object Notation - by borrowing JavaScript's object literal syntax, they created JSON, a format that spoke the same language as the code in the browser and parsed in milliseconds.
When Crockford and Morningstar created JSON, they were solving a specific problem, but it quickly became more than just a workaround. JSON's minimalist structure lets us glance at a payload and understand the content or easily map it into software. It also allowed developers, QA engineers, and non-technical stakeholders to share one vocabulary.
A fan-made revival of the original Cartoon Orbit lives on at Cartoon Re-Orbit, so you can glimpse the sandbox that shaped JSON's birth.
Anatomy of JSON vs JavaScript Objects
JSON is a strict subset of JavaScript object literal syntax:
Every key and string requires double quotes
Trailing commas and comments are forbidden
Functions and methods cannot be included
This discipline yields a predictable, data-only format. In contrast, JavaScript object literals allow single-quoted strings, comments, and methods-features that enrich objects but make them unsuitable for interchange.
Quotes on keys:
Why JSON Matters: Beyond "Pretty Print"
Every format tells a story about its creators and users. JSON's rise wasn't just about lighter payloads. It was about humanizing data:
Readable even to non-programmers
Mappable to in-memory objects without conversions
A bridge between unstructured and structured data
The adoption of JSON by major tech companies (Google, Facebook, Twitter) in the late 2000s cemented its standing as the default language of web APIs. Today, JSON is everywhere:
Configs (
package.json,.eslintrc,.babelrc)Frontend state (Redux stores, localStorage dumps)
NoSQL databases (MongoDB documents, Firebase snapshots)
Structured logs (ElasticSearch, Splunk)
Interchange formats (VS Code settings, design exports, game worlds)
Whenever data moves between contexts-client and server, modules, or teams-JSON often stands in as the clear, shared format.
PowerShell & JSON: Converting Objects
PowerShell mirrors JavaScript's object literal mindset with hashtables, and makes JSON serialization a one-liner:
# JavaScript style object → PowerShell hashtable
$user = @{
name = "Shacker"
session = 3
topics = @("SOAP", "REST", "JSON")
inSession = $true
}
# Serialize to JSON
$jsonString = $user | ConvertTo-Json -Depth 3
# Deserialize back
$parsedObj = $jsonString | ConvertFrom-Json
$parsedObj.name # "Shacker"
Notice how PowerShell's ConvertTo-Json and ConvertFrom-Json let you convert seamlessly between object and string - just as JSON intended.
Homework: JSON in the wild
Create a JSON file representing a simple application configuration. Include at least one nested object and one array.
Open Notepad (or any text editor) and create a file named
appConfig.jsonPaste the below JSON content into the file
Save the file to a known location on your computer
{
"appName": "ScriptShackSnapStack",
"version": "1.0.0",
"settings": {
"theme": "bluScreen",
"notifications": true,
"languages": ["en", "es", "fr"]
},
"users": [
{
"guid": 1,
"name": "Jason",
"role": "admin"
},
{
"guid": 2,
"name": "Clint",
"role": "user"
}
]
}
What do you think this configuration represents?
In PowerShell, read and parse that JSON file with
ConvertFrom-Json. Extract and display three different values from the resulting object.Open PowerShell and run the below commands
Introduce a syntax error into your JSON file (e.g., missing comma or unquoted key). Attempt to parse it in PowerShell, record the error message, then correct the error and verify successful parsing.
# Read and parse the JSON file
$jsonPath = Read-Host -Prompt "Enter the path to your appConfig.json file"
$jsonContent = Get-Content -Path $jsonPath
$config = $jsonContent | ConvertFrom-Json
# Extract and display values
$config.appName # Displays "ScriptShackSnapStack"
$config.settings.theme # Displays "bluScreen"
$config.users[0].name # Displays the user index 0 - "Jason"
Locate an existing
.jsonfile on your computer. And parse it in PowerShell, displaying both the raw JSON and the parsed object.
# Search for a JSON file in your home directory
$randomJson = Get-ChildItem -Path $HOME -Filter *.json -Recurse | Get-Random
$jsonFilePath = $randomJson.FullName
# Read the JSON file
$jsonContent = Get-Content -Path $jsonFilePath
# Display the content
Write-Output $jsonContent
# Parse the JSON content into powershell
$data = $jsonContent | ConvertFrom-Json
# Display the parsed object
Write-Output $data
What did you find? Was it easy to understand the structure? What do you think the data represents?
In the next article, we will begin to explore PowerShell's Invoke-WebRequest cmdlet in-depth, and more about REST APIs.

