public/Get-IPRange.ps1

function Get-ZStackIPRange {
    # .SYNOPSIS
    # Returns IP ranges in the selected cloud or Layer 3 network.
    # .DESCRIPTION
    # ZStack PowerCLI (ZStack.PowerCLI 1.1.5) uses CLI 1.1.5, commit 6fcf509ff540d0098f54c1c33609dbe9f572c837.
    # Connection configuration namespace: zstack-powershell.
    # .LINK
    # https://github.com/terraform-zstack-modules/zstack-cli-go/blob/main/docs/powershell.md
    [CmdletBinding()]
    param(
        [Parameter(Position = 0)] [ValidateNotNullOrEmpty()] [string[]] $Name,
        [ValidateNotNullOrEmpty()] [ValidatePattern('\A[A-Za-z0-9-]{1,128}\z')] [string[]] $Id,
        [object] $Server,
        [ValidateNotNullOrEmpty()] [object[]] $L3Network
    )

    if ($PSBoundParameters.ContainsKey('L3Network')) {
        Get-CloudInventory -Type IPRange -Server $Server -Id $Id -Name $Name -ParentField l3NetworkUuid -ParentType L3Network -Parent $L3Network
    } else {
        Get-CloudInventory -Type IPRange -Server $Server -Id $Id -Name $Name
    }
}