Public/Curanet/DNS/Get-CuranetDNSRecords.ps1

function Get-CuranetDNSRecords {
    <#
        .SYNOPSIS
            Command to fetch all DNS records for a given domain.
         
        .PARAMETER DomainName
            String containing domainname
 
        .OUTPUTS
            Object containing DNS records OR error
         
        .EXAMPLE
            $domain = "example.com"
            Get-CuranetDNSRecords -Domain $domain
 
            This example fetches the DNS records for "example.com".
 
        .EXAMPLE
            Get-CuranetDNSRecords -Domain "test.com"
 
            This example fetches the DNS records for "test.com".
    #>


    param (
        [Parameter(Mandatory=$true)]
        [string]
        $DomainName
    )

    return Invoke-CuranetAPI -Uri "https://api.curanet.dk/dns/v2/Domains/$($DomainName)/Records" -Method "GET" -Account "3370"
}