Create JSON for SPMT format issue

I’m using Microsoft’s Sharepoint Migration Tool (SPMT) and am looking to batch create JSON files in Powershell that I can import to SPMT.

While the JSONLINT validator site says it passes, SPMT says it’s not formatted correctly.

When saving a migration JSON file directly from SPMT, the JSON is formated like this (and can be imported back to SPMT):

{
"Tasks": [
{
"SourcePath": "X:",
"TargetPath": "https://my.sharepoint.com/personal/MyOneDrive",
"TargetList": "Documents"
}
]
}
When I create it in Powershell, it's result looks like this (and reports an format error in SPMT:
{
"Tasks":
{
"SourcePath": "X:",
"TargetPath": "https://usdagcc-my.sharepoint.com/personal/MyOneDrive",
"TargetList": "Documents"
}
}
The code I'm using is:
$OnPremToOneDrive = @{
Tasks = [ORDERED]@{
SourcePath = "X:"
TargetPath = "https://my.sharepoint.com/personal/MyOneDrive"
TargetList = 'Documents'
} #end Tasks
} #end $OnPremToOneDrive
ConvertTo-Json $OnPremToOneDrive -Depth 10

Figured out what I was missing. The nested array.

$OnPremToOneDrive = @{
Tasks = @(
[ORDERED]@{
SourcePath = "X:"
TargetPath = "https://my.sharepoint.com/personal/MyOneDrive"
TargetList = 'Documents'
} #end [ordered]
) #end Tasks
} #end $OnPremToOneDrive
ConvertTo-Json $OnPremToOneDrive -Depth 10