Private/Add-ADCResponderPolicy.ps1

function Add-ADCResponderPolicy {
    <#
.SYNOPSIS
    Adds a Responder Policy to the Citrix ADC.
.DESCRIPTION
    Adds a Responder Policy to the Citrix ADC.
.PARAMETER Session
    The Citrix ADC Session to execute the function against.
.PARAMETER ResponderPolicyName
    The Responder Policy Name.
.PARAMETER ResponderActionName
    The Responder Action Name.
.PARAMETER ResponderPolicyRule
    The Responder Policy Rule.
.NOTES
    Creation Date: 20/06/2018
.CHANGE CONTROL
    Name Version Date Change Detail
    David Brett 1.0 04/07/2018 Function Creation
.EXAMPLE
    Add-ADCResponderPolicy -ResponderPolicyName "res_pol_http_to_https" -ResponderActionName "res_act_http_to_https" -ResponderPolicyRule "HTTP.REQ.IS_VALID" -Verbose
#>


    [CmdletBinding()]
    Param (
        $Session = $script:session,
        [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName)]
        [string[]]$ResponderPolicyName = (Read-Host -Prompt 'Enter Responder Policy Name'),
        [string[]]$ResponderActionName = (Read-Host -Prompt 'Enter Responder Action Name'),
        [string[]]$ResponderPolicyRule = (Read-Host -Prompt 'Enter Responder Policy Rule')
    )

    begin {
        $PayLoad = @{
            name   = "$ResponderPolicyName"
            action   = "$ResponderActionName"
            rule = "$ResponderPolicyRule"
        }
    }

    process {
        try {
            Invoke-ADCRestAPI -Session $Session -Method POST -Type "responderpolicy" -Payload $PayLoad -Action Add
            write-verbose "Responder Policy ($ResponderPolicyName) added to the Citrix ADC with the action ($ResponderActionName) and a rule of ($ResponderPolicyRule)"
        }
        catch {
            write-verbose "Responder Policy ($ResponderPolicyName) could not be added to the Citrix ADC with the action ($ResponderActionName) and a rule of ($ResponderPolicyRule)" 
        }
    }

    end {
    }
    
}