Public/Resolve-PaNatPolicy.ps1

function Resolve-PaNatPolicy {
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
        [PaNatPolicy]$PaNatPolicy,

        [Parameter(Mandatory = $False, Position = 1)]
        [PaAddress[]]$Addresses = (Get-PaAddress),

        [Parameter(Mandatory = $False, Position = 2)]
        [PaAddressGroup[]]$AddressGroups = (Get-PaAddressGroup),

        [Parameter(Mandatory = $False, Position = 3)]
        [PaService[]]$Services = (Get-PaService),

        [Parameter(Mandatory = $False, Position = 4)]
        [PaServiceGroup[]]$ServiceGroups = (Get-PaServiceGroup)
    )

    Begin {
        $VerbosePrefix = "Resolve-PaNatPolicy:"
        $ReturnObject = @()
    }

    Process {
        # Addresses
        $ResolvedPolicy = $PaNatPolicy | Resolve-PaField -Addresses $Addresses -AddressGroups $AddressGroups -FieldName SourceAddress
        $ResolvedPolicy = $ResolvedPolicy | Resolve-PaField -Addresses $Addresses -AddressGroups $AddressGroups -FieldName DestinationAddress

        # Translated Addresses
        $ResolvedPolicy = $ResolvedPolicy | Resolve-PaField -Addresses $Addresses -AddressGroups $AddressGroups -FieldName SourceTranslatedAddress
        $ResolvedPolicy = $ResolvedPolicy | Resolve-PaField -Addresses $Addresses -AddressGroups $AddressGroups -FieldName TranslatedDestinationAddress

        # Service
        $ResolvedPolicy = $ResolvedPolicy | Resolve-PaField -Services $Services -ServiceGroups $ServiceGroups -FieldName Service
        $ReturnObject += $ResolvedPolicy
    }

    End {
        $ReturnObject
    }
}