Just happend to have a similar issue. I came up with this function. Hope this helps
Function Get-Clients {
param (
[Parameter(mandatory=$true)]$MerakiApiKey,
[Parameter(mandatory=$true)]$networkId,
$perPage = "50"
)
$headers = @{
"X-Cisco-Meraki-API-Key" = $MerakiapiKey
"Content-Type" = "application/json"
"Accept" = "application/json"
}
$ClientBody = @{
perPage = $perPage
}
$AllClientData = $null
do {
Write-Host "Requesting clients from $clientsurl"
$result = Invoke-WebRequest -Uri $clientsurl -Headers $Headers -Body $ClientBody
$AllClientData += $result.Content | ConvertFrom-Json
$clientsurl = $result.RelationLink.next
return $AllClientData
}