Invoke-RestMethod automatically parses the API's JSON response into an object [graph] - a nested [pscustomobject] instance.
While very convenient for subsequent OO processing, such an object's display representation isn't very helpful.
You can simply convert back to JSON in order to visualize the result:
function Get-Holiday {
# Call the API, which returns JSON that is parsed into a [pscustomobject]
# graph, and return (output) the result.
Invoke-RestMethod -Method Get -Uri https://www.gov.uk/bank-holidays.json
}
$list = Get-Holiday
# Visualize the object for display by converting it back to JSON.
$list | ConvertTo-Json -Depth 3
Note the unfortunate need to specify -Depth 3 explicitly - see this question.
With respect to processing, here's an example that accesses the first entry for England and Wales:
$list.'england-and-wales'.events[0]
The above yields:
title date notes bunting
----- ---- ----- -------
New Year’s Day 2015-01-01 True