Finally got the code working as it should:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Your Authorization")
$response = Invoke-RestMethod 'Where the code came from' -Method 'GET' -Headers $headers
$headers2 = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers2.Add("Content-Type", "application/json")
$response2 = Invoke-RestMethod 'Where the data is going' -Method 'POST' -Headers $headers2 -Body (ConvertTo-Json @($response.value))
$response2 | ConvertTo-Json
A few key notes for anyone trying to recreate this push data set:
- Power Bi only allows you to Post a total of 10k rows worth of data at a time.
- Power Bi only allows you to queue up 5 Post requests at a time.
If your data is larger than that those two instances then you will need to create multiple get/post statements and use the top/skip to select 10k rows at a time