J81.NSToolkit.Config/Public/ns-functions-config-ssl.ps1

function Invoke-NSAddSslaction {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL action resource.
    .PARAMETER Name
        Name for the SSL action. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the action is created.
    .PARAMETER Clientauth
        Perform client certificate authentication.
        Possible values = DOCLIENTAUTH, NOCLIENTAUTH
    .PARAMETER Clientcertverification
        Client certificate verification is mandatory or optional.
          
        Possible values = Mandatory, Optional
    .PARAMETER Ssllogprofile
        The name of the ssllogprofile.
    .PARAMETER Clientcert
        Insert the entire client certificate into the HTTP header of the request being sent to the web server. The certificate is inserted in ASCII (PEM) format.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certheader
        Name of the header into which to insert the client certificate.
    .PARAMETER Clientcertserialnumber
        Insert the entire client serial number into the HTTP header of the request being sent to the web server.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certserialheader
        Name of the header into which to insert the client serial number.
    .PARAMETER Clientcertsubject
        Insert the client certificate subject, also known as the distinguished name (DN), into the HTTP header of the request being sent to the web server.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certsubjectheader
        Name of the header into which to insert the client certificate subject.
    .PARAMETER Clientcerthash
        Insert the certificate's signature into the HTTP header of the request being sent to the web server. The signature is the value extracted directly from the X.509 certificate signature field. All X.509 certificates contain a signature field.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certhashheader
        Name of the header into which to insert the client certificate signature (hash).
    .PARAMETER Clientcertfingerprint
        Insert the certificate's fingerprint into the HTTP header of the request being sent to the web server. The fingerprint is derived by computing the specified hash value (SHA256, for example) of the DER-encoding of the client certificate.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certfingerprintheader
        Name of the header into which to insert the client certificate fingerprint.
    .PARAMETER Certfingerprintdigest
        Digest algorithm used to compute the fingerprint of the client certificate.
        Possible values = SHA1, SHA224, SHA256, SHA384, SHA512
    .PARAMETER Clientcertissuer
        Insert the certificate issuer details into the HTTP header of the request being sent to the web server.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certissuerheader
        Name of the header into which to insert the client certificate issuer details.
    .PARAMETER Sessionid
        Insert the SSL session ID into the HTTP header of the request being sent to the web server. Every SSL connection that the client and the Citrix ADC share has a unique ID that identifies the specific connection.
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionidheader
        Name of the header into which to insert the Session ID.
    .PARAMETER Cipher
        Insert the cipher suite that the client and the Citrix ADC negotiated for the SSL session into the HTTP header of the request being sent to the web server. The appliance inserts the cipher-suite name, SSL protocol, export or non-export string, and cipher strength bit, depending on the type of browser connecting to the SSL virtual server or service (for example, Cipher-Suite: RC4- MD5 SSLv3 Non-Export 128-bit).
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherheader
        Name of the header into which to insert the name of the cipher suite.
    .PARAMETER Clientcertnotbefore
        Insert the date from which the certificate is valid into the HTTP header of the request being sent to the web server. Every certificate is configured with the date and time from which it is valid.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certnotbeforeheader
        Name of the header into which to insert the date and time from which the certificate is valid.
    .PARAMETER Clientcertnotafter
        Insert the date of expiry of the certificate into the HTTP header of the request being sent to the web server. Every certificate is configured with the date and time at which the certificate expires.
        Possible values = ENABLED, DISABLED
    .PARAMETER Certnotafterheader
        Name of the header into which to insert the certificate's expiry date.
    .PARAMETER Owasupport
        If the appliance is in front of an Outlook Web Access (OWA) server, insert a special header field, FRONT-END-HTTPS: ON, into the HTTP requests going to the OWA server. This header communicates to the server that the transaction is HTTPS and not HTTP.
        Possible values = ENABLED, DISABLED
    .PARAMETER Forward
        This action takes an argument a vserver name, to this vserver one will be able to forward all the packets.
    .PARAMETER Cacertgrpname
        This action will allow to pick CA(s) from the specific CA group, to verify the client certificate.
    .PARAMETER PassThru
        Return details about the created sslaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslaction -name <string>
        An example how to add sslaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslaction/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [ValidateSet('DOCLIENTAUTH', 'NOCLIENTAUTH')]
        [string]$Clientauth,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Clientcertverification = 'Mandatory',

        [ValidateLength(1, 127)]
        [string]$Ssllogprofile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcert,

        [string]$Certheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertserialnumber,

        [string]$Certserialheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertsubject,

        [string]$Certsubjectheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcerthash,

        [string]$Certhashheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertfingerprint,

        [string]$Certfingerprintheader,

        [ValidateSet('SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512')]
        [string]$Certfingerprintdigest,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertissuer,

        [string]$Certissuerheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessionid,

        [string]$Sessionidheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cipher,

        [string]$Cipherheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertnotbefore,

        [string]$Certnotbeforeheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientcertnotafter,

        [string]$Certnotafterheader,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Owasupport,

        [ValidateLength(1, 127)]
        [string]$Forward,

        [ValidateLength(1, 31)]
        [string]$Cacertgrpname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcertverification') ) { $payload.Add('clientcertverification', $clientcertverification) }
            if ( $PSBoundParameters.ContainsKey('ssllogprofile') ) { $payload.Add('ssllogprofile', $ssllogprofile) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('certheader') ) { $payload.Add('certheader', $certheader) }
            if ( $PSBoundParameters.ContainsKey('clientcertserialnumber') ) { $payload.Add('clientcertserialnumber', $clientcertserialnumber) }
            if ( $PSBoundParameters.ContainsKey('certserialheader') ) { $payload.Add('certserialheader', $certserialheader) }
            if ( $PSBoundParameters.ContainsKey('clientcertsubject') ) { $payload.Add('clientcertsubject', $clientcertsubject) }
            if ( $PSBoundParameters.ContainsKey('certsubjectheader') ) { $payload.Add('certsubjectheader', $certsubjectheader) }
            if ( $PSBoundParameters.ContainsKey('clientcerthash') ) { $payload.Add('clientcerthash', $clientcerthash) }
            if ( $PSBoundParameters.ContainsKey('certhashheader') ) { $payload.Add('certhashheader', $certhashheader) }
            if ( $PSBoundParameters.ContainsKey('clientcertfingerprint') ) { $payload.Add('clientcertfingerprint', $clientcertfingerprint) }
            if ( $PSBoundParameters.ContainsKey('certfingerprintheader') ) { $payload.Add('certfingerprintheader', $certfingerprintheader) }
            if ( $PSBoundParameters.ContainsKey('certfingerprintdigest') ) { $payload.Add('certfingerprintdigest', $certfingerprintdigest) }
            if ( $PSBoundParameters.ContainsKey('clientcertissuer') ) { $payload.Add('clientcertissuer', $clientcertissuer) }
            if ( $PSBoundParameters.ContainsKey('certissuerheader') ) { $payload.Add('certissuerheader', $certissuerheader) }
            if ( $PSBoundParameters.ContainsKey('sessionid') ) { $payload.Add('sessionid', $sessionid) }
            if ( $PSBoundParameters.ContainsKey('sessionidheader') ) { $payload.Add('sessionidheader', $sessionidheader) }
            if ( $PSBoundParameters.ContainsKey('cipher') ) { $payload.Add('cipher', $cipher) }
            if ( $PSBoundParameters.ContainsKey('cipherheader') ) { $payload.Add('cipherheader', $cipherheader) }
            if ( $PSBoundParameters.ContainsKey('clientcertnotbefore') ) { $payload.Add('clientcertnotbefore', $clientcertnotbefore) }
            if ( $PSBoundParameters.ContainsKey('certnotbeforeheader') ) { $payload.Add('certnotbeforeheader', $certnotbeforeheader) }
            if ( $PSBoundParameters.ContainsKey('clientcertnotafter') ) { $payload.Add('clientcertnotafter', $clientcertnotafter) }
            if ( $PSBoundParameters.ContainsKey('certnotafterheader') ) { $payload.Add('certnotafterheader', $certnotafterheader) }
            if ( $PSBoundParameters.ContainsKey('owasupport') ) { $payload.Add('owasupport', $owasupport) }
            if ( $PSBoundParameters.ContainsKey('forward') ) { $payload.Add('forward', $forward) }
            if ( $PSBoundParameters.ContainsKey('cacertgrpname') ) { $payload.Add('cacertgrpname', $cacertgrpname) }
            if ( $PSCmdlet.ShouldProcess("sslaction", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslaction -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslaction: Finished"
    }
}

function Invoke-NSDeleteSslaction {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL action resource.
    .PARAMETER Name
        Name for the SSL action. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslaction -Name <string>
        An example how to delete sslaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslaction/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslaction -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslaction: Finished"
    }
}

function Invoke-NSGetSslaction {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL action resource.
    .PARAMETER Name
        Name for the SSL action. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the action is created.
    .PARAMETER GetAll
        Retrieve all sslaction object(s).
    .PARAMETER Count
        If specified, the count of the sslaction object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslaction -GetAll
        Get all sslaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslaction -Count
        Get the number of sslaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslaction -name <string>
        Get sslaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslaction -Filter @{ 'name'='<value>' }
        Get sslaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslaction/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslaction -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslaction: Ended"
    }
}

function Invoke-NSAddSslcacertgroup {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Group of CA certificate-key pairs resource.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER PassThru
        Return details about the created sslcacertgroup item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcacertgroup -cacertgroupname <string>
        An example how to add sslcacertgroup config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcacertgroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Cacertgroupname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcacertgroup: Starting"
    }
    process {
        try {
            $payload = @{ cacertgroupname = $cacertgroupname }

            if ( $PSCmdlet.ShouldProcess("sslcacertgroup", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcacertgroup -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcacertgroup -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcacertgroup: Finished"
    }
}

function Invoke-NSDeleteSslcacertgroup {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Group of CA certificate-key pairs resource.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcacertgroup -Cacertgroupname <string>
        An example how to delete sslcacertgroup config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcacertgroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Cacertgroupname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcacertgroup: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$cacertgroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcacertgroup -NitroPath nitro/v1/config -Resource $cacertgroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcacertgroup: Finished"
    }
}

function Invoke-NSGetSslcacertgroup {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Group of CA certificate-key pairs resource.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcacertgroup object(s).
    .PARAMETER Count
        If specified, the count of the sslcacertgroup object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroup
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroup -GetAll
        Get all sslcacertgroup data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroup -Count
        Get the number of sslcacertgroup objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroup -name <string>
        Get sslcacertgroup object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroup -Filter @{ 'name'='<value>' }
        Get sslcacertgroup data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcacertgroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Cacertgroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcacertgroup: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcacertgroup objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcacertgroup objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcacertgroup objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcacertgroup configuration for property 'cacertgroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup -NitroPath nitro/v1/config -Resource $cacertgroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcacertgroup configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcacertgroup: Ended"
    }
}

function Invoke-NSGetSslcacertgroupBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcacertgroup.
    .PARAMETER Cacertgroupname
        Name of the CA certificate group for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslcacertgroup_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcacertgroup_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupBinding -GetAll
        Get all sslcacertgroup_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupBinding -name <string>
        Get sslcacertgroup_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupBinding -Filter @{ 'name'='<value>' }
        Get sslcacertgroup_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcacertgroupBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 31)]
        [string]$Cacertgroupname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcacertgroupBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcacertgroup_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcacertgroup_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcacertgroup_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcacertgroup_binding configuration for property 'cacertgroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_binding -NitroPath nitro/v1/config -Resource $cacertgroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcacertgroup_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcacertgroupBinding: Ended"
    }
}

function Invoke-NSAddSslcacertgroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslcacertgroup.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Certkeyname
        Name for the certkey added to the Citrix ADC. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Ocspcheck
        The state of the OCSP check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER PassThru
        Return details about the created sslcacertgroup_sslcertkey_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcacertgroupSslcertkeyBinding -cacertgroupname <string> -certkeyname <string>
        An example how to add sslcacertgroup_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcacertgroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Cacertgroupname,

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Certkeyname,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Crlcheck,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Ocspcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcacertgroupSslcertkeyBinding: Starting"
    }
    process {
        try {
            $payload = @{ cacertgroupname = $cacertgroupname
                certkeyname               = $certkeyname
            }
            if ( $PSBoundParameters.ContainsKey('crlcheck') ) { $payload.Add('crlcheck', $crlcheck) }
            if ( $PSBoundParameters.ContainsKey('ocspcheck') ) { $payload.Add('ocspcheck', $ocspcheck) }
            if ( $PSCmdlet.ShouldProcess("sslcacertgroup_sslcertkey_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcacertgroup_sslcertkey_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcacertgroupSslcertkeyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcacertgroupSslcertkeyBinding: Finished"
    }
}

function Invoke-NSDeleteSslcacertgroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslcacertgroup.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Certkeyname
        Name for the certkey added to the Citrix ADC. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcacertgroupSslcertkeyBinding -Cacertgroupname <string>
        An example how to delete sslcacertgroup_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcacertgroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Cacertgroupname,

        [string]$Certkeyname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcacertgroupSslcertkeyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Certkeyname') ) { $arguments.Add('certkeyname', $Certkeyname) }
            if ( $PSCmdlet.ShouldProcess("$cacertgroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Resource $cacertgroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcacertgroupSslcertkeyBinding: Finished"
    }
}

function Invoke-NSGetSslcacertgroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslcacertgroup.
    .PARAMETER Cacertgroupname
        Name given to the CA certificate group. The name will be used to add the CA certificates to the group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcacertgroup_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcacertgroup_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupSslcertkeyBinding -GetAll
        Get all sslcacertgroup_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupSslcertkeyBinding -Count
        Get the number of sslcacertgroup_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupSslcertkeyBinding -name <string>
        Get sslcacertgroup_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcacertgroupSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslcacertgroup_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcacertgroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcacertgroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Cacertgroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcacertgroupSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcacertgroup_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcacertgroup_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcacertgroup_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcacertgroup_sslcertkey_binding configuration for property 'cacertgroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Resource $cacertgroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcacertgroup_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcacertgroup_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcacertgroupSslcertkeyBinding: Ended"
    }
}

function Invoke-NSCreateSslcert {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for cerificate resource.
    .PARAMETER Certfile
        Name for and, optionally, path to the generated certificate file. /nsconfig/ssl/ is the default path.
    .PARAMETER Reqfile
        Name for and, optionally, path to the certificate-signing request (CSR). /nsconfig/ssl/ is the default path.
    .PARAMETER Certtype
        Type of certificate to generate. Specify one of the following:
        * ROOT_CERT - Self-signed Root-CA certificate. You must specify the key file name. The generated Root-CA certificate can be used for signing end-user client or server certificates or to create Intermediate-CA certificates.
        * INTM_CERT - Intermediate-CA certificate.
        * CLNT_CERT - End-user client certificate used for client authentication.
        * SRVR_CERT - SSL server certificate used on SSL servers for end-to-end encryption.
        Possible values = ROOT_CERT, INTM_CERT, CLNT_CERT, SRVR_CERT
    .PARAMETER Keyfile
        Name for and, optionally, path to the private key. You can either use an existing RSA or DSA key that you own or create a new private key on the Citrix ADC. This file is required only when creating a self-signed Root-CA certificate. The key file is stored in the /nsconfig/ssl directory by default.
        If the input key specified is an encrypted key, you are prompted to enter the PEM pass phrase that was used for encrypting the key.
    .PARAMETER Keyform
        Format in which the key is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Pempassphrase
        .
    .PARAMETER Days
        Number of days for which the certificate will be valid, beginning with the time and day (system time) of creation.
          
          
        Maximum value = 3650
    .PARAMETER Subjectaltname
        Subject Alternative Name (SAN) is an extension to X.509 that allows various values to be associated with a security certificate using a subjectAltName field. These values are called "Subject Alternative Names" (SAN). Names include:
        1. Email addresses
        2. IP addresses
        3. URIs
        4. DNS names (This is usually also provided as the Common Name RDN within the Subject field of the main certificate.)
        5. directory names (alternative Distinguished Names to that given in the Subject).
    .PARAMETER Certform
        Format in which the certificate is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Cacert
        Name of the CA certificate file that issues and signs the Intermediate-CA certificate or the end-user client and server certificates.
    .PARAMETER Cacertform
        Format of the CA certificate.
          
        Possible values = DER, PEM
    .PARAMETER Cakey
        Private key, associated with the CA certificate that is used to sign the Intermediate-CA certificate or the end-user client and server certificate. If the CA key file is password protected, the user is prompted to enter the pass phrase that was used to encrypt the key.
    .PARAMETER Cakeyform
        Format for the CA certificate.
          
        Possible values = DER, PEM
    .PARAMETER Caserial
        Serial number file maintained for the CA certificate. This file contains the serial number of the next certificate to be issued or signed by the CA. If the specified file does not exist, a new file is created, with /nsconfig/ssl/ as the default path. If you do not specify a proper path for the existing serial file, a new serial file is created. This might change the certificate serial numbers assigned by the CA certificate to each of the certificates it signs.
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslcert -certfile <string> -reqfile <string> -certtype <string>
        An example how to create sslcert config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslcert
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcert/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Certfile,

        [Parameter(Mandatory)]
        [string]$Reqfile,

        [Parameter(Mandatory)]
        [ValidateSet('ROOT_CERT', 'INTM_CERT', 'CLNT_CERT', 'SRVR_CERT')]
        [string]$Certtype,

        [string]$Keyfile,

        [ValidateSet('DER', 'PEM')]
        [string]$Keyform,

        [ValidateLength(1, 31)]
        [string]$Pempassphrase,

        [double]$Days,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Subjectaltname,

        [ValidateSet('DER', 'PEM')]
        [string]$Certform,

        [string]$Cacert,

        [ValidateSet('DER', 'PEM')]
        [string]$Cacertform,

        [string]$Cakey,

        [ValidateSet('DER', 'PEM')]
        [string]$Cakeyform,

        [string]$Caserial 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslcert: Starting"
    }
    process {
        try {
            $payload = @{ certfile = $certfile
                reqfile            = $reqfile
                certtype           = $certtype
            }
            if ( $PSBoundParameters.ContainsKey('keyfile') ) { $payload.Add('keyfile', $keyfile) }
            if ( $PSBoundParameters.ContainsKey('keyform') ) { $payload.Add('keyform', $keyform) }
            if ( $PSBoundParameters.ContainsKey('pempassphrase') ) { $payload.Add('pempassphrase', $pempassphrase) }
            if ( $PSBoundParameters.ContainsKey('days') ) { $payload.Add('days', $days) }
            if ( $PSBoundParameters.ContainsKey('subjectaltname') ) { $payload.Add('subjectaltname', $subjectaltname) }
            if ( $PSBoundParameters.ContainsKey('certform') ) { $payload.Add('certform', $certform) }
            if ( $PSBoundParameters.ContainsKey('cacert') ) { $payload.Add('cacert', $cacert) }
            if ( $PSBoundParameters.ContainsKey('cacertform') ) { $payload.Add('cacertform', $cacertform) }
            if ( $PSBoundParameters.ContainsKey('cakey') ) { $payload.Add('cakey', $cakey) }
            if ( $PSBoundParameters.ContainsKey('cakeyform') ) { $payload.Add('cakeyform', $cakeyform) }
            if ( $PSBoundParameters.ContainsKey('caserial') ) { $payload.Add('caserial', $caserial) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcert -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslcert: Finished"
    }
}

function Invoke-NSImportSslcertbundle {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certbundle resource.
    .PARAMETER Name
        Name to assign to the imported certificate bundle. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name, to the certificate bundle to be imported or exported. For example, http://www.example.com/cert_bundle_file.
        NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access.
    .EXAMPLE
        PS C:\>Invoke-NSImportSslcertbundle -name <string> -src <string>
        An example how to import sslcertbundle config Object(s).
    .NOTES
        File Name : Invoke-NSImportSslcertbundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertbundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src 

    )
    begin {
        Write-Verbose "Invoke-NSImportSslcertbundle: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertbundle -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSslcertbundle: Finished"
    }
}

function Invoke-NSDeleteSslcertbundle {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certbundle resource.
    .PARAMETER Name
        Name to assign to the imported certificate bundle. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcertbundle
        An example how to delete sslcertbundle config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcertbundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertbundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcertbundle: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Name') ) { $arguments.Add('name', $Name) }
            if ( $PSCmdlet.ShouldProcess("sslcertbundle", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcertbundle -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcertbundle: Finished"
    }
}

function Invoke-NSApplySslcertbundle {
    <#
    .SYNOPSIS
        Apply SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certbundle resource.
    .PARAMETER Name
        Name to assign to the imported certificate bundle. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSApplySslcertbundle -name <string>
        An example how to apply sslcertbundle config Object(s).
    .NOTES
        File Name : Invoke-NSApplySslcertbundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertbundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name 

    )
    begin {
        Write-Verbose "Invoke-NSApplySslcertbundle: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }

            if ( $PSCmdlet.ShouldProcess($Name, "Apply SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertbundle -Action apply -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSApplySslcertbundle: Finished"
    }
}

function Invoke-NSExportSslcertbundle {
    <#
    .SYNOPSIS
        Export SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certbundle resource.
    .PARAMETER Name
        Name to assign to the imported certificate bundle. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name, to the certificate bundle to be imported or exported. For example, http://www.example.com/cert_bundle_file.
        NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access.
    .EXAMPLE
        PS C:\>Invoke-NSExportSslcertbundle -name <string> -src <string>
        An example how to export sslcertbundle config Object(s).
    .NOTES
        File Name : Invoke-NSExportSslcertbundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertbundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src 

    )
    begin {
        Write-Verbose "Invoke-NSExportSslcertbundle: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Export SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertbundle -Action export -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSExportSslcertbundle: Finished"
    }
}

function Invoke-NSGetSslcertbundle {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Imported Certbundle resource.
    .PARAMETER GetAll
        Retrieve all sslcertbundle object(s).
    .PARAMETER Count
        If specified, the count of the sslcertbundle object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertbundle
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertbundle -GetAll
        Get all sslcertbundle data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertbundle -Count
        Get the number of sslcertbundle objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertbundle -name <string>
        Get sslcertbundle object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertbundle -Filter @{ 'name'='<value>' }
        Get sslcertbundle data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertbundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertbundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertbundle: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertbundle objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertbundle -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertbundle objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertbundle -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertbundle objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertbundle -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertbundle configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslcertbundle configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertbundle -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertbundle: Ended"
    }
}

function Invoke-NSGetSslcertchain {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for CERT Chain resource.
    .PARAMETER Certkeyname
        Name of the Certificate.
    .PARAMETER GetAll
        Retrieve all sslcertchain object(s).
    .PARAMETER Count
        If specified, the count of the sslcertchain object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchain
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchain -GetAll
        Get all sslcertchain data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchain -Count
        Get the number of sslcertchain objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchain -name <string>
        Get sslcertchain object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchain -Filter @{ 'name'='<value>' }
        Get sslcertchain data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertchain
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertchain/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkeyname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertchain: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertchain objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertchain objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertchain objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertchain configuration for property 'certkeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain -NitroPath nitro/v1/config -Resource $certkeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertchain configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertchain: Ended"
    }
}

function Invoke-NSGetSslcertchainBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcertchain.
    .PARAMETER Certkeyname
        Name of the Certificate.
    .PARAMETER GetAll
        Retrieve all sslcertchain_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertchain_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainBinding -GetAll
        Get all sslcertchain_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainBinding -name <string>
        Get sslcertchain_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainBinding -Filter @{ 'name'='<value>' }
        Get sslcertchain_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertchainBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertchain_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkeyname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertchainBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertchain_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertchain_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertchain_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertchain_binding configuration for property 'certkeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_binding -NitroPath nitro/v1/config -Resource $certkeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertchain_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertchainBinding: Ended"
    }
}

function Invoke-NSGetSslcertchainSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslcertchain.
    .PARAMETER Certkeyname
        Name of the Certificate.
    .PARAMETER GetAll
        Retrieve all sslcertchain_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertchain_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainSslcertkeyBinding -GetAll
        Get all sslcertchain_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainSslcertkeyBinding -Count
        Get the number of sslcertchain_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainSslcertkeyBinding -name <string>
        Get sslcertchain_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertchainSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslcertchain_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertchainSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertchain_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkeyname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertchainSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertchain_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertchain_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertchain_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertchain_sslcertkey_binding configuration for property 'certkeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_sslcertkey_binding -NitroPath nitro/v1/config -Resource $certkeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertchain_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertchain_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertchainSslcertkeyBinding: Ended"
    }
}

function Invoke-NSImportSslcertfile {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certfile resource.
    .PARAMETER Name
        Name to assign to the imported certificate file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name, to the certificate file to be imported. For example, http://www.example.com/cert_file.
        NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access.
    .EXAMPLE
        PS C:\>Invoke-NSImportSslcertfile -name <string> -src <string>
        An example how to import sslcertfile config Object(s).
    .NOTES
        File Name : Invoke-NSImportSslcertfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src 

    )
    begin {
        Write-Verbose "Invoke-NSImportSslcertfile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertfile -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSslcertfile: Finished"
    }
}

function Invoke-NSDeleteSslcertfile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported Certfile resource.
    .PARAMETER Name
        Name to assign to the imported certificate file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcertfile
        An example how to delete sslcertfile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcertfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcertfile: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Name') ) { $arguments.Add('name', $Name) }
            if ( $PSCmdlet.ShouldProcess("sslcertfile", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcertfile -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcertfile: Finished"
    }
}

function Invoke-NSGetSslcertfile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Imported Certfile resource.
    .PARAMETER GetAll
        Retrieve all sslcertfile object(s).
    .PARAMETER Count
        If specified, the count of the sslcertfile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertfile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertfile -GetAll
        Get all sslcertfile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertfile -Count
        Get the number of sslcertfile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertfile -name <string>
        Get sslcertfile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertfile -Filter @{ 'name'='<value>' }
        Get sslcertfile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertfile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertfile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertfile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertfile configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslcertfile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertfile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertfile: Ended"
    }
}

function Invoke-NSAddSslcertificatechain {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for linked certificate resource.
    .PARAMETER Certkeyname
        Name of the certificate-key pair.
    .PARAMETER PassThru
        Return details about the created sslcertificatechain item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcertificatechain -certkeyname <string>
        An example how to add sslcertificatechain config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcertificatechain
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertificatechain/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Certkeyname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcertificatechain: Starting"
    }
    process {
        try {
            $payload = @{ certkeyname = $certkeyname }

            if ( $PSCmdlet.ShouldProcess("sslcertificatechain", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertificatechain -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertificatechain -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcertificatechain: Finished"
    }
}

function Invoke-NSGetSslcertificatechain {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for linked certificate resource.
    .PARAMETER Certkeyname
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertificatechain object(s).
    .PARAMETER Count
        If specified, the count of the sslcertificatechain object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertificatechain
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertificatechain -GetAll
        Get all sslcertificatechain data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertificatechain -Count
        Get the number of sslcertificatechain objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertificatechain -name <string>
        Get sslcertificatechain object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertificatechain -Filter @{ 'name'='<value>' }
        Get sslcertificatechain data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertificatechain
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertificatechain/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [string]$Certkeyname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertificatechain: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertificatechain objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertificatechain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertificatechain objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertificatechain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertificatechain objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertificatechain -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertificatechain configuration for property 'certkeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertificatechain -NitroPath nitro/v1/config -Resource $certkeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertificatechain configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertificatechain -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertificatechain: Ended"
    }
}

function Invoke-NSAddSslcertkey {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Cert
        Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. The certificate file should be present on the appliance's hard-disk drive or solid-state drive. Storing a certificate in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/ssl/ is the default path.
    .PARAMETER Key
        Name of and, optionally, path to the private-key file that is used to form the certificate-key pair. The certificate file should be present on the appliance's hard-disk drive or solid-state drive. Storing a certificate in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/ssl/ is the default path.
    .PARAMETER Password
        Passphrase that was used to encrypt the private-key. Use this option to load encrypted private-keys in PEM format.
    .PARAMETER Fipskey
        Name of the FIPS key that was created inside the Hardware Security Module (HSM) of a FIPS appliance, or a key that was imported into the HSM.
    .PARAMETER Hsmkey
        Name of the HSM key that was created in the External Hardware Security Module (HSM) of a FIPS appliance.
    .PARAMETER Inform
        Input format of the certificate and the private-key files. The three formats supported by the appliance are:
        PEM - Privacy Enhanced Mail
        DER - Distinguished Encoding Rule
        PFX - Personal Information Exchange.
          
        Possible values = DER, PEM, PFX
    .PARAMETER Passplain
        Pass phrase used to encrypt the private-key. Required when adding an encrypted private-key in PEM format.
    .PARAMETER Expirymonitor
        Issue an alert when the certificate is about to expire.
        Possible values = ENABLED, DISABLED
    .PARAMETER Notificationperiod
        Time, in number of days, before certificate expiration, at which to generate an alert that the certificate is about to expire.
          
        Maximum value = 100
    .PARAMETER Bundle
        Parse the certificate chain as a single file after linking the server certificate to its issuer's certificate within the file.
          
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created sslcertkey item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcertkey -certkey <string> -cert <string>
        An example how to add sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Cert,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Key,

        [boolean]$Password,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Fipskey,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Hsmkey,

        [ValidateSet('DER', 'PEM', 'PFX')]
        [string]$Inform = 'PEM',

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Passplain,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Expirymonitor,

        [double]$Notificationperiod,

        [ValidateSet('YES', 'NO')]
        [string]$Bundle = 'NO',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey
                cert              = $cert
            }
            if ( $PSBoundParameters.ContainsKey('key') ) { $payload.Add('key', $key) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('fipskey') ) { $payload.Add('fipskey', $fipskey) }
            if ( $PSBoundParameters.ContainsKey('hsmkey') ) { $payload.Add('hsmkey', $hsmkey) }
            if ( $PSBoundParameters.ContainsKey('inform') ) { $payload.Add('inform', $inform) }
            if ( $PSBoundParameters.ContainsKey('passplain') ) { $payload.Add('passplain', $passplain) }
            if ( $PSBoundParameters.ContainsKey('expirymonitor') ) { $payload.Add('expirymonitor', $expirymonitor) }
            if ( $PSBoundParameters.ContainsKey('notificationperiod') ) { $payload.Add('notificationperiod', $notificationperiod) }
            if ( $PSBoundParameters.ContainsKey('bundle') ) { $payload.Add('bundle', $bundle) }
            if ( $PSCmdlet.ShouldProcess("sslcertkey", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkey -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertkey -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcertkey: Finished"
    }
}

function Invoke-NSDeleteSslcertkey {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Deletefromdevice
        Delete cert/key file from file system.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcertkey -Certkey <string>
        An example how to delete sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Certkey,

        [boolean]$Deletefromdevice 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcertkey: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Deletefromdevice') ) { $arguments.Add('deletefromdevice', $Deletefromdevice) }
            if ( $PSCmdlet.ShouldProcess("$certkey", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcertkey -NitroPath nitro/v1/config -Resource $certkey -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcertkey: Finished"
    }
}

function Invoke-NSUpdateSslcertkey {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Expirymonitor
        Issue an alert when the certificate is about to expire.
        Possible values = ENABLED, DISABLED
    .PARAMETER Notificationperiod
        Time, in number of days, before certificate expiration, at which to generate an alert that the certificate is about to expire.
          
        Maximum value = 100
    .PARAMETER PassThru
        Return details about the created sslcertkey item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslcertkey -certkey <string>
        An example how to update sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Expirymonitor,

        [double]$Notificationperiod,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey }
            if ( $PSBoundParameters.ContainsKey('expirymonitor') ) { $payload.Add('expirymonitor', $expirymonitor) }
            if ( $PSBoundParameters.ContainsKey('notificationperiod') ) { $payload.Add('notificationperiod', $notificationperiod) }
            if ( $PSCmdlet.ShouldProcess("sslcertkey", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcertkey -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertkey -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslcertkey: Finished"
    }
}

function Invoke-NSUnsetSslcertkey {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Expirymonitor
        Issue an alert when the certificate is about to expire.
        Possible values = ENABLED, DISABLED
    .PARAMETER Notificationperiod
        Time, in number of days, before certificate expiration, at which to generate an alert that the certificate is about to expire.
          
        Maximum value = 100
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslcertkey -certkey <string>
        An example how to unset sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [Boolean]$expirymonitor,

        [Boolean]$notificationperiod 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey }
            if ( $PSBoundParameters.ContainsKey('expirymonitor') ) { $payload.Add('expirymonitor', $expirymonitor) }
            if ( $PSBoundParameters.ContainsKey('notificationperiod') ) { $payload.Add('notificationperiod', $notificationperiod) }
            if ( $PSCmdlet.ShouldProcess("$certkey", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslcertkey -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslcertkey: Finished"
    }
}

function Invoke-NSLinkSslcertkey {
    <#
    .SYNOPSIS
        Link SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Linkcertkeyname
        Name of the Certificate Authority certificate-key pair to which to link a certificate-key pair.
    .EXAMPLE
        PS C:\>Invoke-NSLinkSslcertkey -certkey <string> -linkcertkeyname <string>
        An example how to link sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSLinkSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Linkcertkeyname 

    )
    begin {
        Write-Verbose "Invoke-NSLinkSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey
                linkcertkeyname   = $linkcertkeyname
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Link SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkey -Action link -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSLinkSslcertkey: Finished"
    }
}

function Invoke-NSUnlinkSslcertkey {
    <#
    .SYNOPSIS
        Unlink SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .EXAMPLE
        PS C:\>Invoke-NSUnlinkSslcertkey -certkey <string>
        An example how to unlink sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSUnlinkSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey 

    )
    begin {
        Write-Verbose "Invoke-NSUnlinkSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey }

            if ( $PSCmdlet.ShouldProcess($Name, "Unlink SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkey -Action unlink -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnlinkSslcertkey: Finished"
    }
}

function Invoke-NSChangeSslcertkey {
    <#
    .SYNOPSIS
        Change SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Cert
        Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. The certificate file should be present on the appliance's hard-disk drive or solid-state drive. Storing a certificate in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/ssl/ is the default path.
    .PARAMETER Key
        Name of and, optionally, path to the private-key file that is used to form the certificate-key pair. The certificate file should be present on the appliance's hard-disk drive or solid-state drive. Storing a certificate in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/ssl/ is the default path.
    .PARAMETER Password
        Passphrase that was used to encrypt the private-key. Use this option to load encrypted private-keys in PEM format.
    .PARAMETER Fipskey
        Name of the FIPS key that was created inside the Hardware Security Module (HSM) of a FIPS appliance, or a key that was imported into the HSM.
    .PARAMETER Inform
        Input format of the certificate and the private-key files. The three formats supported by the appliance are:
        PEM - Privacy Enhanced Mail
        DER - Distinguished Encoding Rule
        PFX - Personal Information Exchange.
          
        Possible values = DER, PEM, PFX
    .PARAMETER Passplain
        Pass phrase used to encrypt the private-key. Required when adding an encrypted private-key in PEM format.
    .PARAMETER Nodomaincheck
        Override the check for matching domain names during a certificate update operation.
    .PARAMETER PassThru
        Return details about the created sslcertkey item.
    .EXAMPLE
        PS C:\>Invoke-NSChangeSslcertkey -certkey <string>
        An example how to change sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSChangeSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Cert,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Key,

        [boolean]$Password,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Fipskey,

        [ValidateSet('DER', 'PEM', 'PFX')]
        [string]$Inform,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Passplain,

        [boolean]$Nodomaincheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSChangeSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey }
            if ( $PSBoundParameters.ContainsKey('cert') ) { $payload.Add('cert', $cert) }
            if ( $PSBoundParameters.ContainsKey('key') ) { $payload.Add('key', $key) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('fipskey') ) { $payload.Add('fipskey', $fipskey) }
            if ( $PSBoundParameters.ContainsKey('inform') ) { $payload.Add('inform', $inform) }
            if ( $PSBoundParameters.ContainsKey('passplain') ) { $payload.Add('passplain', $passplain) }
            if ( $PSBoundParameters.ContainsKey('nodomaincheck') ) { $payload.Add('nodomaincheck', $nodomaincheck) }
            if ( $PSCmdlet.ShouldProcess("sslcertkey", "Change SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkey -Action update -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertkey -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSChangeSslcertkey: Finished"
    }
}

function Invoke-NSClearSslcertkey {
    <#
    .SYNOPSIS
        Clear SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER Ocspstaplingcache
        Clear cached ocspStapling response in certkey.
    .EXAMPLE
        PS C:\>Invoke-NSClearSslcertkey -certkey <string>
        An example how to clear sslcertkey config Object(s).
    .NOTES
        File Name : Invoke-NSClearSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [boolean]$Ocspstaplingcache 

    )
    begin {
        Write-Verbose "Invoke-NSClearSslcertkey: Starting"
    }
    process {
        try {
            $payload = @{ certkey = $certkey }
            if ( $PSBoundParameters.ContainsKey('ocspstaplingcache') ) { $payload.Add('ocspstaplingcache', $ocspstaplingcache) }
            if ( $PSCmdlet.ShouldProcess($Name, "Clear SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkey -Action clear -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSClearSslcertkey: Finished"
    }
}

function Invoke-NSGetSslcertkey {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for certificate key resource.
    .PARAMETER Certkey
        Name for the certificate and private-key pair. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is created.
    .PARAMETER GetAll
        Retrieve all sslcertkey object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkey
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkey -GetAll
        Get all sslcertkey data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkey -Count
        Get the number of sslcertkey objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkey -name <string>
        Get sslcertkey object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkey -Filter @{ 'name'='<value>' }
        Get sslcertkey data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkey: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkey: Ended"
    }
}

function Invoke-NSGetSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyBinding -GetAll
        Get all sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyBinding -name <string>
        Get sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeyBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeyCrldistributionBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the crldistribution that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertkey_crldistribution_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_crldistribution_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyCrldistributionBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyCrldistributionBinding -GetAll
        Get all sslcertkey_crldistribution_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyCrldistributionBinding -Count
        Get the number of sslcertkey_crldistribution_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyCrldistributionBinding -name <string>
        Get sslcertkey_crldistribution_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyCrldistributionBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_crldistribution_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeyCrldistributionBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_crldistribution_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeyCrldistributionBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_crldistribution_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_crldistribution_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_crldistribution_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_crldistribution_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_crldistribution_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_crldistribution_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_crldistribution_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_crldistribution_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_crldistribution_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_crldistribution_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeyCrldistributionBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeyServiceBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the service that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertkey_service_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_service_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyServiceBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyServiceBinding -GetAll
        Get all sslcertkey_service_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyServiceBinding -Count
        Get the number of sslcertkey_service_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyServiceBinding -name <string>
        Get sslcertkey_service_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeyServiceBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_service_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeyServiceBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_service_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeyServiceBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_service_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_service_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_service_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_service_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_service_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_service_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_service_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_service_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_service_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_service_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeyServiceBinding: Ended"
    }
}

function Invoke-NSAddSslcertkeySslocspresponderBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslocspresponder that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER Ocspresponder
        OCSP responders bound to this certkey.
    .PARAMETER Priority
        ocsp priority.
    .PARAMETER PassThru
        Return details about the created sslcertkey_sslocspresponder_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcertkeySslocspresponderBinding
        An example how to add sslcertkey_sslocspresponder_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcertkeySslocspresponderBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_sslocspresponder_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [string]$Ocspresponder,

        [double]$Priority,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcertkeySslocspresponderBinding: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('certkey') ) { $payload.Add('certkey', $certkey) }
            if ( $PSBoundParameters.ContainsKey('ocspresponder') ) { $payload.Add('ocspresponder', $ocspresponder) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSCmdlet.ShouldProcess("sslcertkey_sslocspresponder_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcertkey_sslocspresponder_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertkeySslocspresponderBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcertkeySslocspresponderBinding: Finished"
    }
}

function Invoke-NSDeleteSslcertkeySslocspresponderBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslocspresponder that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER Ocspresponder
        OCSP responders bound to this certkey.
    .PARAMETER Ca
        The certificate-key pair being unbound is a Certificate Authority (CA) certificate. If you choose this option, the certificate-key pair is unbound from the list of CA certificates that were bound to the specified SSL virtual server or SSL service.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcertkeySslocspresponderBinding -Certkey <string>
        An example how to delete sslcertkey_sslocspresponder_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcertkeySslocspresponderBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_sslocspresponder_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Certkey,

        [string]$Ocspresponder,

        [boolean]$Ca 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcertkeySslocspresponderBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ocspresponder') ) { $arguments.Add('ocspresponder', $Ocspresponder) }
            if ( $PSBoundParameters.ContainsKey('Ca') ) { $arguments.Add('ca', $Ca) }
            if ( $PSCmdlet.ShouldProcess("$certkey", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Resource $certkey -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcertkeySslocspresponderBinding: Finished"
    }
}

function Invoke-NSGetSslcertkeySslocspresponderBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslocspresponder that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertkey_sslocspresponder_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_sslocspresponder_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslocspresponderBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslocspresponderBinding -GetAll
        Get all sslcertkey_sslocspresponder_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslocspresponderBinding -Count
        Get the number of sslcertkey_sslocspresponder_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslocspresponderBinding -name <string>
        Get sslcertkey_sslocspresponder_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslocspresponderBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_sslocspresponder_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeySslocspresponderBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_sslocspresponder_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeySslocspresponderBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_sslocspresponder_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_sslocspresponder_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_sslocspresponder_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_sslocspresponder_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_sslocspresponder_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslocspresponder_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeySslocspresponderBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeySslprofileBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslprofile that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertkey_sslprofile_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_sslprofile_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslprofileBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslprofileBinding -GetAll
        Get all sslcertkey_sslprofile_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslprofileBinding -Count
        Get the number of sslcertkey_sslprofile_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslprofileBinding -name <string>
        Get sslcertkey_sslprofile_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslprofileBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_sslprofile_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeySslprofileBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_sslprofile_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeySslprofileBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_sslprofile_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslprofile_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_sslprofile_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslprofile_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_sslprofile_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslprofile_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeySslprofileBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeySslvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslvserver that can be bound to sslcertkey.
    .PARAMETER Certkey
        Name of the certificate-key pair.
    .PARAMETER GetAll
        Retrieve all sslcertkey_sslvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkey_sslvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslvserverBinding -GetAll
        Get all sslcertkey_sslvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslvserverBinding -Count
        Get the number of sslcertkey_sslvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslvserverBinding -name <string>
        Get sslcertkey_sslvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeySslvserverBinding -Filter @{ 'name'='<value>' }
        Get sslcertkey_sslvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeySslvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkey_sslvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certkey,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeySslvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkey_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkey_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkey_sslvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkey_sslvserver_binding configuration for property 'certkey'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslvserver_binding -NitroPath nitro/v1/config -Resource $certkey -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkey_sslvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkey_sslvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeySslvserverBinding: Ended"
    }
}

function Invoke-NSAddSslcertkeybundle {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certkey bundle resource.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Bundlefile
        Name of and, optionally, path to the X509 certificate bundle file that is used to form the certificate-key bundle. The certificate bundle file should be present on the appliance's hard-disk drive or solid-state drive. /nsconfig/ssl/ is the default path. The certificate bundle file consists of list of certificates and one key in PEM format.
    .PARAMETER Passplain
        Pass phrase used to encrypt the private-key. Required when certificate bundle file contains encrypted private-key in PEM format.
    .PARAMETER PassThru
        Return details about the created sslcertkeybundle item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcertkeybundle -certkeybundlename <string> -bundlefile <string>
        An example how to add sslcertkeybundle config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcertkeybundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Certkeybundlename,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Bundlefile,

        [string]$Passplain,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcertkeybundle: Starting"
    }
    process {
        try {
            $payload = @{ certkeybundlename = $certkeybundlename
                bundlefile                  = $bundlefile
            }
            if ( $PSBoundParameters.ContainsKey('passplain') ) { $payload.Add('passplain', $passplain) }
            if ( $PSCmdlet.ShouldProcess("sslcertkeybundle", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertkeybundle -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcertkeybundle -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcertkeybundle: Finished"
    }
}

function Invoke-NSDeleteSslcertkeybundle {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certkey bundle resource.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcertkeybundle -Certkeybundlename <string>
        An example how to delete sslcertkeybundle config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcertkeybundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Certkeybundlename 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcertkeybundle: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$certkeybundlename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcertkeybundle -NitroPath nitro/v1/config -Resource $certkeybundlename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcertkeybundle: Finished"
    }
}

function Invoke-NSGetSslcertkeybundle {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for certkey bundle resource.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcertkeybundle object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkeybundle object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundle
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundle -GetAll
        Get all sslcertkeybundle data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundle -Count
        Get the number of sslcertkeybundle objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundle -name <string>
        Get sslcertkeybundle object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundle -Filter @{ 'name'='<value>' }
        Get sslcertkeybundle data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeybundle
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Certkeybundlename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeybundle: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertkeybundle objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkeybundle objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkeybundle objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkeybundle configuration for property 'certkeybundlename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle -NitroPath nitro/v1/config -Resource $certkeybundlename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkeybundle configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeybundle: Ended"
    }
}

function Invoke-NSGetSslcertkeybundleBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcertkeybundle.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcertkeybundle_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkeybundle_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleBinding -GetAll
        Get all sslcertkeybundle_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleBinding -name <string>
        Get sslcertkeybundle_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleBinding -Filter @{ 'name'='<value>' }
        Get sslcertkeybundle_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeybundleBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Certkeybundlename,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeybundleBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkeybundle_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkeybundle_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkeybundle_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkeybundle_binding configuration for property 'certkeybundlename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_binding -NitroPath nitro/v1/config -Resource $certkeybundlename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkeybundle_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeybundleBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the intermediatecertlinks that can be bound to sslcertkeybundle.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcertkeybundle_intermediatecertlinks_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkeybundle_intermediatecertlinks_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding -GetAll
        Get all sslcertkeybundle_intermediatecertlinks_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding -Count
        Get the number of sslcertkeybundle_intermediatecertlinks_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding -name <string>
        Get sslcertkeybundle_intermediatecertlinks_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding -Filter @{ 'name'='<value>' }
        Get sslcertkeybundle_intermediatecertlinks_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle_intermediatecertlinks_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Certkeybundlename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkeybundle_intermediatecertlinks_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_intermediatecertlinks_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkeybundle_intermediatecertlinks_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_intermediatecertlinks_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkeybundle_intermediatecertlinks_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_intermediatecertlinks_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkeybundle_intermediatecertlinks_binding configuration for property 'certkeybundlename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_intermediatecertlinks_binding -NitroPath nitro/v1/config -Resource $certkeybundlename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkeybundle_intermediatecertlinks_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_intermediatecertlinks_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeybundleIntermediatecertlinksBinding: Ended"
    }
}

function Invoke-NSGetSslcertkeybundleSslvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslvserver that can be bound to sslcertkeybundle.
    .PARAMETER Certkeybundlename
        Name given to the cerKeyBundle. The name will be used to bind/unbind certkey bundle to vip. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER GetAll
        Retrieve all sslcertkeybundle_sslvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcertkeybundle_sslvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleSslvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleSslvserverBinding -GetAll
        Get all sslcertkeybundle_sslvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleSslvserverBinding -Count
        Get the number of sslcertkeybundle_sslvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleSslvserverBinding -name <string>
        Get sslcertkeybundle_sslvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertkeybundleSslvserverBinding -Filter @{ 'name'='<value>' }
        Get sslcertkeybundle_sslvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertkeybundleSslvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertkeybundle_sslvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Certkeybundlename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertkeybundleSslvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcertkeybundle_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertkeybundle_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertkeybundle_sslvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_sslvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertkeybundle_sslvserver_binding configuration for property 'certkeybundlename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_sslvserver_binding -NitroPath nitro/v1/config -Resource $certkeybundlename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcertkeybundle_sslvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertkeybundle_sslvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertkeybundleSslvserverBinding: Ended"
    }
}

function Invoke-NSGetSslcertlink {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for linked certificate resource.
    .PARAMETER GetAll
        Retrieve all sslcertlink object(s).
    .PARAMETER Count
        If specified, the count of the sslcertlink object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertlink
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertlink -GetAll
        Get all sslcertlink data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertlink -Count
        Get the number of sslcertlink objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertlink -name <string>
        Get sslcertlink object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcertlink -Filter @{ 'name'='<value>' }
        Get sslcertlink data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcertlink
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertlink/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcertlink: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcertlink objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertlink -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcertlink objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertlink -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcertlink objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertlink -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcertlink configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslcertlink configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcertlink -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcertlink: Ended"
    }
}

function Invoke-NSCreateSslcertreq {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for certificate request resource.
    .PARAMETER Reqfile
        Name for and, optionally, path to the certificate signing request (CSR). /nsconfig/ssl/ is the default path.
    .PARAMETER Keyfile
        Name of and, optionally, path to the private key used to create the certificate signing request, which then becomes part of the certificate-key pair. The private key can be either an RSA or a DSA key. The key must be present in the appliance's local storage. /nsconfig/ssl is the default path.
    .PARAMETER Subjectaltname
        Subject Alternative Name (SAN) is an extension to X.509 that allows various values to be associated with a security certificate using a subjectAltName field. These values are called "Subject Alternative Names" (SAN). Names include:
        1. Email addresses
        2. IP addresses
        3. URIs
        4. DNS names (this is usually also provided as the Common Name RDN within the Subject field of the main certificate.)
        5. Directory names (alternative Distinguished Names to that given in the Subject).
    .PARAMETER Fipskeyname
        Name of the FIPS key used to create the certificate signing request. FIPS keys are created inside the Hardware Security Module of the FIPS card.
    .PARAMETER Keyform
        Format in which the key is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Pempassphrase
        .
    .PARAMETER Countryname
        Two letter ISO code for your country. For example, US for United States.
    .PARAMETER Statename
        Full name of the state or province where your organization is located.
        Do not abbreviate.
    .PARAMETER Organizationname
        Name of the organization that will use this certificate. The organization name (corporation, limited partnership, university, or government agency) must be registered with some authority at the national, state, or city level. Use the legal name under which the organization is registered.
        Do not abbreviate the organization name and do not use the following characters in the name:
        Angle brackets (&lt; &gt;) tilde (~), exclamation mark, at (@), pound (#), zero (0), caret (^), asterisk (*), forward slash (/), square brackets ([ ]), question mark (?).
    .PARAMETER Organizationunitname
        Name of the division or section in the organization that will use the certificate.
    .PARAMETER Localityname
        Name of the city or town in which your organization's head office is located.
    .PARAMETER Commonname
        Fully qualified domain name for the company or web site. The common name must match the name used by DNS servers to do a DNS lookup of your server. Most browsers use this information for authenticating the server's certificate during the SSL handshake. If the server name in the URL does not match the common name as given in the server certificate, the browser terminates the SSL handshake or prompts the user with a warning message.
        Do not use wildcard characters, such as asterisk (*) or question mark (?), and do not use an IP address as the common name. The common name must not contain the protocol specifier &lt;http://&gt; or &lt;https://&gt;.
    .PARAMETER Emailaddress
        Contact person's e-mail address. This address is publically displayed as part of the certificate. Provide an e-mail address that is monitored by an administrator who can be contacted about the certificate.
    .PARAMETER Challengepassword
        Pass phrase, embedded in the certificate signing request that is shared only between the client or server requesting the certificate and the SSL certificate issuer (typically the certificate authority). This pass phrase can be used to authenticate a client or server that is requesting a certificate from the certificate authority.
    .PARAMETER Companyname
        Additional name for the company or web site.
    .PARAMETER Digestmethod
        Digest algorithm used in creating CSR.
        Possible values = SHA1, SHA256
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslcertreq -reqfile <string> -countryname <string> -statename <string> -organizationname <string>
        An example how to create sslcertreq config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslcertreq
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcertreq/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Reqfile,

        [string]$Keyfile,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Subjectaltname,

        [ValidateLength(1, 31)]
        [string]$Fipskeyname,

        [ValidateSet('DER', 'PEM')]
        [string]$Keyform,

        [ValidateLength(1, 31)]
        [string]$Pempassphrase,

        [Parameter(Mandatory)]
        [ValidateLength(2, 2)]
        [string]$Countryname,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Statename,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Organizationname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Organizationunitname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Localityname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Commonname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Emailaddress,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Challengepassword,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Companyname,

        [ValidateSet('SHA1', 'SHA256')]
        [string]$Digestmethod 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslcertreq: Starting"
    }
    process {
        try {
            $payload = @{ reqfile = $reqfile
                countryname       = $countryname
                statename         = $statename
                organizationname  = $organizationname
            }
            if ( $PSBoundParameters.ContainsKey('keyfile') ) { $payload.Add('keyfile', $keyfile) }
            if ( $PSBoundParameters.ContainsKey('subjectaltname') ) { $payload.Add('subjectaltname', $subjectaltname) }
            if ( $PSBoundParameters.ContainsKey('fipskeyname') ) { $payload.Add('fipskeyname', $fipskeyname) }
            if ( $PSBoundParameters.ContainsKey('keyform') ) { $payload.Add('keyform', $keyform) }
            if ( $PSBoundParameters.ContainsKey('pempassphrase') ) { $payload.Add('pempassphrase', $pempassphrase) }
            if ( $PSBoundParameters.ContainsKey('organizationunitname') ) { $payload.Add('organizationunitname', $organizationunitname) }
            if ( $PSBoundParameters.ContainsKey('localityname') ) { $payload.Add('localityname', $localityname) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('emailaddress') ) { $payload.Add('emailaddress', $emailaddress) }
            if ( $PSBoundParameters.ContainsKey('challengepassword') ) { $payload.Add('challengepassword', $challengepassword) }
            if ( $PSBoundParameters.ContainsKey('companyname') ) { $payload.Add('companyname', $companyname) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcertreq -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslcertreq: Finished"
    }
}

function Invoke-NSAddSslcipher {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for cipher resource.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Ciphgrpalias
        The individual cipher name(s), a user-defined cipher group, or a system predefined cipher alias that will be added to the predefined cipher alias that will be added to the group cipherGroupName.
        If a cipher alias or a cipher group is specified, all the individual ciphers in the cipher alias or group will be added to the user-defined cipher group.
    .PARAMETER PassThru
        Return details about the created sslcipher item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcipher -ciphergroupname <string>
        An example how to add sslcipher config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcipher
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Ciphergroupname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphgrpalias,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcipher: Starting"
    }
    process {
        try {
            $payload = @{ ciphergroupname = $ciphergroupname }
            if ( $PSBoundParameters.ContainsKey('ciphgrpalias') ) { $payload.Add('ciphgrpalias', $ciphgrpalias) }
            if ( $PSCmdlet.ShouldProcess("sslcipher", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcipher -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcipher -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcipher: Finished"
    }
}

function Invoke-NSUpdateSslcipher {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for cipher resource.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Ciphername
        Cipher name.
    .PARAMETER Cipherpriority
        This indicates priority assigned to the particular cipher.
    .PARAMETER PassThru
        Return details about the created sslcipher item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslcipher -ciphergroupname <string>
        An example how to update sslcipher config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslcipher
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Ciphergroupname,

        [string]$Ciphername,

        [double]$Cipherpriority,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslcipher: Starting"
    }
    process {
        try {
            $payload = @{ ciphergroupname = $ciphergroupname }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSCmdlet.ShouldProcess("sslcipher", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcipher -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcipher -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslcipher: Finished"
    }
}

function Invoke-NSUnsetSslcipher {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for cipher resource.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Ciphername
        Cipher name.
    .PARAMETER Cipherpriority
        This indicates priority assigned to the particular cipher.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslcipher -ciphergroupname <string>
        An example how to unset sslcipher config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslcipher
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Ciphergroupname,

        [Boolean]$ciphername,

        [Boolean]$cipherpriority 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslcipher: Starting"
    }
    process {
        try {
            $payload = @{ ciphergroupname = $ciphergroupname }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSCmdlet.ShouldProcess("$ciphergroupname", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslcipher -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslcipher: Finished"
    }
}

function Invoke-NSDeleteSslcipher {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for cipher resource.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Ciphername
        Cipher name.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcipher -Ciphergroupname <string>
        An example how to delete sslcipher config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcipher
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Ciphergroupname,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcipher: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$ciphergroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcipher -NitroPath nitro/v1/config -Resource $ciphergroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcipher: Finished"
    }
}

function Invoke-NSGetSslcipher {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for cipher resource.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER GetAll
        Retrieve all sslcipher object(s).
    .PARAMETER Count
        If specified, the count of the sslcipher object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipher
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipher -GetAll
        Get all sslcipher data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipher -Count
        Get the number of sslcipher objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipher -name <string>
        Get sslcipher object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipher -Filter @{ 'name'='<value>' }
        Get sslcipher data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcipher
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Ciphergroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcipher: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcipher objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcipher objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcipher objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcipher configuration for property 'ciphergroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher -NitroPath nitro/v1/config -Resource $ciphergroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcipher configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcipher: Ended"
    }
}

function Invoke-NSGetSslcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcipher.
    .PARAMETER Ciphergroupname
        Name of the cipher group for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherBinding -GetAll
        Get all sslcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherBinding -name <string>
        Get sslcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherBinding -Filter @{ 'name'='<value>' }
        Get sslcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphergroupname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcipher_binding configuration for property 'ciphergroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_binding -NitroPath nitro/v1/config -Resource $ciphergroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcipherBinding: Ended"
    }
}

function Invoke-NSGetSslcipherIndividualcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the individualcipher that can be bound to sslcipher.
    .PARAMETER Ciphergroupname
        Name of the user-defined cipher group.
    .PARAMETER GetAll
        Retrieve all sslcipher_individualcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcipher_individualcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherIndividualcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherIndividualcipherBinding -GetAll
        Get all sslcipher_individualcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherIndividualcipherBinding -Count
        Get the number of sslcipher_individualcipher_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherIndividualcipherBinding -name <string>
        Get sslcipher_individualcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherIndividualcipherBinding -Filter @{ 'name'='<value>' }
        Get sslcipher_individualcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcipherIndividualcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_individualcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphergroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcipherIndividualcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcipher_individualcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_individualcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcipher_individualcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_individualcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcipher_individualcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_individualcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcipher_individualcipher_binding configuration for property 'ciphergroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_individualcipher_binding -NitroPath nitro/v1/config -Resource $ciphergroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcipher_individualcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_individualcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcipherIndividualcipherBinding: Ended"
    }
}

function Invoke-NSAddSslcipherSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslcipher.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Cipheroperation
        The operation that is performed when adding the cipher-suite. Possible cipher operations are: ADD - Appends the given cipher-suite to the existing one configured for the virtual server. REM - Removes the given cipher-suite from the existing one configured for the virtual server. ORD - Overrides the current configured cipher-suite for the virtual server with the given cipher-suite.
          
        Possible values = ADD, REM, ORD
    .PARAMETER Ciphgrpals
        A cipher-suite can consist of an individual cipher name, the system predefined cipher-alias name, or user defined cipher-group name.
    .PARAMETER Ciphername
        Cipher name.
    .PARAMETER Cipherpriority
        This indicates priority assigned to the particular cipher.
    .PARAMETER PassThru
        Return details about the created sslcipher_sslciphersuite_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcipherSslciphersuiteBinding
        An example how to add sslcipher_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcipherSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Ciphergroupname,

        [ValidateSet('ADD', 'REM', 'ORD')]
        [string]$Cipheroperation = '0',

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphgrpals,

        [string]$Ciphername,

        [double]$Cipherpriority,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcipherSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('ciphergroupname') ) { $payload.Add('ciphergroupname', $ciphergroupname) }
            if ( $PSBoundParameters.ContainsKey('cipheroperation') ) { $payload.Add('cipheroperation', $cipheroperation) }
            if ( $PSBoundParameters.ContainsKey('ciphgrpals') ) { $payload.Add('ciphgrpals', $ciphgrpals) }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSCmdlet.ShouldProcess("sslcipher_sslciphersuite_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcipher_sslciphersuite_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcipherSslciphersuiteBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcipherSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSDeleteSslcipherSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslcipher.
    .PARAMETER Ciphergroupname
        Name for the user-defined cipher group. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the cipher group is created.
    .PARAMETER Ciphername
        Cipher name.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcipherSslciphersuiteBinding
        An example how to delete sslcipher_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcipherSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Ciphergroupname,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcipherSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphergroupname') ) { $arguments.Add('ciphergroupname', $Ciphergroupname) }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslcipher_sslciphersuite_binding", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcipher_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcipherSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSGetSslcipherSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslcipher.
    .PARAMETER GetAll
        Retrieve all sslcipher_sslciphersuite_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcipher_sslciphersuite_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslciphersuiteBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslciphersuiteBinding -GetAll
        Get all sslcipher_sslciphersuite_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslciphersuiteBinding -Count
        Get the number of sslcipher_sslciphersuite_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslciphersuiteBinding -name <string>
        Get sslcipher_sslciphersuite_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslciphersuiteBinding -Filter @{ 'name'='<value>' }
        Get sslcipher_sslciphersuite_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcipherSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcipherSslciphersuiteBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcipher_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcipher_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcipher_sslciphersuite_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslciphersuite_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcipher_sslciphersuite_binding configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslcipher_sslciphersuite_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslciphersuite_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcipherSslciphersuiteBinding: Ended"
    }
}

function Invoke-NSGetSslcipherSslprofileBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslprofile that can be bound to sslcipher.
    .PARAMETER Ciphergroupname
        Name of the user-defined cipher group.
    .PARAMETER GetAll
        Retrieve all sslcipher_sslprofile_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcipher_sslprofile_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslprofileBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslprofileBinding -GetAll
        Get all sslcipher_sslprofile_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslprofileBinding -Count
        Get the number of sslcipher_sslprofile_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslprofileBinding -name <string>
        Get sslcipher_sslprofile_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcipherSslprofileBinding -Filter @{ 'name'='<value>' }
        Get sslcipher_sslprofile_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcipherSslprofileBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcipher_sslprofile_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphergroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcipherSslprofileBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcipher_sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcipher_sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcipher_sslprofile_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslprofile_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcipher_sslprofile_binding configuration for property 'ciphergroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslprofile_binding -NitroPath nitro/v1/config -Resource $ciphergroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcipher_sslprofile_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcipher_sslprofile_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcipherSslprofileBinding: Ended"
    }
}

function Invoke-NSGetSslciphersuite {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for ciphersuite resource.
    .PARAMETER Ciphername
        Name of the cipher suite for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslciphersuite object(s).
    .PARAMETER Count
        If specified, the count of the sslciphersuite object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslciphersuite
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslciphersuite -GetAll
        Get all sslciphersuite data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslciphersuite -Count
        Get the number of sslciphersuite objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslciphersuite -name <string>
        Get sslciphersuite object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslciphersuite -Filter @{ 'name'='<value>' }
        Get sslciphersuite data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslciphersuite
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslciphersuite/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [string]$Ciphername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslciphersuite: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslciphersuite objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslciphersuite -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslciphersuite objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslciphersuite -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslciphersuite objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslciphersuite -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslciphersuite configuration for property 'ciphername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslciphersuite -NitroPath nitro/v1/config -Resource $ciphername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslciphersuite configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslciphersuite -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslciphersuite: Ended"
    }
}

function Invoke-NSAddSslcrl {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Crlname
        Name for the Certificate Revocation List (CRL). Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the CRL is created.
    .PARAMETER Crlpath
        Path to the CRL file. /var/netscaler/ssl/ is the default path.
    .PARAMETER Inform
        Input format of the CRL file. The two formats supported on the appliance are:
        PEM - Privacy Enhanced Mail.
        DER - Distinguished Encoding Rule.
          
        Possible values = DER, PEM
    .PARAMETER Refresh
        Set CRL auto refresh.
        Possible values = ENABLED, DISABLED
    .PARAMETER Cacert
        CA certificate that has issued the CRL. Required if CRL Auto Refresh is selected. Install the CA certificate on the appliance before adding the CRL.
    .PARAMETER Method
        Method for CRL refresh. If LDAP is selected, specify the method, CA certificate, base DN, port, and LDAP server name. If HTTP is selected, specify the CA certificate, method, URL, and port. Cannot be changed after a CRL is added.
        Possible values = HTTP, LDAP
    .PARAMETER Server
        IP address of the LDAP server from which to fetch the CRLs.
    .PARAMETER Url
        URL of the CRL distribution point.
    .PARAMETER Port
        Port for the LDAP server.
    .PARAMETER Basedn
        Base distinguished name (DN), which is used in an LDAP search to search for a CRL. Citrix recommends searching for the Base DN instead of the Issuer Name from the CA certificate, because the Issuer Name field might not exactly match the LDAP directory structure's DN.
    .PARAMETER Scope
        Extent of the search operation on the LDAP server. Available settings function as follows:
        One - One level below Base DN.
        Base - Exactly the same level as Base DN.
          
        Possible values = Base, One
    .PARAMETER Interval
        CRL refresh interval. Use the NONE setting to unset this parameter.
        Possible values = MONTHLY, WEEKLY, DAILY, NOW, NONE
    .PARAMETER Day
        Day on which to refresh the CRL, or, if the Interval parameter is not set, the number of days after which to refresh the CRL. If Interval is set to MONTHLY, specify the date. If Interval is set to WEEKLY, specify the day of the week (for example, Sun=0 and Sat=6). This parameter is not applicable if the Interval is set to DAILY.
          
        Maximum value = 31
    .PARAMETER Time
        Time, in hours (1-24) and minutes (1-60), at which to refresh the CRL.
    .PARAMETER Binddn
        Bind distinguished name (DN) to be used to access the CRL object in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Password
        Password to access the CRL in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Binary
        Set the LDAP-based CRL retrieval mode to binary.
          
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created sslcrl item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslcrl -crlname <string> -crlpath <string>
        An example how to add sslcrl config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Crlname,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Crlpath,

        [ValidateSet('DER', 'PEM')]
        [string]$Inform = 'PEM',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Refresh,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Cacert,

        [ValidateSet('HTTP', 'LDAP')]
        [string]$Method,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Server,

        [string]$Url,

        [int]$Port,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Basedn,

        [ValidateSet('Base', 'One')]
        [string]$Scope = 'One',

        [ValidateSet('MONTHLY', 'WEEKLY', 'DAILY', 'NOW', 'NONE')]
        [string]$Interval,

        [double]$Day,

        [string]$Time,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Binddn,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Password,

        [ValidateSet('YES', 'NO')]
        [string]$Binary = 'NO',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslcrl: Starting"
    }
    process {
        try {
            $payload = @{ crlname = $crlname
                crlpath           = $crlpath
            }
            if ( $PSBoundParameters.ContainsKey('inform') ) { $payload.Add('inform', $inform) }
            if ( $PSBoundParameters.ContainsKey('refresh') ) { $payload.Add('refresh', $refresh) }
            if ( $PSBoundParameters.ContainsKey('cacert') ) { $payload.Add('cacert', $cacert) }
            if ( $PSBoundParameters.ContainsKey('method') ) { $payload.Add('method', $method) }
            if ( $PSBoundParameters.ContainsKey('server') ) { $payload.Add('server', $server) }
            if ( $PSBoundParameters.ContainsKey('url') ) { $payload.Add('url', $url) }
            if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) }
            if ( $PSBoundParameters.ContainsKey('basedn') ) { $payload.Add('basedn', $basedn) }
            if ( $PSBoundParameters.ContainsKey('scope') ) { $payload.Add('scope', $scope) }
            if ( $PSBoundParameters.ContainsKey('interval') ) { $payload.Add('interval', $interval) }
            if ( $PSBoundParameters.ContainsKey('day') ) { $payload.Add('day', $day) }
            if ( $PSBoundParameters.ContainsKey('time') ) { $payload.Add('time', $time) }
            if ( $PSBoundParameters.ContainsKey('binddn') ) { $payload.Add('binddn', $binddn) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('binary') ) { $payload.Add('binary', $binary) }
            if ( $PSCmdlet.ShouldProcess("sslcrl", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcrl -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcrl -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslcrl: Finished"
    }
}

function Invoke-NSCreateSslcrl {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Cacertfile
        Name of and, optionally, path to the CA certificate file.
        /nsconfig/ssl/ is the default path.
    .PARAMETER Cakeyfile
        Name of and, optionally, path to the CA key file. /nsconfig/ssl/ is the default path.
    .PARAMETER Indexfile
        Name of and, optionally, path to the file containing the serial numbers of all the certificates that are revoked. Revoked certificates are appended to the file. /nsconfig/ssl/ is the default path.
    .PARAMETER Revoke
        Name of and, optionally, path to the certificate to be revoked. /nsconfig/ssl/ is the default path.
    .PARAMETER Gencrl
        Name of and, optionally, path to the CRL file to be generated. The list of certificates that have been revoked is obtained from the index file. /nsconfig/ssl/ is the default path.
    .PARAMETER Password
        Password to access the CRL in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslcrl -cacertfile <string> -cakeyfile <string> -indexfile <string>
        An example how to create sslcrl config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Cacertfile,

        [Parameter(Mandatory)]
        [string]$Cakeyfile,

        [Parameter(Mandatory)]
        [string]$Indexfile,

        [string]$Revoke,

        [string]$Gencrl,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Password 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslcrl: Starting"
    }
    process {
        try {
            $payload = @{ cacertfile = $cacertfile
                cakeyfile            = $cakeyfile
                indexfile            = $indexfile
            }
            if ( $PSBoundParameters.ContainsKey('revoke') ) { $payload.Add('revoke', $revoke) }
            if ( $PSBoundParameters.ContainsKey('gencrl') ) { $payload.Add('gencrl', $gencrl) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcrl -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslcrl: Finished"
    }
}

function Invoke-NSDeleteSslcrl {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Crlname
        Name for the Certificate Revocation List (CRL). Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the CRL is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcrl -Crlname <string>
        An example how to delete sslcrl config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Crlname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcrl: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$crlname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcrl -NitroPath nitro/v1/config -Resource $crlname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcrl: Finished"
    }
}

function Invoke-NSUpdateSslcrl {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Crlname
        Name for the Certificate Revocation List (CRL). Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the CRL is created.
    .PARAMETER Refresh
        Set CRL auto refresh.
        Possible values = ENABLED, DISABLED
    .PARAMETER Cacert
        CA certificate that has issued the CRL. Required if CRL Auto Refresh is selected. Install the CA certificate on the appliance before adding the CRL.
    .PARAMETER Server
        IP address of the LDAP server from which to fetch the CRLs.
    .PARAMETER Method
        Method for CRL refresh. If LDAP is selected, specify the method, CA certificate, base DN, port, and LDAP server name. If HTTP is selected, specify the CA certificate, method, URL, and port. Cannot be changed after a CRL is added.
        Possible values = HTTP, LDAP
    .PARAMETER Url
        URL of the CRL distribution point.
    .PARAMETER Port
        Port for the LDAP server.
    .PARAMETER Basedn
        Base distinguished name (DN), which is used in an LDAP search to search for a CRL. Citrix recommends searching for the Base DN instead of the Issuer Name from the CA certificate, because the Issuer Name field might not exactly match the LDAP directory structure's DN.
    .PARAMETER Scope
        Extent of the search operation on the LDAP server. Available settings function as follows:
        One - One level below Base DN.
        Base - Exactly the same level as Base DN.
          
        Possible values = Base, One
    .PARAMETER Interval
        CRL refresh interval. Use the NONE setting to unset this parameter.
        Possible values = MONTHLY, WEEKLY, DAILY, NOW, NONE
    .PARAMETER Day
        Day on which to refresh the CRL, or, if the Interval parameter is not set, the number of days after which to refresh the CRL. If Interval is set to MONTHLY, specify the date. If Interval is set to WEEKLY, specify the day of the week (for example, Sun=0 and Sat=6). This parameter is not applicable if the Interval is set to DAILY.
          
        Maximum value = 31
    .PARAMETER Time
        Time, in hours (1-24) and minutes (1-60), at which to refresh the CRL.
    .PARAMETER Binddn
        Bind distinguished name (DN) to be used to access the CRL object in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Password
        Password to access the CRL in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Binary
        Set the LDAP-based CRL retrieval mode to binary.
          
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created sslcrl item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslcrl -crlname <string>
        An example how to update sslcrl config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Crlname,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Refresh,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Cacert,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Server,

        [ValidateSet('HTTP', 'LDAP')]
        [string]$Method,

        [string]$Url,

        [int]$Port,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Basedn,

        [ValidateSet('Base', 'One')]
        [string]$Scope,

        [ValidateSet('MONTHLY', 'WEEKLY', 'DAILY', 'NOW', 'NONE')]
        [string]$Interval,

        [double]$Day,

        [string]$Time,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Binddn,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Password,

        [ValidateSet('YES', 'NO')]
        [string]$Binary,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslcrl: Starting"
    }
    process {
        try {
            $payload = @{ crlname = $crlname }
            if ( $PSBoundParameters.ContainsKey('refresh') ) { $payload.Add('refresh', $refresh) }
            if ( $PSBoundParameters.ContainsKey('cacert') ) { $payload.Add('cacert', $cacert) }
            if ( $PSBoundParameters.ContainsKey('server') ) { $payload.Add('server', $server) }
            if ( $PSBoundParameters.ContainsKey('method') ) { $payload.Add('method', $method) }
            if ( $PSBoundParameters.ContainsKey('url') ) { $payload.Add('url', $url) }
            if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) }
            if ( $PSBoundParameters.ContainsKey('basedn') ) { $payload.Add('basedn', $basedn) }
            if ( $PSBoundParameters.ContainsKey('scope') ) { $payload.Add('scope', $scope) }
            if ( $PSBoundParameters.ContainsKey('interval') ) { $payload.Add('interval', $interval) }
            if ( $PSBoundParameters.ContainsKey('day') ) { $payload.Add('day', $day) }
            if ( $PSBoundParameters.ContainsKey('time') ) { $payload.Add('time', $time) }
            if ( $PSBoundParameters.ContainsKey('binddn') ) { $payload.Add('binddn', $binddn) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('binary') ) { $payload.Add('binary', $binary) }
            if ( $PSCmdlet.ShouldProcess("sslcrl", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslcrl -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslcrl -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslcrl: Finished"
    }
}

function Invoke-NSUnsetSslcrl {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Crlname
        Name for the Certificate Revocation List (CRL). Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the CRL is created.
    .PARAMETER Refresh
        Set CRL auto refresh.
        Possible values = ENABLED, DISABLED
    .PARAMETER Cacert
        CA certificate that has issued the CRL. Required if CRL Auto Refresh is selected. Install the CA certificate on the appliance before adding the CRL.
    .PARAMETER Server
        IP address of the LDAP server from which to fetch the CRLs.
    .PARAMETER Method
        Method for CRL refresh. If LDAP is selected, specify the method, CA certificate, base DN, port, and LDAP server name. If HTTP is selected, specify the CA certificate, method, URL, and port. Cannot be changed after a CRL is added.
        Possible values = HTTP, LDAP
    .PARAMETER Url
        URL of the CRL distribution point.
    .PARAMETER Port
        Port for the LDAP server.
    .PARAMETER Basedn
        Base distinguished name (DN), which is used in an LDAP search to search for a CRL. Citrix recommends searching for the Base DN instead of the Issuer Name from the CA certificate, because the Issuer Name field might not exactly match the LDAP directory structure's DN.
    .PARAMETER Scope
        Extent of the search operation on the LDAP server. Available settings function as follows:
        One - One level below Base DN.
        Base - Exactly the same level as Base DN.
          
        Possible values = Base, One
    .PARAMETER Interval
        CRL refresh interval. Use the NONE setting to unset this parameter.
        Possible values = MONTHLY, WEEKLY, DAILY, NOW, NONE
    .PARAMETER Day
        Day on which to refresh the CRL, or, if the Interval parameter is not set, the number of days after which to refresh the CRL. If Interval is set to MONTHLY, specify the date. If Interval is set to WEEKLY, specify the day of the week (for example, Sun=0 and Sat=6). This parameter is not applicable if the Interval is set to DAILY.
          
        Maximum value = 31
    .PARAMETER Time
        Time, in hours (1-24) and minutes (1-60), at which to refresh the CRL.
    .PARAMETER Binddn
        Bind distinguished name (DN) to be used to access the CRL object in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Password
        Password to access the CRL in the LDAP repository if access to the LDAP repository is restricted or anonymous access is not allowed.
    .PARAMETER Binary
        Set the LDAP-based CRL retrieval mode to binary.
          
        Possible values = YES, NO
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslcrl -crlname <string>
        An example how to unset sslcrl config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Crlname,

        [Boolean]$refresh,

        [Boolean]$cacert,

        [Boolean]$server,

        [Boolean]$method,

        [Boolean]$url,

        [Boolean]$port,

        [Boolean]$basedn,

        [Boolean]$scope,

        [Boolean]$interval,

        [Boolean]$day,

        [Boolean]$time,

        [Boolean]$binddn,

        [Boolean]$password,

        [Boolean]$binary 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslcrl: Starting"
    }
    process {
        try {
            $payload = @{ crlname = $crlname }
            if ( $PSBoundParameters.ContainsKey('refresh') ) { $payload.Add('refresh', $refresh) }
            if ( $PSBoundParameters.ContainsKey('cacert') ) { $payload.Add('cacert', $cacert) }
            if ( $PSBoundParameters.ContainsKey('server') ) { $payload.Add('server', $server) }
            if ( $PSBoundParameters.ContainsKey('method') ) { $payload.Add('method', $method) }
            if ( $PSBoundParameters.ContainsKey('url') ) { $payload.Add('url', $url) }
            if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) }
            if ( $PSBoundParameters.ContainsKey('basedn') ) { $payload.Add('basedn', $basedn) }
            if ( $PSBoundParameters.ContainsKey('scope') ) { $payload.Add('scope', $scope) }
            if ( $PSBoundParameters.ContainsKey('interval') ) { $payload.Add('interval', $interval) }
            if ( $PSBoundParameters.ContainsKey('day') ) { $payload.Add('day', $day) }
            if ( $PSBoundParameters.ContainsKey('time') ) { $payload.Add('time', $time) }
            if ( $PSBoundParameters.ContainsKey('binddn') ) { $payload.Add('binddn', $binddn) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('binary') ) { $payload.Add('binary', $binary) }
            if ( $PSCmdlet.ShouldProcess("$crlname", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslcrl -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslcrl: Finished"
    }
}

function Invoke-NSGetSslcrl {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Certificate Revocation List resource.
    .PARAMETER Crlname
        Name for the Certificate Revocation List (CRL). Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the CRL is created.
    .PARAMETER GetAll
        Retrieve all sslcrl object(s).
    .PARAMETER Count
        If specified, the count of the sslcrl object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrl
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrl -GetAll
        Get all sslcrl data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrl -Count
        Get the number of sslcrl objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrl -name <string>
        Get sslcrl object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrl -Filter @{ 'name'='<value>' }
        Get sslcrl data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcrl
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Crlname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcrl: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcrl objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcrl objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcrl objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcrl configuration for property 'crlname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl -NitroPath nitro/v1/config -Resource $crlname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcrl configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcrl: Ended"
    }
}

function Invoke-NSGetSslcrlBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslcrl.
    .PARAMETER Crlname
        Name of the CRL for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslcrl_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcrl_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlBinding -GetAll
        Get all sslcrl_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlBinding -name <string>
        Get sslcrl_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlBinding -Filter @{ 'name'='<value>' }
        Get sslcrl_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcrlBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Crlname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcrlBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcrl_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcrl_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcrl_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcrl_binding configuration for property 'crlname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_binding -NitroPath nitro/v1/config -Resource $crlname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcrl_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcrlBinding: Ended"
    }
}

function Invoke-NSGetSslcrlSerialnumberBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the serialnumber that can be bound to sslcrl.
    .PARAMETER Crlname
        Name of the CRL for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslcrl_serialnumber_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslcrl_serialnumber_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlSerialnumberBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlSerialnumberBinding -GetAll
        Get all sslcrl_serialnumber_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlSerialnumberBinding -Count
        Get the number of sslcrl_serialnumber_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlSerialnumberBinding -name <string>
        Get sslcrl_serialnumber_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlSerialnumberBinding -Filter @{ 'name'='<value>' }
        Get sslcrl_serialnumber_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcrlSerialnumberBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrl_serialnumber_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Crlname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslcrlSerialnumberBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslcrl_serialnumber_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_serialnumber_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcrl_serialnumber_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_serialnumber_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcrl_serialnumber_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_serialnumber_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcrl_serialnumber_binding configuration for property 'crlname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_serialnumber_binding -NitroPath nitro/v1/config -Resource $crlname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslcrl_serialnumber_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrl_serialnumber_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcrlSerialnumberBinding: Ended"
    }
}

function Invoke-NSImportSslcrlfile {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported crl files resource.
    .PARAMETER Name
        Name to assign to the imported CRL file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name to the CRL file to be imported. For example, http://www.example.com/crl_file.
        NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access.
    .EXAMPLE
        PS C:\>Invoke-NSImportSslcrlfile -name <string> -src <string>
        An example how to import sslcrlfile config Object(s).
    .NOTES
        File Name : Invoke-NSImportSslcrlfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrlfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src 

    )
    begin {
        Write-Verbose "Invoke-NSImportSslcrlfile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslcrlfile -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSslcrlfile: Finished"
    }
}

function Invoke-NSDeleteSslcrlfile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported crl files resource.
    .PARAMETER Name
        Name to assign to the imported CRL file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslcrlfile
        An example how to delete sslcrlfile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslcrlfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrlfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslcrlfile: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Name') ) { $arguments.Add('name', $Name) }
            if ( $PSCmdlet.ShouldProcess("sslcrlfile", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslcrlfile -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslcrlfile: Finished"
    }
}

function Invoke-NSGetSslcrlfile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Imported crl files resource.
    .PARAMETER GetAll
        Retrieve all sslcrlfile object(s).
    .PARAMETER Count
        If specified, the count of the sslcrlfile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlfile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlfile -GetAll
        Get all sslcrlfile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlfile -Count
        Get the number of sslcrlfile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlfile -name <string>
        Get sslcrlfile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslcrlfile -Filter @{ 'name'='<value>' }
        Get sslcrlfile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslcrlfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslcrlfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslcrlfile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslcrlfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrlfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslcrlfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrlfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslcrlfile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrlfile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslcrlfile configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslcrlfile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslcrlfile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslcrlfile: Ended"
    }
}

function Invoke-NSImportSsldhfile {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for dh imported file resource.
    .PARAMETER Name
        Name to assign to the imported DH file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name, to the DH file to be imported. For example, http://www.example.com/dh_file.
        NOTE: The import fails if the file is on an HTTPS server that requires client certificate authentication for access.
    .EXAMPLE
        PS C:\>Invoke-NSImportSsldhfile -name <string> -src <string>
        An example how to import ssldhfile config Object(s).
    .NOTES
        File Name : Invoke-NSImportSsldhfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldhfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src 

    )
    begin {
        Write-Verbose "Invoke-NSImportSsldhfile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type ssldhfile -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSsldhfile: Finished"
    }
}

function Invoke-NSDeleteSsldhfile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for dh imported file resource.
    .PARAMETER Name
        Name to assign to the imported DH file. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSsldhfile
        An example how to delete ssldhfile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSsldhfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldhfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSsldhfile: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Name') ) { $arguments.Add('name', $Name) }
            if ( $PSCmdlet.ShouldProcess("ssldhfile", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type ssldhfile -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSsldhfile: Finished"
    }
}

function Invoke-NSGetSsldhfile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for dh imported file resource.
    .PARAMETER GetAll
        Retrieve all ssldhfile object(s).
    .PARAMETER Count
        If specified, the count of the ssldhfile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldhfile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldhfile -GetAll
        Get all ssldhfile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldhfile -Count
        Get the number of ssldhfile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldhfile -name <string>
        Get ssldhfile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldhfile -Filter @{ 'name'='<value>' }
        Get ssldhfile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSsldhfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldhfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSsldhfile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all ssldhfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldhfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for ssldhfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldhfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving ssldhfile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldhfile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving ssldhfile configuration for property ''"

            } else {
                Write-Verbose "Retrieving ssldhfile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldhfile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSsldhfile: Ended"
    }
}

function Invoke-NSCreateSsldhparam {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for dh Parameter resource.
    .PARAMETER Dhfile
        Name of and, optionally, path to the DH key file. /nsconfig/ssl/ is the default path.
    .PARAMETER Bits
        Size, in bits, of the DH key being generated.
          
        Maximum value = 2048
    .PARAMETER Gen
        Random number required for generating the DH key. Required as part of the DH key generation algorithm.
          
        Possible values = 2, 5
    .EXAMPLE
        PS C:\>Invoke-NSCreateSsldhparam -dhfile <string>
        An example how to create ssldhparam config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSsldhparam
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldhparam/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Dhfile,

        [double]$Bits,

        [ValidateSet('2', '5')]
        [string]$Gen 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSsldhparam: Starting"
    }
    process {
        try {
            $payload = @{ dhfile = $dhfile }
            if ( $PSBoundParameters.ContainsKey('bits') ) { $payload.Add('bits', $bits) }
            if ( $PSBoundParameters.ContainsKey('gen') ) { $payload.Add('gen', $gen) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type ssldhparam -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSsldhparam: Finished"
    }
}

function Invoke-NSAddSsldtlsprofile {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for DTLS profile resource.
    .PARAMETER Name
        Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Pmtudiscovery
        Source for the maximum record size value. If ENABLED, the value is taken from the PMTU table. If DISABLED, the value is taken from the profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxrecordsize
        Maximum size of records that can be sent if PMTU is disabled.
          
          
        Maximum value = 1459
    .PARAMETER Maxretrytime
        Wait for the specified time, in seconds, before resending the request.
    .PARAMETER Helloverifyrequest
        Send a Hello Verify request to validate the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Terminatesession
        Terminate the session if the message authentication code (MAC) of the client and server do not match.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxpacketsize
        Maximum number of packets to reassemble. This value helps protect against a fragmented packet attack.
          
          
        Maximum value = 86400
    .PARAMETER Maxholdqlen
        Maximum number of datagrams that can be queued at DTLS layer for processing.
          
          
        Maximum value = 65535
    .PARAMETER Maxbadmacignorecount
        Maximum number of bad MAC errors to ignore for a connection prior disconnect. Disabling parameter terminateSession terminates session immediately when bad MAC is detected in the connection.
          
          
        Maximum value = 65535
    .PARAMETER PassThru
        Return details about the created ssldtlsprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSsldtlsprofile -name <string>
        An example how to add ssldtlsprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddSsldtlsprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldtlsprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Pmtudiscovery = 'DISABLED',

        [double]$Maxrecordsize = '1459',

        [double]$Maxretrytime = '3',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Helloverifyrequest = 'ENABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Terminatesession = 'DISABLED',

        [double]$Maxpacketsize = '120',

        [double]$Maxholdqlen = '32',

        [double]$Maxbadmacignorecount = '100',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSsldtlsprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('pmtudiscovery') ) { $payload.Add('pmtudiscovery', $pmtudiscovery) }
            if ( $PSBoundParameters.ContainsKey('maxrecordsize') ) { $payload.Add('maxrecordsize', $maxrecordsize) }
            if ( $PSBoundParameters.ContainsKey('maxretrytime') ) { $payload.Add('maxretrytime', $maxretrytime) }
            if ( $PSBoundParameters.ContainsKey('helloverifyrequest') ) { $payload.Add('helloverifyrequest', $helloverifyrequest) }
            if ( $PSBoundParameters.ContainsKey('terminatesession') ) { $payload.Add('terminatesession', $terminatesession) }
            if ( $PSBoundParameters.ContainsKey('maxpacketsize') ) { $payload.Add('maxpacketsize', $maxpacketsize) }
            if ( $PSBoundParameters.ContainsKey('maxholdqlen') ) { $payload.Add('maxholdqlen', $maxholdqlen) }
            if ( $PSBoundParameters.ContainsKey('maxbadmacignorecount') ) { $payload.Add('maxbadmacignorecount', $maxbadmacignorecount) }
            if ( $PSCmdlet.ShouldProcess("ssldtlsprofile", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type ssldtlsprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSsldtlsprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSsldtlsprofile: Finished"
    }
}

function Invoke-NSDeleteSsldtlsprofile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for DTLS profile resource.
    .PARAMETER Name
        Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSsldtlsprofile -Name <string>
        An example how to delete ssldtlsprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSsldtlsprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldtlsprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSsldtlsprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type ssldtlsprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSsldtlsprofile: Finished"
    }
}

function Invoke-NSUpdateSsldtlsprofile {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for DTLS profile resource.
    .PARAMETER Name
        Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Pmtudiscovery
        Source for the maximum record size value. If ENABLED, the value is taken from the PMTU table. If DISABLED, the value is taken from the profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxrecordsize
        Maximum size of records that can be sent if PMTU is disabled.
          
          
        Maximum value = 1459
    .PARAMETER Maxretrytime
        Wait for the specified time, in seconds, before resending the request.
    .PARAMETER Helloverifyrequest
        Send a Hello Verify request to validate the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Terminatesession
        Terminate the session if the message authentication code (MAC) of the client and server do not match.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxpacketsize
        Maximum number of packets to reassemble. This value helps protect against a fragmented packet attack.
          
          
        Maximum value = 86400
    .PARAMETER Maxholdqlen
        Maximum number of datagrams that can be queued at DTLS layer for processing.
          
          
        Maximum value = 65535
    .PARAMETER Maxbadmacignorecount
        Maximum number of bad MAC errors to ignore for a connection prior disconnect. Disabling parameter terminateSession terminates session immediately when bad MAC is detected in the connection.
          
          
        Maximum value = 65535
    .PARAMETER PassThru
        Return details about the created ssldtlsprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSsldtlsprofile -name <string>
        An example how to update ssldtlsprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSsldtlsprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldtlsprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Pmtudiscovery,

        [double]$Maxrecordsize,

        [double]$Maxretrytime,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Helloverifyrequest,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Terminatesession,

        [double]$Maxpacketsize,

        [double]$Maxholdqlen,

        [double]$Maxbadmacignorecount,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSsldtlsprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('pmtudiscovery') ) { $payload.Add('pmtudiscovery', $pmtudiscovery) }
            if ( $PSBoundParameters.ContainsKey('maxrecordsize') ) { $payload.Add('maxrecordsize', $maxrecordsize) }
            if ( $PSBoundParameters.ContainsKey('maxretrytime') ) { $payload.Add('maxretrytime', $maxretrytime) }
            if ( $PSBoundParameters.ContainsKey('helloverifyrequest') ) { $payload.Add('helloverifyrequest', $helloverifyrequest) }
            if ( $PSBoundParameters.ContainsKey('terminatesession') ) { $payload.Add('terminatesession', $terminatesession) }
            if ( $PSBoundParameters.ContainsKey('maxpacketsize') ) { $payload.Add('maxpacketsize', $maxpacketsize) }
            if ( $PSBoundParameters.ContainsKey('maxholdqlen') ) { $payload.Add('maxholdqlen', $maxholdqlen) }
            if ( $PSBoundParameters.ContainsKey('maxbadmacignorecount') ) { $payload.Add('maxbadmacignorecount', $maxbadmacignorecount) }
            if ( $PSCmdlet.ShouldProcess("ssldtlsprofile", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type ssldtlsprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSsldtlsprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSsldtlsprofile: Finished"
    }
}

function Invoke-NSUnsetSsldtlsprofile {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for DTLS profile resource.
    .PARAMETER Name
        Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Pmtudiscovery
        Source for the maximum record size value. If ENABLED, the value is taken from the PMTU table. If DISABLED, the value is taken from the profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxrecordsize
        Maximum size of records that can be sent if PMTU is disabled.
          
          
        Maximum value = 1459
    .PARAMETER Maxretrytime
        Wait for the specified time, in seconds, before resending the request.
    .PARAMETER Helloverifyrequest
        Send a Hello Verify request to validate the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Terminatesession
        Terminate the session if the message authentication code (MAC) of the client and server do not match.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxpacketsize
        Maximum number of packets to reassemble. This value helps protect against a fragmented packet attack.
          
          
        Maximum value = 86400
    .PARAMETER Maxholdqlen
        Maximum number of datagrams that can be queued at DTLS layer for processing.
          
          
        Maximum value = 65535
    .PARAMETER Maxbadmacignorecount
        Maximum number of bad MAC errors to ignore for a connection prior disconnect. Disabling parameter terminateSession terminates session immediately when bad MAC is detected in the connection.
          
          
        Maximum value = 65535
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSsldtlsprofile -name <string>
        An example how to unset ssldtlsprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSsldtlsprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldtlsprofile
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Boolean]$pmtudiscovery,

        [Boolean]$maxrecordsize,

        [Boolean]$maxretrytime,

        [Boolean]$helloverifyrequest,

        [Boolean]$terminatesession,

        [Boolean]$maxpacketsize,

        [Boolean]$maxholdqlen,

        [Boolean]$maxbadmacignorecount 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSsldtlsprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('pmtudiscovery') ) { $payload.Add('pmtudiscovery', $pmtudiscovery) }
            if ( $PSBoundParameters.ContainsKey('maxrecordsize') ) { $payload.Add('maxrecordsize', $maxrecordsize) }
            if ( $PSBoundParameters.ContainsKey('maxretrytime') ) { $payload.Add('maxretrytime', $maxretrytime) }
            if ( $PSBoundParameters.ContainsKey('helloverifyrequest') ) { $payload.Add('helloverifyrequest', $helloverifyrequest) }
            if ( $PSBoundParameters.ContainsKey('terminatesession') ) { $payload.Add('terminatesession', $terminatesession) }
            if ( $PSBoundParameters.ContainsKey('maxpacketsize') ) { $payload.Add('maxpacketsize', $maxpacketsize) }
            if ( $PSBoundParameters.ContainsKey('maxholdqlen') ) { $payload.Add('maxholdqlen', $maxholdqlen) }
            if ( $PSBoundParameters.ContainsKey('maxbadmacignorecount') ) { $payload.Add('maxbadmacignorecount', $maxbadmacignorecount) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type ssldtlsprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSsldtlsprofile: Finished"
    }
}

function Invoke-NSGetSsldtlsprofile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for DTLS profile resource.
    .PARAMETER Name
        Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER GetAll
        Retrieve all ssldtlsprofile object(s).
    .PARAMETER Count
        If specified, the count of the ssldtlsprofile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldtlsprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldtlsprofile -GetAll
        Get all ssldtlsprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldtlsprofile -Count
        Get the number of ssldtlsprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldtlsprofile -name <string>
        Get ssldtlsprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsldtlsprofile -Filter @{ 'name'='<value>' }
        Get ssldtlsprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSsldtlsprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssldtlsprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSsldtlsprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all ssldtlsprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldtlsprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for ssldtlsprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldtlsprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving ssldtlsprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldtlsprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving ssldtlsprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldtlsprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving ssldtlsprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssldtlsprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSsldtlsprofile: Ended"
    }
}

function Invoke-NSCreateSslecdsakey {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for ecdsa key resource.
    .PARAMETER Keyfile
        Name for and, optionally, path to the ECDSA key file. /nsconfig/ssl/ is the default path.
    .PARAMETER Curve
        Curve id to generate ECDSA key. Only P_256 and P_384 are supported.
          
        Possible values = P_256, P_384
    .PARAMETER Keyform
        Format in which the ECDSA key file is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Des
        Encrypt the generated ECDSA key by using the DES algorithm. On the command line, you are prompted to enter the pass phrase (password) that is used to encrypt the key.
    .PARAMETER Des3
        Encrypt the generated ECDSA key by using the Triple-DES algorithm. On the command line, you are prompted to enter the pass phrase (password) that is used to encrypt the key.
    .PARAMETER Aes256
        Encrypt the generated ECDSA key by using the AES algorithm.
    .PARAMETER Password
        Pass phrase to use for encryption if DES or DES3 option is selected.
    .PARAMETER Pkcs8
        Create the private key in PKCS#8 format.
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslecdsakey -keyfile <string> -curve <string>
        An example how to create sslecdsakey config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslecdsakey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslecdsakey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Keyfile,

        [Parameter(Mandatory)]
        [ValidateSet('P_256', 'P_384')]
        [string]$Curve,

        [ValidateSet('DER', 'PEM')]
        [string]$Keyform,

        [boolean]$Des,

        [boolean]$Des3,

        [boolean]$Aes256,

        [ValidateLength(1, 31)]
        [string]$Password,

        [boolean]$Pkcs8 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslecdsakey: Starting"
    }
    process {
        try {
            $payload = @{ keyfile = $keyfile
                curve             = $curve
            }
            if ( $PSBoundParameters.ContainsKey('keyform') ) { $payload.Add('keyform', $keyform) }
            if ( $PSBoundParameters.ContainsKey('des') ) { $payload.Add('des', $des) }
            if ( $PSBoundParameters.ContainsKey('des3') ) { $payload.Add('des3', $des3) }
            if ( $PSBoundParameters.ContainsKey('aes256') ) { $payload.Add('aes256', $aes256) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('pkcs8') ) { $payload.Add('pkcs8', $pkcs8) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslecdsakey -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslecdsakey: Finished"
    }
}

function Invoke-NSUpdateSslfips {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for fips resource.
    .PARAMETER Inithsm
        FIPS initialization level. The appliance currently supports Level-2 (FIPS 140-2).
        Possible values = Level-2
    .PARAMETER Sopassword
        Security officer password that will be in effect after you have configured the HSM.
    .PARAMETER Oldsopassword
        Old password for the security officer.
    .PARAMETER Userpassword
        The Hardware Security Module's (HSM) User password.
    .PARAMETER Hsmlabel
        Label to identify the Hardware Security Module (HSM).
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslfips -inithsm <string> -sopassword <string> -oldsopassword <string> -userpassword <string>
        An example how to update sslfips config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslfips
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfips/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateSet('Level-2')]
        [string]$Inithsm,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Sopassword,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Oldsopassword,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Userpassword,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Hsmlabel 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslfips: Starting"
    }
    process {
        try {
            $payload = @{ inithsm = $inithsm
                sopassword        = $sopassword
                oldsopassword     = $oldsopassword
                userpassword      = $userpassword
            }
            if ( $PSBoundParameters.ContainsKey('hsmlabel') ) { $payload.Add('hsmlabel', $hsmlabel) }
            if ( $PSCmdlet.ShouldProcess("sslfips", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslfips -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslfips: Finished"
    }
}

function Invoke-NSUnsetSslfips {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for fips resource.
    .PARAMETER Hsmlabel
        Label to identify the Hardware Security Module (HSM).
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslfips
        An example how to unset sslfips config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslfips
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfips
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Boolean]$hsmlabel 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslfips: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('hsmlabel') ) { $payload.Add('hsmlabel', $hsmlabel) }
            if ( $PSCmdlet.ShouldProcess("sslfips", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslfips -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslfips: Finished"
    }
}

function Invoke-NSResetSslfips {
    <#
    .SYNOPSIS
        Reset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for fips resource.
    .EXAMPLE
        PS C:\>Invoke-NSResetSslfips
        An example how to reset sslfips config Object(s).
    .NOTES
        File Name : Invoke-NSResetSslfips
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfips/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession) 

    )
    begin {
        Write-Verbose "Invoke-NSResetSslfips: Starting"
    }
    process {
        try {
            $payload = @{ }

            if ( $PSCmdlet.ShouldProcess($Name, "Reset SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfips -Action reset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSResetSslfips: Finished"
    }
}

function Invoke-NSChangeSslfips {
    <#
    .SYNOPSIS
        Change SSL Configuration config Object.
    .DESCRIPTION
        Configuration for fips resource.
    .PARAMETER Fipsfw
        Path to the FIPS firmware file.
    .EXAMPLE
        PS C:\>Invoke-NSChangeSslfips -fipsfw <string>
        An example how to change sslfips config Object(s).
    .NOTES
        File Name : Invoke-NSChangeSslfips
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfips/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Fipsfw 
    )
    begin {
        Write-Verbose "Invoke-NSChangeSslfips: Starting"
    }
    process {
        try {
            $payload = @{ fipsfw = $fipsfw }

            if ( $PSCmdlet.ShouldProcess("sslfips", "Change SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfips -Action update -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSChangeSslfips: Finished"
    }
}

function Invoke-NSGetSslfips {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for fips resource.
    .PARAMETER GetAll
        Retrieve all sslfips object(s).
    .PARAMETER Count
        If specified, the count of the sslfips object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfips
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfips -GetAll
        Get all sslfips data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfips -name <string>
        Get sslfips object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfips -Filter @{ 'name'='<value>' }
        Get sslfips data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslfips
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfips/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslfips: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslfips objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfips -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslfips objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfips -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslfips objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfips -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslfips configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslfips configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfips -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslfips: Ended"
    }
}

function Invoke-NSCreateSslfipskey {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS key resource.
    .PARAMETER Fipskeyname
        Name for the FIPS key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the FIPS key is created.
    .PARAMETER Keytype
        Only RSA key and ECDSA Key are supported.
          
        Possible values = RSA, ECDSA
    .PARAMETER Exponent
        Exponent value for the FIPS key to be created. Available values function as follows:
        3=3 (hexadecimal)
        F4=10001 (hexadecimal).
          
        Possible values = 3, F4
    .PARAMETER Modulus
        Modulus, in multiples of 64, of the FIPS key to be created.
          
        Maximum value = 4096
    .PARAMETER Curve
        Only p_256 (prime256v1) and P_384 (secp384r1) are supported.
          
        Possible values = P_256, P_384
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslfipskey -fipskeyname <string> -keytype <string>
        An example how to create sslfipskey config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslfipskey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipskey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Fipskeyname,

        [Parameter(Mandatory)]
        [ValidateSet('RSA', 'ECDSA')]
        [string]$Keytype,

        [ValidateSet('3', 'F4')]
        [string]$Exponent,

        [double]$Modulus,

        [ValidateSet('P_256', 'P_384')]
        [string]$Curve 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslfipskey: Starting"
    }
    process {
        try {
            $payload = @{ fipskeyname = $fipskeyname
                keytype               = $keytype
            }
            if ( $PSBoundParameters.ContainsKey('exponent') ) { $payload.Add('exponent', $exponent) }
            if ( $PSBoundParameters.ContainsKey('modulus') ) { $payload.Add('modulus', $modulus) }
            if ( $PSBoundParameters.ContainsKey('curve') ) { $payload.Add('curve', $curve) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipskey -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslfipskey: Finished"
    }
}

function Invoke-NSDeleteSslfipskey {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS key resource.
    .PARAMETER Fipskeyname
        Name for the FIPS key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the FIPS key is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslfipskey -Fipskeyname <string>
        An example how to delete sslfipskey config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslfipskey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipskey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Fipskeyname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslfipskey: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$fipskeyname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslfipskey -NitroPath nitro/v1/config -Resource $fipskeyname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslfipskey: Finished"
    }
}

function Invoke-NSImportSslfipskey {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS key resource.
    .PARAMETER Fipskeyname
        Name for the FIPS key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the FIPS key is created.
    .PARAMETER Key
        Name of and, optionally, path to the key file to be imported.
        /nsconfig/ssl/ is the default path.
    .PARAMETER Inform
        Input format of the key file. Available formats are:
        SIM - Secure Information Management; select when importing a FIPS key. If the external FIPS key is encrypted, first decrypt it, and then import it.
        PEM - Privacy Enhanced Mail; select when importing a non-FIPS key.
          
          
        Possible values = SIM, DER, PEM
    .PARAMETER Wrapkeyname
        Name of the wrap key to use for importing the key. Required for importing a non-FIPS key.
    .PARAMETER InitalizationVector
        Initialization Vector (IV) to use for importing the key. Required for importing a non-FIPS key.
    .PARAMETER Exponent
        Exponent value for the FIPS key to be created. Available values function as follows:
        3=3 (hexadecimal)
        F4=10001 (hexadecimal).
          
        Possible values = 3, F4
    .EXAMPLE
        PS C:\>Invoke-NSImportSslfipskey -fipskeyname <string> -key <string>
        An example how to import sslfipskey config Object(s).
    .NOTES
        File Name : Invoke-NSImportSslfipskey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipskey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Fipskeyname,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Key,

        [ValidateSet('SIM', 'DER', 'PEM')]
        [string]$Inform,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Wrapkeyname,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$InitalizationVector,

        [ValidateSet('3', 'F4')]
        [string]$Exponent 

    )
    begin {
        Write-Verbose "Invoke-NSImportSslfipskey: Starting"
    }
    process {
        try {
            $payload = @{ fipskeyname = $fipskeyname
                key                   = $key
            }
            if ( $PSBoundParameters.ContainsKey('inform') ) { $payload.Add('inform', $inform) }
            if ( $PSBoundParameters.ContainsKey('wrapkeyname') ) { $payload.Add('wrapkeyname', $wrapkeyname) }
            if ( $PSBoundParameters.ContainsKey('InitalizationVector') ) { $payload.Add('iv', $InitalizationVector) }
            if ( $PSBoundParameters.ContainsKey('exponent') ) { $payload.Add('exponent', $exponent) }
            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipskey -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSslfipskey: Finished"
    }
}

function Invoke-NSExportSslfipskey {
    <#
    .SYNOPSIS
        Export SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS key resource.
    .PARAMETER Fipskeyname
        Name for the FIPS key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the FIPS key is created.
    .PARAMETER Key
        Name of and, optionally, path to the key file to be imported.
        /nsconfig/ssl/ is the default path.
    .EXAMPLE
        PS C:\>Invoke-NSExportSslfipskey -fipskeyname <string> -key <string>
        An example how to export sslfipskey config Object(s).
    .NOTES
        File Name : Invoke-NSExportSslfipskey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipskey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Fipskeyname,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Key 

    )
    begin {
        Write-Verbose "Invoke-NSExportSslfipskey: Starting"
    }
    process {
        try {
            $payload = @{ fipskeyname = $fipskeyname
                key                   = $key
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Export SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipskey -Action export -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSExportSslfipskey: Finished"
    }
}

function Invoke-NSGetSslfipskey {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for FIPS key resource.
    .PARAMETER Fipskeyname
        Name for the FIPS key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the FIPS key is created.
    .PARAMETER GetAll
        Retrieve all sslfipskey object(s).
    .PARAMETER Count
        If specified, the count of the sslfipskey object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfipskey
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfipskey -GetAll
        Get all sslfipskey data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfipskey -Count
        Get the number of sslfipskey objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfipskey -name <string>
        Get sslfipskey object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslfipskey -Filter @{ 'name'='<value>' }
        Get sslfipskey data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslfipskey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipskey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Fipskeyname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslfipskey: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslfipskey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfipskey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslfipskey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfipskey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslfipskey objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfipskey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslfipskey configuration for property 'fipskeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfipskey -NitroPath nitro/v1/config -Resource $fipskeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslfipskey configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslfipskey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslfipskey: Ended"
    }
}

function Invoke-NSEnableSslfipssimsource {
    <#
    .SYNOPSIS
        Enable SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPsSIM source resource.
    .PARAMETER Targetsecret
        Name of and, optionally, path to the target FIPS appliance's secret data. /nsconfig/ssl/ is the default path.
    .PARAMETER Sourcesecret
        Name for and, optionally, path to the source FIPS appliance's secret data. /nsconfig/ssl/ is the default path.
    .EXAMPLE
        PS C:\>Invoke-NSEnableSslfipssimsource -targetsecret <string> -sourcesecret <string>
        An example how to enable sslfipssimsource config Object(s).
    .NOTES
        File Name : Invoke-NSEnableSslfipssimsource
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipssimsource/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Targetsecret,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Sourcesecret 

    )
    begin {
        Write-Verbose "Invoke-NSEnableSslfipssimsource: Starting"
    }
    process {
        try {
            $payload = @{ targetsecret = $targetsecret
                sourcesecret           = $sourcesecret
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Enable SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipssimsource -Action enable -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSEnableSslfipssimsource: Finished"
    }
}

function Invoke-NSInitSslfipssimsource {
    <#
    .SYNOPSIS
        Init SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPsSIM source resource.
    .PARAMETER Certfile
        Name for and, optionally, path to the source FIPS appliance's certificate file. /nsconfig/ssl/ is the default path.
    .EXAMPLE
        PS C:\>Invoke-NSInitSslfipssimsource -certfile <string>
        An example how to init sslfipssimsource config Object(s).
    .NOTES
        File Name : Invoke-NSInitSslfipssimsource
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipssimsource/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certfile 

    )
    begin {
        Write-Verbose "Invoke-NSInitSslfipssimsource: Starting"
    }
    process {
        try {
            $payload = @{ certfile = $certfile }

            if ( $PSCmdlet.ShouldProcess($Name, "Init SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipssimsource -Action init -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSInitSslfipssimsource: Finished"
    }
}

function Invoke-NSEnableSslfipssimtarget {
    <#
    .SYNOPSIS
        Enable SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS SIM Target resource.
    .PARAMETER Keyvector
        Name of and, optionally, path to the target FIPS appliance's key vector. /nsconfig/ssl/ is the default path.
    .PARAMETER Sourcesecret
        Name of and, optionally, path to the source FIPS appliance's secret data. /nsconfig/ssl/ is the default path.
    .EXAMPLE
        PS C:\>Invoke-NSEnableSslfipssimtarget -keyvector <string> -sourcesecret <string>
        An example how to enable sslfipssimtarget config Object(s).
    .NOTES
        File Name : Invoke-NSEnableSslfipssimtarget
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipssimtarget/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Keyvector,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Sourcesecret 

    )
    begin {
        Write-Verbose "Invoke-NSEnableSslfipssimtarget: Starting"
    }
    process {
        try {
            $payload = @{ keyvector = $keyvector
                sourcesecret        = $sourcesecret
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Enable SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipssimtarget -Action enable -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSEnableSslfipssimtarget: Finished"
    }
}

function Invoke-NSInitSslfipssimtarget {
    <#
    .SYNOPSIS
        Init SSL Configuration config Object.
    .DESCRIPTION
        Configuration for FIPS SIM Target resource.
    .PARAMETER Certfile
        Name of and, optionally, path to the source FIPS appliance's certificate file. /nsconfig/ssl/ is the default path.
    .PARAMETER Keyvector
        Name of and, optionally, path to the target FIPS appliance's key vector. /nsconfig/ssl/ is the default path.
    .PARAMETER Targetsecret
        Name for and, optionally, path to the target FIPS appliance's secret data. The default input path for the secret data is /nsconfig/ssl/.
    .EXAMPLE
        PS C:\>Invoke-NSInitSslfipssimtarget -certfile <string> -keyvector <string> -targetsecret <string>
        An example how to init sslfipssimtarget config Object(s).
    .NOTES
        File Name : Invoke-NSInitSslfipssimtarget
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslfipssimtarget/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Certfile,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Keyvector,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Targetsecret 

    )
    begin {
        Write-Verbose "Invoke-NSInitSslfipssimtarget: Starting"
    }
    process {
        try {
            $payload = @{ certfile = $certfile
                keyvector          = $keyvector
                targetsecret       = $targetsecret
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Init SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslfipssimtarget -Action init -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSInitSslfipssimtarget: Finished"
    }
}

function Invoke-NSGetSslglobalBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslglobal.
    .PARAMETER GetAll
        Retrieve all sslglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslglobal_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalBinding -GetAll
        Get all sslglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalBinding -name <string>
        Get sslglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalBinding -Filter @{ 'name'='<value>' }
        Get sslglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslglobal_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslglobal_binding configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslglobalBinding: Ended"
    }
}

function Invoke-NSAddSslglobalSslpolicyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslglobal.
    .PARAMETER Policyname
        The name for the SSL policy.
    .PARAMETER Priority
        The priority of the policy binding.
    .PARAMETER Gotopriorityexpression
        Expression or other value specifying the next policy to be evaluated if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * USE_INVOCATION_RESULT - Applicable if this policy invokes another policy label. If the final goto in the invoked policy label has a value of END, the evaluation stops. If the final goto is anything other than END, the current policy label performs a NEXT. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label.
    .PARAMETER Type
        Global bind point to which the policy is bound.
        Possible values = CONTROL_OVERRIDE, CONTROL_DEFAULT, DATA_OVERRIDE, DATA_DEFAULT, HTTPQUIC_CONTROL_OVERRIDE, HTTPQUIC_CONTROL_DEFAULT, HTTPQUIC_DATA_OVERRIDE, HTTPQUIC_DATA_DEFAULT
    .PARAMETER Invoke
        Invoke policies bound to a virtual server, service, or policy label. After the invoked policies are evaluated, the flow returns to the policy with the next priority.
    .PARAMETER Labeltype
        Type of policy label to invoke. Specify virtual server for a policy label associated with a virtual server, or policy label for a user-defined policy label.
        Possible values = vserver, service, policylabel
    .PARAMETER Labelname
        Name of the virtual server or user-defined policy label to invoke if the policy evaluates to TRUE.
    .PARAMETER PassThru
        Return details about the created sslglobal_sslpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslglobalSslpolicyBinding
        An example how to add sslglobal_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslglobalSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslglobal_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Policyname,

        [double]$Priority,

        [string]$Gotopriorityexpression = '"END"',

        [ValidateSet('CONTROL_OVERRIDE', 'CONTROL_DEFAULT', 'DATA_OVERRIDE', 'DATA_DEFAULT', 'HTTPQUIC_CONTROL_OVERRIDE', 'HTTPQUIC_CONTROL_DEFAULT', 'HTTPQUIC_DATA_OVERRIDE', 'HTTPQUIC_DATA_DEFAULT')]
        [string]$Type,

        [boolean]$Invoke,

        [ValidateSet('vserver', 'service', 'policylabel')]
        [string]$Labeltype,

        [string]$Labelname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslglobalSslpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSBoundParameters.ContainsKey('invoke') ) { $payload.Add('invoke', $invoke) }
            if ( $PSBoundParameters.ContainsKey('labeltype') ) { $payload.Add('labeltype', $labeltype) }
            if ( $PSBoundParameters.ContainsKey('labelname') ) { $payload.Add('labelname', $labelname) }
            if ( $PSCmdlet.ShouldProcess("sslglobal_sslpolicy_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslglobal_sslpolicy_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslglobalSslpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslglobalSslpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteSslglobalSslpolicyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslglobal.
    .PARAMETER Policyname
        The name for the SSL policy.
    .PARAMETER Type
        Global bind point to which the policy is bound.
        Possible values = CONTROL_OVERRIDE, CONTROL_DEFAULT, DATA_OVERRIDE, DATA_DEFAULT, HTTPQUIC_CONTROL_OVERRIDE, HTTPQUIC_CONTROL_DEFAULT, HTTPQUIC_DATA_OVERRIDE, HTTPQUIC_DATA_DEFAULT
    .PARAMETER Priority
        The priority of the policy binding.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslglobalSslpolicyBinding
        An example how to delete sslglobal_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslglobalSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslglobal_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Policyname,

        [string]$Type,

        [double]$Priority 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslglobalSslpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) }
            if ( $PSBoundParameters.ContainsKey('Type') ) { $arguments.Add('type', $Type) }
            if ( $PSBoundParameters.ContainsKey('Priority') ) { $arguments.Add('priority', $Priority) }
            if ( $PSCmdlet.ShouldProcess("sslglobal_sslpolicy_binding", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslglobal_sslpolicy_binding -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslglobalSslpolicyBinding: Finished"
    }
}

function Invoke-NSGetSslglobalSslpolicyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslglobal.
    .PARAMETER Type
        Global bind point to which the policy is bound.
        Possible values = CONTROL_OVERRIDE, CONTROL_DEFAULT, DATA_OVERRIDE, DATA_DEFAULT, HTTPQUIC_CONTROL_OVERRIDE, HTTPQUIC_CONTROL_DEFAULT, HTTPQUIC_DATA_OVERRIDE, HTTPQUIC_DATA_DEFAULT
    .PARAMETER GetAll
        Retrieve all sslglobal_sslpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslglobal_sslpolicy_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalSslpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalSslpolicyBinding -GetAll
        Get all sslglobal_sslpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalSslpolicyBinding -Count
        Get the number of sslglobal_sslpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalSslpolicyBinding -name <string>
        Get sslglobal_sslpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslglobalSslpolicyBinding -Filter @{ 'name'='<value>' }
        Get sslglobal_sslpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslglobalSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslglobal_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByArgument')]
        [ValidateSet('CONTROL_OVERRIDE', 'CONTROL_DEFAULT', 'DATA_OVERRIDE', 'DATA_DEFAULT', 'HTTPQUIC_CONTROL_OVERRIDE', 'HTTPQUIC_CONTROL_DEFAULT', 'HTTPQUIC_DATA_OVERRIDE', 'HTTPQUIC_DATA_DEFAULT')]
        [string]$Type,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslglobalSslpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslglobal_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslglobal_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslglobal_sslpolicy_binding objects by arguments"
                $arguments = @{ } 
                if ( $PSBoundParameters.ContainsKey('type') ) { $arguments.Add('type', $type) }
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_sslpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslglobal_sslpolicy_binding configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslglobal_sslpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslglobal_sslpolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslglobalSslpolicyBinding: Ended"
    }
}

function Invoke-NSAddSslhsmkey {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for HSM key resource.
    .PARAMETER Hsmkeyname
        .
    .PARAMETER Hsmtype
        Type of HSM.
          
        Possible values = THALES, SAFENET, KEYVAULT
    .PARAMETER Key
        Name of the key. optionally, for Thales, path to the HSM key file; /var/opt/nfast/kmdata/local/ is the default path. Applies when HSMTYPE is THALES or KEYVAULT.
    .PARAMETER Serialnum
        Serial number of the partition on which the key is present. Applies only to SafeNet HSM.
    .PARAMETER Password
        Password for a partition. Applies only to SafeNet HSM.
    .PARAMETER Keystore
        Name of keystore object representing HSM where key is stored. For example, name of keyvault object or azurekeyvault authentication object. Applies only to KEYVAULT type HSM.
    .PARAMETER PassThru
        Return details about the created sslhsmkey item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslhsmkey -hsmkeyname <string>
        An example how to add sslhsmkey config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslhsmkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslhsmkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Hsmkeyname,

        [ValidateSet('THALES', 'SAFENET', 'KEYVAULT')]
        [string]$Hsmtype = 'THALES',

        [string]$Key,

        [string]$Serialnum,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Password,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Keystore,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslhsmkey: Starting"
    }
    process {
        try {
            $payload = @{ hsmkeyname = $hsmkeyname }
            if ( $PSBoundParameters.ContainsKey('hsmtype') ) { $payload.Add('hsmtype', $hsmtype) }
            if ( $PSBoundParameters.ContainsKey('key') ) { $payload.Add('key', $key) }
            if ( $PSBoundParameters.ContainsKey('serialnum') ) { $payload.Add('serialnum', $serialnum) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('keystore') ) { $payload.Add('keystore', $keystore) }
            if ( $PSCmdlet.ShouldProcess("sslhsmkey", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslhsmkey -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslhsmkey -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslhsmkey: Finished"
    }
}

function Invoke-NSDeleteSslhsmkey {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for HSM key resource.
    .PARAMETER Hsmkeyname
        .
    .PARAMETER Hsmtype
        Type of HSM.
          
        Possible values = THALES, SAFENET, KEYVAULT
    .PARAMETER Serialnum
        Serial number of the partition on which the key is present. Applies only to SafeNet HSM.
    .PARAMETER Password
        Password for a partition. Applies only to SafeNet HSM.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslhsmkey -Hsmkeyname <string>
        An example how to delete sslhsmkey config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslhsmkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslhsmkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Hsmkeyname,

        [string]$Hsmtype,

        [string]$Serialnum,

        [string]$Password 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslhsmkey: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Hsmtype') ) { $arguments.Add('hsmtype', $Hsmtype) }
            if ( $PSBoundParameters.ContainsKey('Serialnum') ) { $arguments.Add('serialnum', $Serialnum) }
            if ( $PSBoundParameters.ContainsKey('Password') ) { $arguments.Add('password', $Password) }
            if ( $PSCmdlet.ShouldProcess("$hsmkeyname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslhsmkey -NitroPath nitro/v1/config -Resource $hsmkeyname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslhsmkey: Finished"
    }
}

function Invoke-NSGetSslhsmkey {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for HSM key resource.
    .PARAMETER Hsmkeyname
        .
    .PARAMETER GetAll
        Retrieve all sslhsmkey object(s).
    .PARAMETER Count
        If specified, the count of the sslhsmkey object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslhsmkey
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslhsmkey -GetAll
        Get all sslhsmkey data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslhsmkey -Count
        Get the number of sslhsmkey objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslhsmkey -name <string>
        Get sslhsmkey object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslhsmkey -Filter @{ 'name'='<value>' }
        Get sslhsmkey data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslhsmkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslhsmkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Hsmkeyname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslhsmkey: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslhsmkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslhsmkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslhsmkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslhsmkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslhsmkey objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslhsmkey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslhsmkey configuration for property 'hsmkeyname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslhsmkey -NitroPath nitro/v1/config -Resource $hsmkeyname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslhsmkey configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslhsmkey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslhsmkey: Ended"
    }
}

function Invoke-NSImportSslkeyfile {
    <#
    .SYNOPSIS
        Import SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported ssl key files resource.
    .PARAMETER Name
        Name to assign to the imported key file. Must begin with an ASCII alphanumeric or underscore(_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals (=), and hyphen (-) characters.
    .PARAMETER Src
        URL specifying the protocol, host, and path, including file name, to the key file to be imported. For example, http://www.example.com/key_file.
        NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access.
    .PARAMETER Password
        .
    .EXAMPLE
        PS C:\>Invoke-NSImportSslkeyfile -name <string> -src <string>
        An example how to import sslkeyfile config Object(s).
    .NOTES
        File Name : Invoke-NSImportSslkeyfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslkeyfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 31)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 2047)]
        [string]$Src,

        [string]$Password 

    )
    begin {
        Write-Verbose "Invoke-NSImportSslkeyfile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                src            = $src
            }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSCmdlet.ShouldProcess($Name, "Import SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslkeyfile -Action import -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSImportSslkeyfile: Finished"
    }
}

function Invoke-NSDeleteSslkeyfile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for Imported ssl key files resource.
    .PARAMETER Name
        Name to assign to the imported key file. Must begin with an ASCII alphanumeric or underscore(_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals (=), and hyphen (-) characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslkeyfile
        An example how to delete sslkeyfile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslkeyfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslkeyfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslkeyfile: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Name') ) { $arguments.Add('name', $Name) }
            if ( $PSCmdlet.ShouldProcess("sslkeyfile", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslkeyfile -NitroPath nitro/v1/config -Resource $ -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslkeyfile: Finished"
    }
}

function Invoke-NSGetSslkeyfile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for Imported ssl key files resource.
    .PARAMETER GetAll
        Retrieve all sslkeyfile object(s).
    .PARAMETER Count
        If specified, the count of the sslkeyfile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslkeyfile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslkeyfile -GetAll
        Get all sslkeyfile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslkeyfile -Count
        Get the number of sslkeyfile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslkeyfile -name <string>
        Get sslkeyfile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslkeyfile -Filter @{ 'name'='<value>' }
        Get sslkeyfile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslkeyfile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslkeyfile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslkeyfile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslkeyfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslkeyfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslkeyfile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslkeyfile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslkeyfile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslkeyfile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslkeyfile configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslkeyfile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslkeyfile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslkeyfile: Ended"
    }
}

function Invoke-NSAddSsllogprofile {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL logging Profile resource.
    .PARAMETER Name
        The name of the ssllogprofile.
    .PARAMETER Ssllogclauth
        log all SSL ClAuth events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssllogclauthfailures
        log all SSL ClAuth error events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghs
        log all SSL HS events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghsfailures
        log all SSL HS error events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created ssllogprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSsllogprofile -name <string>
        An example how to add ssllogprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddSsllogprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssllogprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssllogclauth = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssllogclauthfailures = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslloghs = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslloghsfailures = 'DISABLED',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSsllogprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ssllogclauth') ) { $payload.Add('ssllogclauth', $ssllogclauth) }
            if ( $PSBoundParameters.ContainsKey('ssllogclauthfailures') ) { $payload.Add('ssllogclauthfailures', $ssllogclauthfailures) }
            if ( $PSBoundParameters.ContainsKey('sslloghs') ) { $payload.Add('sslloghs', $sslloghs) }
            if ( $PSBoundParameters.ContainsKey('sslloghsfailures') ) { $payload.Add('sslloghsfailures', $sslloghsfailures) }
            if ( $PSCmdlet.ShouldProcess("ssllogprofile", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type ssllogprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSsllogprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSsllogprofile: Finished"
    }
}

function Invoke-NSUpdateSsllogprofile {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL logging Profile resource.
    .PARAMETER Name
        The name of the ssllogprofile.
    .PARAMETER Ssllogclauth
        log all SSL ClAuth events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssllogclauthfailures
        log all SSL ClAuth error events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghs
        log all SSL HS events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghsfailures
        log all SSL HS error events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created ssllogprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSsllogprofile -name <string>
        An example how to update ssllogprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSsllogprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssllogprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssllogclauth,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssllogclauthfailures,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslloghs,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslloghsfailures,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSsllogprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ssllogclauth') ) { $payload.Add('ssllogclauth', $ssllogclauth) }
            if ( $PSBoundParameters.ContainsKey('ssllogclauthfailures') ) { $payload.Add('ssllogclauthfailures', $ssllogclauthfailures) }
            if ( $PSBoundParameters.ContainsKey('sslloghs') ) { $payload.Add('sslloghs', $sslloghs) }
            if ( $PSBoundParameters.ContainsKey('sslloghsfailures') ) { $payload.Add('sslloghsfailures', $sslloghsfailures) }
            if ( $PSCmdlet.ShouldProcess("ssllogprofile", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type ssllogprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSsllogprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSsllogprofile: Finished"
    }
}

function Invoke-NSUnsetSsllogprofile {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL logging Profile resource.
    .PARAMETER Name
        The name of the ssllogprofile.
    .PARAMETER Ssllogclauth
        log all SSL ClAuth events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssllogclauthfailures
        log all SSL ClAuth error events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghs
        log all SSL HS events.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslloghsfailures
        log all SSL HS error events.
          
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSsllogprofile -name <string>
        An example how to unset ssllogprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSsllogprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssllogprofile
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateLength(1, 127)]
        [string]$Name,

        [Boolean]$ssllogclauth,

        [Boolean]$ssllogclauthfailures,

        [Boolean]$sslloghs,

        [Boolean]$sslloghsfailures 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSsllogprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ssllogclauth') ) { $payload.Add('ssllogclauth', $ssllogclauth) }
            if ( $PSBoundParameters.ContainsKey('ssllogclauthfailures') ) { $payload.Add('ssllogclauthfailures', $ssllogclauthfailures) }
            if ( $PSBoundParameters.ContainsKey('sslloghs') ) { $payload.Add('sslloghs', $sslloghs) }
            if ( $PSBoundParameters.ContainsKey('sslloghsfailures') ) { $payload.Add('sslloghsfailures', $sslloghsfailures) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type ssllogprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSsllogprofile: Finished"
    }
}

function Invoke-NSDeleteSsllogprofile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL logging Profile resource.
    .PARAMETER Name
        The name of the ssllogprofile.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSsllogprofile -Name <string>
        An example how to delete ssllogprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSsllogprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssllogprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSsllogprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type ssllogprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSsllogprofile: Finished"
    }
}

function Invoke-NSGetSsllogprofile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL logging Profile resource.
    .PARAMETER Name
        The name of the ssllogprofile.
    .PARAMETER GetAll
        Retrieve all ssllogprofile object(s).
    .PARAMETER Count
        If specified, the count of the ssllogprofile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsllogprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsllogprofile -GetAll
        Get all ssllogprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsllogprofile -Count
        Get the number of ssllogprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsllogprofile -name <string>
        Get ssllogprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSsllogprofile -Filter @{ 'name'='<value>' }
        Get ssllogprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSsllogprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssllogprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSsllogprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all ssllogprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssllogprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for ssllogprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssllogprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving ssllogprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssllogprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving ssllogprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssllogprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving ssllogprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type ssllogprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSsllogprofile: Ended"
    }
}

function Invoke-NSAddSslocspresponder {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for OCSP responser resource.
    .PARAMETER Name
        Name for the OCSP responder. Cannot begin with a hash (#) or space character and must contain only ASCII alphanumeric, underscore (_), hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the responder is created.
    .PARAMETER Url
        URL of the OCSP responder.
    .PARAMETER Cache
        Enable caching of responses. Caching of responses received from the OCSP responder enables faster responses to the clients and reduces the load on the OCSP responder.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cachetimeout
        Timeout for caching the OCSP response. After the timeout, the Citrix ADC sends a fresh request to the OCSP responder for the certificate status. If a timeout is not specified, the timeout provided in the OCSP response applies.
          
          
        Maximum value = 43200
    .PARAMETER Batchingdepth
        Number of client certificates to batch together into one OCSP request. Batching avoids overloading the OCSP responder. A value of 1 signifies that each request is queried independently. For a value greater than 1, specify a timeout (batching delay) to avoid inordinately delaying the processing of a single certificate.
          
        Maximum value = 8
    .PARAMETER Batchingdelay
        Maximum time, in milliseconds, to wait to accumulate OCSP requests to batch. Does not apply if the Batching Depth is 1.
          
        Maximum value = 10000
    .PARAMETER Resptimeout
        Time, in milliseconds, to wait for an OCSP response. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server. Includes Batching Delay time.
          
        Maximum value = 120000
    .PARAMETER Ocspurlresolvetimeout
        Time, in milliseconds, to wait for an OCSP URL Resolution. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server.
          
        Maximum value = 2000
    .PARAMETER Respondercert
        .
    .PARAMETER Trustresponder
        A certificate to use to validate OCSP responses. Alternatively, if -trustResponder is specified, no verification will be done on the reponse. If both are omitted, only the response times (producedAt, lastUpdate, nextUpdate) will be verified.
    .PARAMETER Producedattimeskew
        Time, in seconds, for which the Citrix ADC waits before considering the response as invalid. The response is considered invalid if the Produced At time stamp in the OCSP response exceeds or precedes the current Citrix ADC clock time by the amount of time specified.
          
          
        Maximum value = 86400
    .PARAMETER Signingcert
        Certificate-key pair that is used to sign OCSP requests. If this parameter is not set, the requests are not signed.
    .PARAMETER Usenonce
        Enable the OCSP nonce extension, which is designed to prevent replay attacks.
        Possible values = YES, NO
    .PARAMETER Insertclientcert
        Include the complete client certificate in the OCSP request.
        Possible values = YES, NO
    .PARAMETER Httpmethod
        HTTP method used to send ocsp request. POST is the default httpmethod. If request length is &gt; 255, POST wil be used even if GET is set as httpMethod.
          
        Possible values = GET, POST
    .PARAMETER PassThru
        Return details about the created sslocspresponder item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslocspresponder -name <string> -url <string>
        An example how to add sslocspresponder config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslocspresponder
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslocspresponder/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Url,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cache = 'DISABLED',

        [double]$Cachetimeout = '1',

        [double]$Batchingdepth,

        [double]$Batchingdelay,

        [double]$Resptimeout,

        [double]$Ocspurlresolvetimeout,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Respondercert,

        [boolean]$Trustresponder,

        [double]$Producedattimeskew = '300',

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Signingcert,

        [ValidateSet('YES', 'NO')]
        [string]$Usenonce,

        [ValidateSet('YES', 'NO')]
        [string]$Insertclientcert,

        [ValidateSet('GET', 'POST')]
        [string]$Httpmethod = 'POST',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslocspresponder: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                url            = $url
            }
            if ( $PSBoundParameters.ContainsKey('cache') ) { $payload.Add('cache', $cache) }
            if ( $PSBoundParameters.ContainsKey('cachetimeout') ) { $payload.Add('cachetimeout', $cachetimeout) }
            if ( $PSBoundParameters.ContainsKey('batchingdepth') ) { $payload.Add('batchingdepth', $batchingdepth) }
            if ( $PSBoundParameters.ContainsKey('batchingdelay') ) { $payload.Add('batchingdelay', $batchingdelay) }
            if ( $PSBoundParameters.ContainsKey('resptimeout') ) { $payload.Add('resptimeout', $resptimeout) }
            if ( $PSBoundParameters.ContainsKey('ocspurlresolvetimeout') ) { $payload.Add('ocspurlresolvetimeout', $ocspurlresolvetimeout) }
            if ( $PSBoundParameters.ContainsKey('respondercert') ) { $payload.Add('respondercert', $respondercert) }
            if ( $PSBoundParameters.ContainsKey('trustresponder') ) { $payload.Add('trustresponder', $trustresponder) }
            if ( $PSBoundParameters.ContainsKey('producedattimeskew') ) { $payload.Add('producedattimeskew', $producedattimeskew) }
            if ( $PSBoundParameters.ContainsKey('signingcert') ) { $payload.Add('signingcert', $signingcert) }
            if ( $PSBoundParameters.ContainsKey('usenonce') ) { $payload.Add('usenonce', $usenonce) }
            if ( $PSBoundParameters.ContainsKey('insertclientcert') ) { $payload.Add('insertclientcert', $insertclientcert) }
            if ( $PSBoundParameters.ContainsKey('httpmethod') ) { $payload.Add('httpmethod', $httpmethod) }
            if ( $PSCmdlet.ShouldProcess("sslocspresponder", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslocspresponder -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslocspresponder -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslocspresponder: Finished"
    }
}

function Invoke-NSDeleteSslocspresponder {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for OCSP responser resource.
    .PARAMETER Name
        Name for the OCSP responder. Cannot begin with a hash (#) or space character and must contain only ASCII alphanumeric, underscore (_), hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the responder is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslocspresponder -Name <string>
        An example how to delete sslocspresponder config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslocspresponder
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslocspresponder/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslocspresponder: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslocspresponder -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslocspresponder: Finished"
    }
}

function Invoke-NSUpdateSslocspresponder {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for OCSP responser resource.
    .PARAMETER Name
        Name for the OCSP responder. Cannot begin with a hash (#) or space character and must contain only ASCII alphanumeric, underscore (_), hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the responder is created.
    .PARAMETER Url
        URL of the OCSP responder.
    .PARAMETER Cache
        Enable caching of responses. Caching of responses received from the OCSP responder enables faster responses to the clients and reduces the load on the OCSP responder.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cachetimeout
        Timeout for caching the OCSP response. After the timeout, the Citrix ADC sends a fresh request to the OCSP responder for the certificate status. If a timeout is not specified, the timeout provided in the OCSP response applies.
          
          
        Maximum value = 43200
    .PARAMETER Batchingdepth
        Number of client certificates to batch together into one OCSP request. Batching avoids overloading the OCSP responder. A value of 1 signifies that each request is queried independently. For a value greater than 1, specify a timeout (batching delay) to avoid inordinately delaying the processing of a single certificate.
          
        Maximum value = 8
    .PARAMETER Batchingdelay
        Maximum time, in milliseconds, to wait to accumulate OCSP requests to batch. Does not apply if the Batching Depth is 1.
          
        Maximum value = 10000
    .PARAMETER Resptimeout
        Time, in milliseconds, to wait for an OCSP response. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server. Includes Batching Delay time.
          
        Maximum value = 120000
    .PARAMETER Ocspurlresolvetimeout
        Time, in milliseconds, to wait for an OCSP URL Resolution. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server.
          
        Maximum value = 2000
    .PARAMETER Respondercert
        .
    .PARAMETER Trustresponder
        A certificate to use to validate OCSP responses. Alternatively, if -trustResponder is specified, no verification will be done on the reponse. If both are omitted, only the response times (producedAt, lastUpdate, nextUpdate) will be verified.
    .PARAMETER Producedattimeskew
        Time, in seconds, for which the Citrix ADC waits before considering the response as invalid. The response is considered invalid if the Produced At time stamp in the OCSP response exceeds or precedes the current Citrix ADC clock time by the amount of time specified.
          
          
        Maximum value = 86400
    .PARAMETER Signingcert
        Certificate-key pair that is used to sign OCSP requests. If this parameter is not set, the requests are not signed.
    .PARAMETER Usenonce
        Enable the OCSP nonce extension, which is designed to prevent replay attacks.
        Possible values = YES, NO
    .PARAMETER Insertclientcert
        Include the complete client certificate in the OCSP request.
        Possible values = YES, NO
    .PARAMETER Httpmethod
        HTTP method used to send ocsp request. POST is the default httpmethod. If request length is &gt; 255, POST wil be used even if GET is set as httpMethod.
          
        Possible values = GET, POST
    .PARAMETER PassThru
        Return details about the created sslocspresponder item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslocspresponder -name <string>
        An example how to update sslocspresponder config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslocspresponder
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslocspresponder/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateLength(1, 127)]
        [string]$Url,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cache,

        [double]$Cachetimeout,

        [double]$Batchingdepth,

        [double]$Batchingdelay,

        [double]$Resptimeout,

        [double]$Ocspurlresolvetimeout,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Respondercert,

        [boolean]$Trustresponder,

        [double]$Producedattimeskew,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Signingcert,

        [ValidateSet('YES', 'NO')]
        [string]$Usenonce,

        [ValidateSet('YES', 'NO')]
        [string]$Insertclientcert,

        [ValidateSet('GET', 'POST')]
        [string]$Httpmethod,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslocspresponder: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('url') ) { $payload.Add('url', $url) }
            if ( $PSBoundParameters.ContainsKey('cache') ) { $payload.Add('cache', $cache) }
            if ( $PSBoundParameters.ContainsKey('cachetimeout') ) { $payload.Add('cachetimeout', $cachetimeout) }
            if ( $PSBoundParameters.ContainsKey('batchingdepth') ) { $payload.Add('batchingdepth', $batchingdepth) }
            if ( $PSBoundParameters.ContainsKey('batchingdelay') ) { $payload.Add('batchingdelay', $batchingdelay) }
            if ( $PSBoundParameters.ContainsKey('resptimeout') ) { $payload.Add('resptimeout', $resptimeout) }
            if ( $PSBoundParameters.ContainsKey('ocspurlresolvetimeout') ) { $payload.Add('ocspurlresolvetimeout', $ocspurlresolvetimeout) }
            if ( $PSBoundParameters.ContainsKey('respondercert') ) { $payload.Add('respondercert', $respondercert) }
            if ( $PSBoundParameters.ContainsKey('trustresponder') ) { $payload.Add('trustresponder', $trustresponder) }
            if ( $PSBoundParameters.ContainsKey('producedattimeskew') ) { $payload.Add('producedattimeskew', $producedattimeskew) }
            if ( $PSBoundParameters.ContainsKey('signingcert') ) { $payload.Add('signingcert', $signingcert) }
            if ( $PSBoundParameters.ContainsKey('usenonce') ) { $payload.Add('usenonce', $usenonce) }
            if ( $PSBoundParameters.ContainsKey('insertclientcert') ) { $payload.Add('insertclientcert', $insertclientcert) }
            if ( $PSBoundParameters.ContainsKey('httpmethod') ) { $payload.Add('httpmethod', $httpmethod) }
            if ( $PSCmdlet.ShouldProcess("sslocspresponder", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslocspresponder -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslocspresponder -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslocspresponder: Finished"
    }
}

function Invoke-NSUnsetSslocspresponder {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for OCSP responser resource.
    .PARAMETER Name
        Name for the OCSP responder. Cannot begin with a hash (#) or space character and must contain only ASCII alphanumeric, underscore (_), hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the responder is created.
    .PARAMETER Trustresponder
        A certificate to use to validate OCSP responses. Alternatively, if -trustResponder is specified, no verification will be done on the reponse. If both are omitted, only the response times (producedAt, lastUpdate, nextUpdate) will be verified.
    .PARAMETER Insertclientcert
        Include the complete client certificate in the OCSP request.
        Possible values = YES, NO
    .PARAMETER Cache
        Enable caching of responses. Caching of responses received from the OCSP responder enables faster responses to the clients and reduces the load on the OCSP responder.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cachetimeout
        Timeout for caching the OCSP response. After the timeout, the Citrix ADC sends a fresh request to the OCSP responder for the certificate status. If a timeout is not specified, the timeout provided in the OCSP response applies.
          
          
        Maximum value = 43200
    .PARAMETER Batchingdepth
        Number of client certificates to batch together into one OCSP request. Batching avoids overloading the OCSP responder. A value of 1 signifies that each request is queried independently. For a value greater than 1, specify a timeout (batching delay) to avoid inordinately delaying the processing of a single certificate.
          
        Maximum value = 8
    .PARAMETER Batchingdelay
        Maximum time, in milliseconds, to wait to accumulate OCSP requests to batch. Does not apply if the Batching Depth is 1.
          
        Maximum value = 10000
    .PARAMETER Resptimeout
        Time, in milliseconds, to wait for an OCSP response. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server. Includes Batching Delay time.
          
        Maximum value = 120000
    .PARAMETER Ocspurlresolvetimeout
        Time, in milliseconds, to wait for an OCSP URL Resolution. When this time elapses, an error message appears or the transaction is forwarded, depending on the settings on the virtual server.
          
        Maximum value = 2000
    .PARAMETER Respondercert
        .
    .PARAMETER Producedattimeskew
        Time, in seconds, for which the Citrix ADC waits before considering the response as invalid. The response is considered invalid if the Produced At time stamp in the OCSP response exceeds or precedes the current Citrix ADC clock time by the amount of time specified.
          
          
        Maximum value = 86400
    .PARAMETER Signingcert
        Certificate-key pair that is used to sign OCSP requests. If this parameter is not set, the requests are not signed.
    .PARAMETER Usenonce
        Enable the OCSP nonce extension, which is designed to prevent replay attacks.
        Possible values = YES, NO
    .PARAMETER Httpmethod
        HTTP method used to send ocsp request. POST is the default httpmethod. If request length is &gt; 255, POST wil be used even if GET is set as httpMethod.
          
        Possible values = GET, POST
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslocspresponder -name <string>
        An example how to unset sslocspresponder config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslocspresponder
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslocspresponder
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateLength(1, 127)]
        [string]$Name,

        [Boolean]$trustresponder,

        [Boolean]$insertclientcert,

        [Boolean]$cache,

        [Boolean]$cachetimeout,

        [Boolean]$batchingdepth,

        [Boolean]$batchingdelay,

        [Boolean]$resptimeout,

        [Boolean]$ocspurlresolvetimeout,

        [Boolean]$respondercert,

        [Boolean]$producedattimeskew,

        [Boolean]$signingcert,

        [Boolean]$usenonce,

        [Boolean]$httpmethod 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslocspresponder: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('trustresponder') ) { $payload.Add('trustresponder', $trustresponder) }
            if ( $PSBoundParameters.ContainsKey('insertclientcert') ) { $payload.Add('insertclientcert', $insertclientcert) }
            if ( $PSBoundParameters.ContainsKey('cache') ) { $payload.Add('cache', $cache) }
            if ( $PSBoundParameters.ContainsKey('cachetimeout') ) { $payload.Add('cachetimeout', $cachetimeout) }
            if ( $PSBoundParameters.ContainsKey('batchingdepth') ) { $payload.Add('batchingdepth', $batchingdepth) }
            if ( $PSBoundParameters.ContainsKey('batchingdelay') ) { $payload.Add('batchingdelay', $batchingdelay) }
            if ( $PSBoundParameters.ContainsKey('resptimeout') ) { $payload.Add('resptimeout', $resptimeout) }
            if ( $PSBoundParameters.ContainsKey('ocspurlresolvetimeout') ) { $payload.Add('ocspurlresolvetimeout', $ocspurlresolvetimeout) }
            if ( $PSBoundParameters.ContainsKey('respondercert') ) { $payload.Add('respondercert', $respondercert) }
            if ( $PSBoundParameters.ContainsKey('producedattimeskew') ) { $payload.Add('producedattimeskew', $producedattimeskew) }
            if ( $PSBoundParameters.ContainsKey('signingcert') ) { $payload.Add('signingcert', $signingcert) }
            if ( $PSBoundParameters.ContainsKey('usenonce') ) { $payload.Add('usenonce', $usenonce) }
            if ( $PSBoundParameters.ContainsKey('httpmethod') ) { $payload.Add('httpmethod', $httpmethod) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslocspresponder -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslocspresponder: Finished"
    }
}

function Invoke-NSGetSslocspresponder {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for OCSP responser resource.
    .PARAMETER Name
        Name for the OCSP responder. Cannot begin with a hash (#) or space character and must contain only ASCII alphanumeric, underscore (_), hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the responder is created.
    .PARAMETER GetAll
        Retrieve all sslocspresponder object(s).
    .PARAMETER Count
        If specified, the count of the sslocspresponder object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslocspresponder
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslocspresponder -GetAll
        Get all sslocspresponder data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslocspresponder -Count
        Get the number of sslocspresponder objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslocspresponder -name <string>
        Get sslocspresponder object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslocspresponder -Filter @{ 'name'='<value>' }
        Get sslocspresponder data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslocspresponder
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslocspresponder/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslocspresponder: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslocspresponder objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslocspresponder -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslocspresponder objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslocspresponder -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslocspresponder objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslocspresponder -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslocspresponder configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslocspresponder -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslocspresponder configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslocspresponder -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslocspresponder: Ended"
    }
}

function Invoke-NSUpdateSslparameter {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL parameter resource.
    .PARAMETER Quantumsize
        Amount of data to collect before the data is pushed to the crypto hardware for encryption. For large downloads, a larger quantum size better utilizes the crypto resources.
          
        Possible values = 4096, 8192, 16384
    .PARAMETER Crlmemorysizemb
        Maximum memory size to use for certificate revocation lists (CRLs). This parameter reserves memory for a CRL but sets a limit to the maximum memory that the CRLs loaded on the appliance can consume.
          
          
        Maximum value = 1024
    .PARAMETER Strictcachecks
        Enable strict CA certificate checks on the appliance.
          
        Possible values = YES, NO
    .PARAMETER Ssltriggertimeout
        Time, in milliseconds, after which encryption is triggered for transactions that are not tracked on the Citrix ADC because their length is not known. There can be a delay of up to 10ms from the specified timeout value before the packet is pushed into the queue.
          
          
        Maximum value = 200
    .PARAMETER Sendclosenotify
        Send an SSL Close-Notify message to the client at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Encrypttriggerpktcount
        Maximum number of queued packets after which encryption is triggered. Use this setting for SSL transactions that send small packets from server to Citrix ADC.
          
          
        Maximum value = 50
    .PARAMETER Denysslreneg
        Deny renegotiation in specified circumstances. Available settings function as follows:
        * NO - Allow SSL renegotiation.
        * FRONTEND_CLIENT - Deny secure and nonsecure SSL renegotiation initiated by the client.
        * FRONTEND_CLIENTSERVER - Deny secure and nonsecure SSL renegotiation initiated by the client or the Citrix ADC during policy-based client authentication.
        * ALL - Deny all secure and nonsecure SSL renegotiation.
        * NONSECURE - Deny nonsecure SSL renegotiation. Allows only clients that support RFC 5746.
          
        Possible values = NO, FRONTEND_CLIENT, FRONTEND_CLIENTSERVER, ALL, NONSECURE
    .PARAMETER Insertionencoding
        Encoding method used to insert the subject or issuer's name in HTTP requests to servers.
          
        Possible values = Unicode, UTF-8
    .PARAMETER Ocspcachesize
        Size, per packet engine, in megabytes, of the OCSP cache. A maximum of 10% of the packet engine memory can be assigned. Because the maximum allowed packet engine memory is 4GB, the maximum value that can be assigned to the OCSP cache is approximately 410 MB.
          
          
        Maximum value = 512
    .PARAMETER Pushflag
        Insert PUSH flag into decrypted, encrypted, or all records. If the PUSH flag is set to a value other than 0, the buffered records are forwarded on the basis of the value of the PUSH flag. Available settings function as follows:
        0 - Auto (PUSH flag is not set.)
        1 - Insert PUSH flag into every decrypted record.
        2 -Insert PUSH flag into every encrypted record.
        3 - Insert PUSH flag into every decrypted and encrypted record.
          
        Maximum value = 3
    .PARAMETER Dropreqwithnohostheader
        Host header check for SNI enabled sessions. If this check is enabled and the HTTP request does not contain the host header for SNI enabled sessions(i.e vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension), the request is dropped.
          
        Possible values = YES, NO
    .PARAMETER Snihttphostmatch
        Controls how the HTTP 'Host' header value is validated. These checks are performed only if the session is SNI enabled (i.e when vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension) and HTTP request contains 'Host' header.
        Available settings function as follows:
        CERT - Request is forwarded if the 'Host' value is covered
        by the certificate used to establish this SSL session.
        Note: 'CERT' matching mode cannot be applied in
        TLS 1.3 connections established by resuming from a
        previous TLS 1.3 session. On these connections, 'STRICT'
        matching mode will be used instead.
        STRICT - Request is forwarded only if value of 'Host' header
        in HTTP is identical to the 'Server name' value passed
        in 'Client Hello' of the SSL connection.
        NO - No validation is performed on the HTTP 'Host'
        header value.
          
        Possible values = NO, CERT, STRICT
    .PARAMETER Pushenctriggertimeout
        PUSH encryption trigger timeout value. The timeout value is applied only if you set the Push Encryption Trigger parameter to Timer in the SSL virtual server settings.
          
          
        Maximum value = 200
    .PARAMETER Cryptodevdisablelimit
        Limit to the number of disabled SSL chips after which the ADC restarts. A value of zero implies that the ADC does not automatically restart.
    .PARAMETER Undefactioncontrol
        Name of the undefined built-in control action: CLIENTAUTH, NOCLIENTAUTH, NOOP, RESET, or DROP.
    .PARAMETER Undefactiondata
        Name of the undefined built-in data action: NOOP, RESET or DROP.
    .PARAMETER Defaultprofile
        Global parameter used to enable default profile feature.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Softwarecryptothreshold
        Citrix ADC CPU utilization threshold (in percentage) beyond which crypto operations are not done in software.
        A value of zero implies that CPU is not utilized for doing crypto in software.
          
          
        Maximum value = 100
    .PARAMETER Hybridfipsmode
        When this mode is enabled, system will use additional crypto hardware to accelerate symmetric crypto operations.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sigdigesttype
        Signature Digest Algorithms that are supported by appliance. Default value is "ALL" and it will enable the following algorithms depending on the platform.
        On VPX: ECDSA-SHA1 ECDSA-SHA224 ECDSA-SHA256 ECDSA-SHA384 ECDSA-SHA512 RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512 DSA-SHA1 DSA-SHA224 DSA-SHA256 DSA-SHA384 DSA-SHA512
        On MPX with Nitrox-III and coleto cards: RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512 ECDSA-SHA1 ECDSA-SHA224 ECDSA-SHA256 ECDSA-SHA384 ECDSA-SHA512
        Others: RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512.
        Note:ALL doesnot include RSA-MD5 for any platform.
          
          
        Possible values = ALL, RSA-MD5, RSA-SHA1, RSA-SHA224, RSA-SHA256, RSA-SHA384, RSA-SHA512, DSA-SHA1, DSA-SHA224, DSA-SHA256, DSA-SHA384, DSA-SHA512, ECDSA-SHA1, ECDSA-SHA224, ECDSA-SHA256, ECDSA-SHA384, ECDSA-SHA512
    .PARAMETER Sslierrorcache
        Enable or disable dynamically learning and caching the learned information to make the subsequent interception or bypass decision. When enabled, NS does the lookup of this cached data to do early bypass.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslimaxerrorcachemem
        Specify the maximum memory that can be used for caching the learned data. This memory is used as a LRU cache so that the old entries gets replaced with new entry once the set memory limit is fully utilised. A value of 0 decides the limit automatically.
          
          
        Maximum value = 4294967294
    .PARAMETER Insertcertspace
        To insert space between lines in the certificate header of request.
          
        Possible values = YES, NO
    .PARAMETER Ndcppcompliancecertcheck
        Applies when the Citrix ADC appliance acts as a client (back-end connection).
        Settings apply as follows:
        YES - During certificate verification, ignore the common name if SAN is present in the certificate.
        NO - Do not ignore common name.
          
        Possible values = YES, NO
    .PARAMETER Heterogeneoussslhw
        To support both cavium and coleto based platforms in cluster environment, this mode has to be enabled.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Operationqueuelimit
        Limit in percentage of capacity of the crypto operations queue beyond which new SSL connections are not accepted until the queue is reduced.
          
          
        Maximum value = 10000
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslparameter
        An example how to update sslparameter config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslparameter
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslparameter/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateSet('4096', '8192', '16384')]
        [string]$Quantumsize,

        [double]$Crlmemorysizemb,

        [ValidateSet('YES', 'NO')]
        [string]$Strictcachecks,

        [double]$Ssltriggertimeout,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify,

        [double]$Encrypttriggerpktcount,

        [ValidateSet('NO', 'FRONTEND_CLIENT', 'FRONTEND_CLIENTSERVER', 'ALL', 'NONSECURE')]
        [string]$Denysslreneg,

        [ValidateSet('Unicode', 'UTF-8')]
        [string]$Insertionencoding,

        [double]$Ocspcachesize,

        [double]$Pushflag,

        [ValidateSet('YES', 'NO')]
        [string]$Dropreqwithnohostheader,

        [ValidateSet('NO', 'CERT', 'STRICT')]
        [string]$Snihttphostmatch,

        [double]$Pushenctriggertimeout,

        [double]$Cryptodevdisablelimit,

        [string]$Undefactioncontrol,

        [string]$Undefactiondata,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Defaultprofile,

        [double]$Softwarecryptothreshold,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Hybridfipsmode,

        [ValidateSet('ALL', 'RSA-MD5', 'RSA-SHA1', 'RSA-SHA224', 'RSA-SHA256', 'RSA-SHA384', 'RSA-SHA512', 'DSA-SHA1', 'DSA-SHA224', 'DSA-SHA256', 'DSA-SHA384', 'DSA-SHA512', 'ECDSA-SHA1', 'ECDSA-SHA224', 'ECDSA-SHA256', 'ECDSA-SHA384', 'ECDSA-SHA512')]
        [string[]]$Sigdigesttype,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslierrorcache,

        [double]$Sslimaxerrorcachemem,

        [ValidateSet('YES', 'NO')]
        [string]$Insertcertspace,

        [ValidateSet('YES', 'NO')]
        [string]$Ndcppcompliancecertcheck,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Heterogeneoussslhw,

        [double]$Operationqueuelimit 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslparameter: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('quantumsize') ) { $payload.Add('quantumsize', $quantumsize) }
            if ( $PSBoundParameters.ContainsKey('crlmemorysizemb') ) { $payload.Add('crlmemorysizemb', $crlmemorysizemb) }
            if ( $PSBoundParameters.ContainsKey('strictcachecks') ) { $payload.Add('strictcachecks', $strictcachecks) }
            if ( $PSBoundParameters.ContainsKey('ssltriggertimeout') ) { $payload.Add('ssltriggertimeout', $ssltriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('encrypttriggerpktcount') ) { $payload.Add('encrypttriggerpktcount', $encrypttriggerpktcount) }
            if ( $PSBoundParameters.ContainsKey('denysslreneg') ) { $payload.Add('denysslreneg', $denysslreneg) }
            if ( $PSBoundParameters.ContainsKey('insertionencoding') ) { $payload.Add('insertionencoding', $insertionencoding) }
            if ( $PSBoundParameters.ContainsKey('ocspcachesize') ) { $payload.Add('ocspcachesize', $ocspcachesize) }
            if ( $PSBoundParameters.ContainsKey('pushflag') ) { $payload.Add('pushflag', $pushflag) }
            if ( $PSBoundParameters.ContainsKey('dropreqwithnohostheader') ) { $payload.Add('dropreqwithnohostheader', $dropreqwithnohostheader) }
            if ( $PSBoundParameters.ContainsKey('snihttphostmatch') ) { $payload.Add('snihttphostmatch', $snihttphostmatch) }
            if ( $PSBoundParameters.ContainsKey('pushenctriggertimeout') ) { $payload.Add('pushenctriggertimeout', $pushenctriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('cryptodevdisablelimit') ) { $payload.Add('cryptodevdisablelimit', $cryptodevdisablelimit) }
            if ( $PSBoundParameters.ContainsKey('undefactioncontrol') ) { $payload.Add('undefactioncontrol', $undefactioncontrol) }
            if ( $PSBoundParameters.ContainsKey('undefactiondata') ) { $payload.Add('undefactiondata', $undefactiondata) }
            if ( $PSBoundParameters.ContainsKey('defaultprofile') ) { $payload.Add('defaultprofile', $defaultprofile) }
            if ( $PSBoundParameters.ContainsKey('softwarecryptothreshold') ) { $payload.Add('softwarecryptothreshold', $softwarecryptothreshold) }
            if ( $PSBoundParameters.ContainsKey('hybridfipsmode') ) { $payload.Add('hybridfipsmode', $hybridfipsmode) }
            if ( $PSBoundParameters.ContainsKey('sigdigesttype') ) { $payload.Add('sigdigesttype', $sigdigesttype) }
            if ( $PSBoundParameters.ContainsKey('sslierrorcache') ) { $payload.Add('sslierrorcache', $sslierrorcache) }
            if ( $PSBoundParameters.ContainsKey('sslimaxerrorcachemem') ) { $payload.Add('sslimaxerrorcachemem', $sslimaxerrorcachemem) }
            if ( $PSBoundParameters.ContainsKey('insertcertspace') ) { $payload.Add('insertcertspace', $insertcertspace) }
            if ( $PSBoundParameters.ContainsKey('ndcppcompliancecertcheck') ) { $payload.Add('ndcppcompliancecertcheck', $ndcppcompliancecertcheck) }
            if ( $PSBoundParameters.ContainsKey('heterogeneoussslhw') ) { $payload.Add('heterogeneoussslhw', $heterogeneoussslhw) }
            if ( $PSBoundParameters.ContainsKey('operationqueuelimit') ) { $payload.Add('operationqueuelimit', $operationqueuelimit) }
            if ( $PSCmdlet.ShouldProcess("sslparameter", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslparameter -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslparameter: Finished"
    }
}

function Invoke-NSUnsetSslparameter {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL parameter resource.
    .PARAMETER Quantumsize
        Amount of data to collect before the data is pushed to the crypto hardware for encryption. For large downloads, a larger quantum size better utilizes the crypto resources.
          
        Possible values = 4096, 8192, 16384
    .PARAMETER Crlmemorysizemb
        Maximum memory size to use for certificate revocation lists (CRLs). This parameter reserves memory for a CRL but sets a limit to the maximum memory that the CRLs loaded on the appliance can consume.
          
          
        Maximum value = 1024
    .PARAMETER Strictcachecks
        Enable strict CA certificate checks on the appliance.
          
        Possible values = YES, NO
    .PARAMETER Ssltriggertimeout
        Time, in milliseconds, after which encryption is triggered for transactions that are not tracked on the Citrix ADC because their length is not known. There can be a delay of up to 10ms from the specified timeout value before the packet is pushed into the queue.
          
          
        Maximum value = 200
    .PARAMETER Sendclosenotify
        Send an SSL Close-Notify message to the client at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Encrypttriggerpktcount
        Maximum number of queued packets after which encryption is triggered. Use this setting for SSL transactions that send small packets from server to Citrix ADC.
          
          
        Maximum value = 50
    .PARAMETER Denysslreneg
        Deny renegotiation in specified circumstances. Available settings function as follows:
        * NO - Allow SSL renegotiation.
        * FRONTEND_CLIENT - Deny secure and nonsecure SSL renegotiation initiated by the client.
        * FRONTEND_CLIENTSERVER - Deny secure and nonsecure SSL renegotiation initiated by the client or the Citrix ADC during policy-based client authentication.
        * ALL - Deny all secure and nonsecure SSL renegotiation.
        * NONSECURE - Deny nonsecure SSL renegotiation. Allows only clients that support RFC 5746.
          
        Possible values = NO, FRONTEND_CLIENT, FRONTEND_CLIENTSERVER, ALL, NONSECURE
    .PARAMETER Insertionencoding
        Encoding method used to insert the subject or issuer's name in HTTP requests to servers.
          
        Possible values = Unicode, UTF-8
    .PARAMETER Ocspcachesize
        Size, per packet engine, in megabytes, of the OCSP cache. A maximum of 10% of the packet engine memory can be assigned. Because the maximum allowed packet engine memory is 4GB, the maximum value that can be assigned to the OCSP cache is approximately 410 MB.
          
          
        Maximum value = 512
    .PARAMETER Pushflag
        Insert PUSH flag into decrypted, encrypted, or all records. If the PUSH flag is set to a value other than 0, the buffered records are forwarded on the basis of the value of the PUSH flag. Available settings function as follows:
        0 - Auto (PUSH flag is not set.)
        1 - Insert PUSH flag into every decrypted record.
        2 -Insert PUSH flag into every encrypted record.
        3 - Insert PUSH flag into every decrypted and encrypted record.
          
        Maximum value = 3
    .PARAMETER Dropreqwithnohostheader
        Host header check for SNI enabled sessions. If this check is enabled and the HTTP request does not contain the host header for SNI enabled sessions(i.e vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension), the request is dropped.
          
        Possible values = YES, NO
    .PARAMETER Snihttphostmatch
        Controls how the HTTP 'Host' header value is validated. These checks are performed only if the session is SNI enabled (i.e when vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension) and HTTP request contains 'Host' header.
        Available settings function as follows:
        CERT - Request is forwarded if the 'Host' value is covered
        by the certificate used to establish this SSL session.
        Note: 'CERT' matching mode cannot be applied in
        TLS 1.3 connections established by resuming from a
        previous TLS 1.3 session. On these connections, 'STRICT'
        matching mode will be used instead.
        STRICT - Request is forwarded only if value of 'Host' header
        in HTTP is identical to the 'Server name' value passed
        in 'Client Hello' of the SSL connection.
        NO - No validation is performed on the HTTP 'Host'
        header value.
          
        Possible values = NO, CERT, STRICT
    .PARAMETER Pushenctriggertimeout
        PUSH encryption trigger timeout value. The timeout value is applied only if you set the Push Encryption Trigger parameter to Timer in the SSL virtual server settings.
          
          
        Maximum value = 200
    .PARAMETER Cryptodevdisablelimit
        Limit to the number of disabled SSL chips after which the ADC restarts. A value of zero implies that the ADC does not automatically restart.
    .PARAMETER Undefactioncontrol
        Name of the undefined built-in control action: CLIENTAUTH, NOCLIENTAUTH, NOOP, RESET, or DROP.
    .PARAMETER Undefactiondata
        Name of the undefined built-in data action: NOOP, RESET or DROP.
    .PARAMETER Defaultprofile
        Global parameter used to enable default profile feature.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Softwarecryptothreshold
        Citrix ADC CPU utilization threshold (in percentage) beyond which crypto operations are not done in software.
        A value of zero implies that CPU is not utilized for doing crypto in software.
          
          
        Maximum value = 100
    .PARAMETER Hybridfipsmode
        When this mode is enabled, system will use additional crypto hardware to accelerate symmetric crypto operations.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sigdigesttype
        Signature Digest Algorithms that are supported by appliance. Default value is "ALL" and it will enable the following algorithms depending on the platform.
        On VPX: ECDSA-SHA1 ECDSA-SHA224 ECDSA-SHA256 ECDSA-SHA384 ECDSA-SHA512 RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512 DSA-SHA1 DSA-SHA224 DSA-SHA256 DSA-SHA384 DSA-SHA512
        On MPX with Nitrox-III and coleto cards: RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512 ECDSA-SHA1 ECDSA-SHA224 ECDSA-SHA256 ECDSA-SHA384 ECDSA-SHA512
        Others: RSA-SHA1 RSA-SHA224 RSA-SHA256 RSA-SHA384 RSA-SHA512.
        Note:ALL doesnot include RSA-MD5 for any platform.
          
          
        Possible values = ALL, RSA-MD5, RSA-SHA1, RSA-SHA224, RSA-SHA256, RSA-SHA384, RSA-SHA512, DSA-SHA1, DSA-SHA224, DSA-SHA256, DSA-SHA384, DSA-SHA512, ECDSA-SHA1, ECDSA-SHA224, ECDSA-SHA256, ECDSA-SHA384, ECDSA-SHA512
    .PARAMETER Sslierrorcache
        Enable or disable dynamically learning and caching the learned information to make the subsequent interception or bypass decision. When enabled, NS does the lookup of this cached data to do early bypass.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslimaxerrorcachemem
        Specify the maximum memory that can be used for caching the learned data. This memory is used as a LRU cache so that the old entries gets replaced with new entry once the set memory limit is fully utilised. A value of 0 decides the limit automatically.
          
          
        Maximum value = 4294967294
    .PARAMETER Insertcertspace
        To insert space between lines in the certificate header of request.
          
        Possible values = YES, NO
    .PARAMETER Ndcppcompliancecertcheck
        Applies when the Citrix ADC appliance acts as a client (back-end connection).
        Settings apply as follows:
        YES - During certificate verification, ignore the common name if SAN is present in the certificate.
        NO - Do not ignore common name.
          
        Possible values = YES, NO
    .PARAMETER Heterogeneoussslhw
        To support both cavium and coleto based platforms in cluster environment, this mode has to be enabled.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Operationqueuelimit
        Limit in percentage of capacity of the crypto operations queue beyond which new SSL connections are not accepted until the queue is reduced.
          
          
        Maximum value = 10000
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslparameter
        An example how to unset sslparameter config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslparameter
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslparameter
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Boolean]$quantumsize,

        [Boolean]$crlmemorysizemb,

        [Boolean]$strictcachecks,

        [Boolean]$ssltriggertimeout,

        [Boolean]$sendclosenotify,

        [Boolean]$encrypttriggerpktcount,

        [Boolean]$denysslreneg,

        [Boolean]$insertionencoding,

        [Boolean]$ocspcachesize,

        [Boolean]$pushflag,

        [Boolean]$dropreqwithnohostheader,

        [Boolean]$snihttphostmatch,

        [Boolean]$pushenctriggertimeout,

        [Boolean]$cryptodevdisablelimit,

        [Boolean]$undefactioncontrol,

        [Boolean]$undefactiondata,

        [Boolean]$defaultprofile,

        [Boolean]$softwarecryptothreshold,

        [Boolean]$hybridfipsmode,

        [Boolean]$sigdigesttype,

        [Boolean]$sslierrorcache,

        [Boolean]$sslimaxerrorcachemem,

        [Boolean]$insertcertspace,

        [Boolean]$ndcppcompliancecertcheck,

        [Boolean]$heterogeneoussslhw,

        [Boolean]$operationqueuelimit 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslparameter: Starting"
    }
    process {
        try {
            $payload = @{ }
            if ( $PSBoundParameters.ContainsKey('quantumsize') ) { $payload.Add('quantumsize', $quantumsize) }
            if ( $PSBoundParameters.ContainsKey('crlmemorysizemb') ) { $payload.Add('crlmemorysizemb', $crlmemorysizemb) }
            if ( $PSBoundParameters.ContainsKey('strictcachecks') ) { $payload.Add('strictcachecks', $strictcachecks) }
            if ( $PSBoundParameters.ContainsKey('ssltriggertimeout') ) { $payload.Add('ssltriggertimeout', $ssltriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('encrypttriggerpktcount') ) { $payload.Add('encrypttriggerpktcount', $encrypttriggerpktcount) }
            if ( $PSBoundParameters.ContainsKey('denysslreneg') ) { $payload.Add('denysslreneg', $denysslreneg) }
            if ( $PSBoundParameters.ContainsKey('insertionencoding') ) { $payload.Add('insertionencoding', $insertionencoding) }
            if ( $PSBoundParameters.ContainsKey('ocspcachesize') ) { $payload.Add('ocspcachesize', $ocspcachesize) }
            if ( $PSBoundParameters.ContainsKey('pushflag') ) { $payload.Add('pushflag', $pushflag) }
            if ( $PSBoundParameters.ContainsKey('dropreqwithnohostheader') ) { $payload.Add('dropreqwithnohostheader', $dropreqwithnohostheader) }
            if ( $PSBoundParameters.ContainsKey('snihttphostmatch') ) { $payload.Add('snihttphostmatch', $snihttphostmatch) }
            if ( $PSBoundParameters.ContainsKey('pushenctriggertimeout') ) { $payload.Add('pushenctriggertimeout', $pushenctriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('cryptodevdisablelimit') ) { $payload.Add('cryptodevdisablelimit', $cryptodevdisablelimit) }
            if ( $PSBoundParameters.ContainsKey('undefactioncontrol') ) { $payload.Add('undefactioncontrol', $undefactioncontrol) }
            if ( $PSBoundParameters.ContainsKey('undefactiondata') ) { $payload.Add('undefactiondata', $undefactiondata) }
            if ( $PSBoundParameters.ContainsKey('defaultprofile') ) { $payload.Add('defaultprofile', $defaultprofile) }
            if ( $PSBoundParameters.ContainsKey('softwarecryptothreshold') ) { $payload.Add('softwarecryptothreshold', $softwarecryptothreshold) }
            if ( $PSBoundParameters.ContainsKey('hybridfipsmode') ) { $payload.Add('hybridfipsmode', $hybridfipsmode) }
            if ( $PSBoundParameters.ContainsKey('sigdigesttype') ) { $payload.Add('sigdigesttype', $sigdigesttype) }
            if ( $PSBoundParameters.ContainsKey('sslierrorcache') ) { $payload.Add('sslierrorcache', $sslierrorcache) }
            if ( $PSBoundParameters.ContainsKey('sslimaxerrorcachemem') ) { $payload.Add('sslimaxerrorcachemem', $sslimaxerrorcachemem) }
            if ( $PSBoundParameters.ContainsKey('insertcertspace') ) { $payload.Add('insertcertspace', $insertcertspace) }
            if ( $PSBoundParameters.ContainsKey('ndcppcompliancecertcheck') ) { $payload.Add('ndcppcompliancecertcheck', $ndcppcompliancecertcheck) }
            if ( $PSBoundParameters.ContainsKey('heterogeneoussslhw') ) { $payload.Add('heterogeneoussslhw', $heterogeneoussslhw) }
            if ( $PSBoundParameters.ContainsKey('operationqueuelimit') ) { $payload.Add('operationqueuelimit', $operationqueuelimit) }
            if ( $PSCmdlet.ShouldProcess("sslparameter", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslparameter -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslparameter: Finished"
    }
}

function Invoke-NSGetSslparameter {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL parameter resource.
    .PARAMETER GetAll
        Retrieve all sslparameter object(s).
    .PARAMETER Count
        If specified, the count of the sslparameter object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslparameter
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslparameter -GetAll
        Get all sslparameter data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslparameter -name <string>
        Get sslparameter object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslparameter -Filter @{ 'name'='<value>' }
        Get sslparameter data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslparameter
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslparameter/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslparameter: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslparameter objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslparameter -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslparameter objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslparameter -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslparameter objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslparameter -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslparameter configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslparameter configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslparameter -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslparameter: Ended"
    }
}

function Invoke-NSConvertSslpkcs12 {
    <#
    .SYNOPSIS
        Convert SSL Configuration config Object.
    .DESCRIPTION
        Configuration for pkcs12 resource.
    .PARAMETER Outfile
        Name for and, optionally, path to, the output file that contains the certificate and the private key after converting from PKCS#12 to PEM format. /nsconfig/ssl/ is the default path.
        If importing, the certificate-key pair is stored in PEM format. If exporting, the certificate-key pair is stored in PKCS#12 format.
    .PARAMETER Import
        Convert the certificate and private-key from PKCS#12 format to PEM format.
    .PARAMETER Pkcs12file
        Name for and, optionally, path to, the PKCS#12 file. If importing, specify the input file name that contains the certificate and the private key in PKCS#12 format. If exporting, specify the output file name that contains the certificate and the private key after converting from PEM to
        PKCS#12 format. /nsconfig/ssl/ is the default path.
        During the import operation, if the key is encrypted, you are prompted to enter the pass phrase used for encrypting the key.
    .PARAMETER Des
        Encrypt the private key by using the DES algorithm in CBC mode during the import operation. On the command line, you are prompted to enter the pass phrase.
    .PARAMETER Des3
        Encrypt the private key by using the Triple-DES algorithm in EDE CBC mode (168-bit key) during the import operation. On the command line, you are prompted to enter the pass phrase.
    .PARAMETER Aes256
        Encrypt the private key by using the AES algorithm (256-bit key) during the import operation. On the command line, you are prompted to enter the pass phrase.
    .PARAMETER Export
        Convert the certificate and private key from PEM format to PKCS#12 format. On the command line, you are prompted to enter the pass phrase.
    .PARAMETER Certfile
        Certificate file to be converted from PEM to PKCS#12 format.
    .PARAMETER Keyfile
        Name of the private key file to be converted from PEM to PKCS#12 format. If the key file is encrypted, you are prompted to enter the pass phrase used for encrypting the key.
    .PARAMETER Password
        .
    .PARAMETER Pempassphrase
        .
    .EXAMPLE
        PS C:\>Invoke-NSConvertSslpkcs12 -outfile <string> -password <string>
        An example how to convert sslpkcs12 config Object(s).
    .NOTES
        File Name : Invoke-NSConvertSslpkcs12
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpkcs12/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Outfile,

        [boolean]$Import,

        [string]$Pkcs12file,

        [boolean]$Des,

        [boolean]$Des3,

        [boolean]$Aes256,

        [boolean]$Export,

        [string]$Certfile,

        [string]$Keyfile,

        [Parameter(Mandatory)]
        [ValidateLength(1, 31)]
        [string]$Password,

        [ValidateLength(1, 31)]
        [string]$Pempassphrase 

    )
    begin {
        Write-Verbose "Invoke-NSConvertSslpkcs12: Starting"
    }
    process {
        try {
            $payload = @{ outfile = $outfile
                password          = $password
            }
            if ( $PSBoundParameters.ContainsKey('Import') ) { $payload.Add('Import', $Import) }
            if ( $PSBoundParameters.ContainsKey('pkcs12file') ) { $payload.Add('pkcs12file', $pkcs12file) }
            if ( $PSBoundParameters.ContainsKey('des') ) { $payload.Add('des', $des) }
            if ( $PSBoundParameters.ContainsKey('des3') ) { $payload.Add('des3', $des3) }
            if ( $PSBoundParameters.ContainsKey('aes256') ) { $payload.Add('aes256', $aes256) }
            if ( $PSBoundParameters.ContainsKey('export') ) { $payload.Add('export', $export) }
            if ( $PSBoundParameters.ContainsKey('certfile') ) { $payload.Add('certfile', $certfile) }
            if ( $PSBoundParameters.ContainsKey('keyfile') ) { $payload.Add('keyfile', $keyfile) }
            if ( $PSBoundParameters.ContainsKey('pempassphrase') ) { $payload.Add('pempassphrase', $pempassphrase) }
            if ( $PSCmdlet.ShouldProcess($Name, "Convert SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslpkcs12 -Action convert -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSConvertSslpkcs12: Finished"
    }
}

function Invoke-NSConvertSslpkcs8 {
    <#
    .SYNOPSIS
        Convert SSL Configuration config Object.
    .DESCRIPTION
        Configuration for pkcs8 resource.
    .PARAMETER Pkcs8file
        Name for and, optionally, path to, the output file where the PKCS#8 format key file is stored. /nsconfig/ssl/ is the default path.
    .PARAMETER Keyfile
        Name of and, optionally, path to the input key file to be converted from PEM or DER format to PKCS#8 format. /nsconfig/ssl/ is the default path.
    .PARAMETER Keyform
        Format in which the key file is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Password
        Password to assign to the file if the key is encrypted. Applies only for PEM format files.
    .EXAMPLE
        PS C:\>Invoke-NSConvertSslpkcs8 -pkcs8file <string> -keyfile <string>
        An example how to convert sslpkcs8 config Object(s).
    .NOTES
        File Name : Invoke-NSConvertSslpkcs8
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpkcs8/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Pkcs8file,

        [Parameter(Mandatory)]
        [string]$Keyfile,

        [ValidateSet('DER', 'PEM')]
        [string]$Keyform,

        [ValidateLength(1, 31)]
        [string]$Password 

    )
    begin {
        Write-Verbose "Invoke-NSConvertSslpkcs8: Starting"
    }
    process {
        try {
            $payload = @{ pkcs8file = $pkcs8file
                keyfile             = $keyfile
            }
            if ( $PSBoundParameters.ContainsKey('keyform') ) { $payload.Add('keyform', $keyform) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSCmdlet.ShouldProcess($Name, "Convert SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslpkcs8 -Action convert -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSConvertSslpkcs8: Finished"
    }
}

function Invoke-NSAddSslpolicy {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy resource.
    .PARAMETER Name
        Name for the new SSL policy. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy is created.
    .PARAMETER Rule
        Expression, against which traffic is evaluated.
          
        The following requirements apply only to the Citrix ADC CLI:
        * If the expression includes one or more spaces, enclose the entire expression in double quotation marks.
        * If the expression itself includes double quotation marks, escape the quotations by using the character.
        * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks.
    .PARAMETER Reqaction
        The name of the action to be performed on the request. Refer to 'add ssl action' command to add a new action. Builtin actions like NOOP, RESET, DROP, CLIENTAUTH and NOCLIENTAUTH are also allowed.
    .PARAMETER Action
        Name of the built-in or user-defined action to perform on the request. Available built-in actions are NOOP, RESET, DROP, CLIENTAUTH, NOCLIENTAUTH, INTERCEPT AND BYPASS.
    .PARAMETER Undefaction
        Name of the action to be performed when the result of rule evaluation is undefined. Possible values for control policies: CLIENTAUTH, NOCLIENTAUTH, NOOP, RESET, DROP. Possible values for data policies: NOOP, RESET, DROP and BYPASS.
    .PARAMETER Comment
        Any comments associated with this policy.
    .PARAMETER PassThru
        Return details about the created sslpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslpolicy -name <string> -rule <string>
        An example how to add sslpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [Parameter(Mandatory)]
        [string]$Rule,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Reqaction,

        [string]$Action,

        [string]$Undefaction,

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
            }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("sslpolicy", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslpolicy -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslpolicy: Finished"
    }
}

function Invoke-NSDeleteSslpolicy {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy resource.
    .PARAMETER Name
        Name for the new SSL policy. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslpolicy -Name <string>
        An example how to delete sslpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslpolicy -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslpolicy: Finished"
    }
}

function Invoke-NSUpdateSslpolicy {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy resource.
    .PARAMETER Name
        Name for the new SSL policy. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy is created.
    .PARAMETER Rule
        Expression, against which traffic is evaluated.
          
        The following requirements apply only to the Citrix ADC CLI:
        * If the expression includes one or more spaces, enclose the entire expression in double quotation marks.
        * If the expression itself includes double quotation marks, escape the quotations by using the character.
        * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks.
    .PARAMETER Action
        Name of the built-in or user-defined action to perform on the request. Available built-in actions are NOOP, RESET, DROP, CLIENTAUTH, NOCLIENTAUTH, INTERCEPT AND BYPASS.
    .PARAMETER Undefaction
        Name of the action to be performed when the result of rule evaluation is undefined. Possible values for control policies: CLIENTAUTH, NOCLIENTAUTH, NOOP, RESET, DROP. Possible values for data policies: NOOP, RESET, DROP and BYPASS.
    .PARAMETER Comment
        Any comments associated with this policy.
    .PARAMETER PassThru
        Return details about the created sslpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslpolicy -name <string>
        An example how to update sslpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [string]$Rule,

        [string]$Action,

        [string]$Undefaction,

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("sslpolicy", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslpolicy -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslpolicy: Finished"
    }
}

function Invoke-NSUnsetSslpolicy {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy resource.
    .PARAMETER Name
        Name for the new SSL policy. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy is created.
    .PARAMETER Undefaction
        Name of the action to be performed when the result of rule evaluation is undefined. Possible values for control policies: CLIENTAUTH, NOCLIENTAUTH, NOOP, RESET, DROP. Possible values for data policies: NOOP, RESET, DROP and BYPASS.
    .PARAMETER Comment
        Any comments associated with this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslpolicy -name <string>
        An example how to unset sslpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [Boolean]$undefaction,

        [Boolean]$comment 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslpolicy -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslpolicy: Finished"
    }
}

function Invoke-NSGetSslpolicy {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL policy resource.
    .PARAMETER Name
        Name for the new SSL policy. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy is created.
    .PARAMETER GetAll
        Retrieve all sslpolicy object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicy -GetAll
        Get all sslpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicy -Count
        Get the number of sslpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicy -name <string>
        Get sslpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicy -Filter @{ 'name'='<value>' }
        Get sslpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicy: Ended"
    }
}

function Invoke-NSGetSslpolicyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyBinding -GetAll
        Get all sslpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyBinding -name <string>
        Get sslpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicyBinding: Ended"
    }
}

function Invoke-NSGetSslpolicyCsvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the csvserver that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_csvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_csvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyCsvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyCsvserverBinding -GetAll
        Get all sslpolicy_csvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyCsvserverBinding -Count
        Get the number of sslpolicy_csvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyCsvserverBinding -name <string>
        Get sslpolicy_csvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyCsvserverBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_csvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicyCsvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_csvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicyCsvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_csvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_csvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_csvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_csvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_csvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_csvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_csvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_csvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_csvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_csvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicyCsvserverBinding: Ended"
    }
}

function Invoke-NSGetSslpolicyLbvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the lbvserver that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_lbvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_lbvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyLbvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyLbvserverBinding -GetAll
        Get all sslpolicy_lbvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyLbvserverBinding -Count
        Get the number of sslpolicy_lbvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyLbvserverBinding -name <string>
        Get sslpolicy_lbvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicyLbvserverBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_lbvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicyLbvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_lbvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicyLbvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_lbvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_lbvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_lbvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_lbvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_lbvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_lbvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_lbvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_lbvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_lbvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_lbvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicyLbvserverBinding: Ended"
    }
}

function Invoke-NSGetSslpolicySslglobalBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslglobal that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_sslglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_sslglobal_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslglobalBinding -GetAll
        Get all sslpolicy_sslglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslglobalBinding -Count
        Get the number of sslpolicy_sslglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslglobalBinding -name <string>
        Get sslpolicy_sslglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslglobalBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_sslglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicySslglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_sslglobal_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicySslglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_sslglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_sslglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_sslglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_sslglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_sslglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslglobal_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicySslglobalBinding: Ended"
    }
}

function Invoke-NSGetSslpolicySslpolicylabelBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslpolicylabel that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_sslpolicylabel_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_sslpolicylabel_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslpolicylabelBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslpolicylabelBinding -GetAll
        Get all sslpolicy_sslpolicylabel_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslpolicylabelBinding -Count
        Get the number of sslpolicy_sslpolicylabel_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslpolicylabelBinding -name <string>
        Get sslpolicy_sslpolicylabel_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslpolicylabelBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_sslpolicylabel_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicySslpolicylabelBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_sslpolicylabel_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicySslpolicylabelBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_sslpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_sslpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_sslpolicylabel_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslpolicylabel_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_sslpolicylabel_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslpolicylabel_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_sslpolicylabel_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslpolicylabel_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicySslpolicylabelBinding: Ended"
    }
}

function Invoke-NSGetSslpolicySslserviceBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslservice that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_sslservice_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_sslservice_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslserviceBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslserviceBinding -GetAll
        Get all sslpolicy_sslservice_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslserviceBinding -Count
        Get the number of sslpolicy_sslservice_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslserviceBinding -name <string>
        Get sslpolicy_sslservice_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslserviceBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_sslservice_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicySslserviceBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_sslservice_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicySslserviceBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_sslservice_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslservice_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_sslservice_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslservice_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_sslservice_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslservice_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_sslservice_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslservice_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_sslservice_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslservice_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicySslserviceBinding: Ended"
    }
}

function Invoke-NSGetSslpolicySslvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslvserver that can be bound to sslpolicy.
    .PARAMETER Name
        Name of the SSL policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicy_sslvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicy_sslvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslvserverBinding -GetAll
        Get all sslpolicy_sslvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslvserverBinding -Count
        Get the number of sslpolicy_sslvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslvserverBinding -name <string>
        Get sslpolicy_sslvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicySslvserverBinding -Filter @{ 'name'='<value>' }
        Get sslpolicy_sslvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicySslvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicy_sslvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicySslvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicy_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicy_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicy_sslvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicy_sslvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicy_sslvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicy_sslvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicySslvserverBinding: Ended"
    }
}

function Invoke-NSAddSslpolicylabel {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy label resource.
    .PARAMETER Labelname
        Name for the SSL policy label. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy label is created.
    .PARAMETER Type
        Type of policies that the policy label can contain.
        Possible values = CONTROL, DATA, HTTPQUIC_CONTROL, HTTPQUIC_DATA
    .PARAMETER PassThru
        Return details about the created sslpolicylabel item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslpolicylabel -labelname <string> -type <string>
        An example how to add sslpolicylabel config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Labelname,

        [Parameter(Mandatory)]
        [ValidateSet('CONTROL', 'DATA', 'HTTPQUIC_CONTROL', 'HTTPQUIC_DATA')]
        [string]$Type,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslpolicylabel: Starting"
    }
    process {
        try {
            $payload = @{ labelname = $labelname
                type                = $type
            }

            if ( $PSCmdlet.ShouldProcess("sslpolicylabel", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslpolicylabel -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslpolicylabel -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslpolicylabel: Finished"
    }
}

function Invoke-NSDeleteSslpolicylabel {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL policy label resource.
    .PARAMETER Labelname
        Name for the SSL policy label. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy label is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslpolicylabel -Labelname <string>
        An example how to delete sslpolicylabel config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Labelname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslpolicylabel: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$labelname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslpolicylabel -NitroPath nitro/v1/config -Resource $labelname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslpolicylabel: Finished"
    }
}

function Invoke-NSGetSslpolicylabel {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL policy label resource.
    .PARAMETER Labelname
        Name for the SSL policy label. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the policy label is created.
    .PARAMETER GetAll
        Retrieve all sslpolicylabel object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicylabel object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabel
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabel -GetAll
        Get all sslpolicylabel data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabel -Count
        Get the number of sslpolicylabel objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabel -name <string>
        Get sslpolicylabel object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabel -Filter @{ 'name'='<value>' }
        Get sslpolicylabel data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Labelname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicylabel: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslpolicylabel objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicylabel objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicylabel objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicylabel configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicylabel configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicylabel: Ended"
    }
}

function Invoke-NSGetSslpolicylabelBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslpolicylabel.
    .PARAMETER Labelname
        Name of the SSL policy label for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslpolicylabel_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicylabel_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelBinding -GetAll
        Get all sslpolicylabel_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelBinding -name <string>
        Get sslpolicylabel_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelBinding -Filter @{ 'name'='<value>' }
        Get sslpolicylabel_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicylabelBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [string]$Labelname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicylabelBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicylabel_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicylabel_binding configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_binding -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicylabel_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicylabelBinding: Ended"
    }
}

function Invoke-NSAddSslpolicylabelSslpolicyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslpolicylabel.
    .PARAMETER Labelname
        Name of the SSL policy label to which to bind policies.
    .PARAMETER Policyname
        Name of the SSL policy to bind to the policy label.
    .PARAMETER Priority
        Specifies the priority of the policy.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Invoke
        Invoke policies bound to a policy label. After the invoked policies are evaluated, the flow returns to the policy with the next priority.
    .PARAMETER Labeltype
        Type of policy label invocation.
        Possible values = vserver, service, policylabel
    .PARAMETER Invoke_labelname
        Name of the label to invoke if the current policy rule evaluates to TRUE.
    .PARAMETER PassThru
        Return details about the created sslpolicylabel_sslpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslpolicylabelSslpolicyBinding -labelname <string> -policyname <string> -priority <double>
        An example how to add sslpolicylabel_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslpolicylabelSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Labelname,

        [Parameter(Mandatory)]
        [string]$Policyname,

        [Parameter(Mandatory)]
        [double]$Priority,

        [string]$Gotopriorityexpression,

        [boolean]$Invoke,

        [ValidateSet('vserver', 'service', 'policylabel')]
        [string]$Labeltype,

        [string]$Invoke_labelname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslpolicylabelSslpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ labelname = $labelname
                policyname          = $policyname
                priority            = $priority
            }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('invoke') ) { $payload.Add('invoke', $invoke) }
            if ( $PSBoundParameters.ContainsKey('labeltype') ) { $payload.Add('labeltype', $labeltype) }
            if ( $PSBoundParameters.ContainsKey('invoke_labelname') ) { $payload.Add('invoke_labelname', $invoke_labelname) }
            if ( $PSCmdlet.ShouldProcess("sslpolicylabel_sslpolicy_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslpolicylabel_sslpolicy_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslpolicylabelSslpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslpolicylabelSslpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteSslpolicylabelSslpolicyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslpolicylabel.
    .PARAMETER Labelname
        Name of the SSL policy label to which to bind policies.
    .PARAMETER Policyname
        Name of the SSL policy to bind to the policy label.
    .PARAMETER Priority
        Specifies the priority of the policy.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslpolicylabelSslpolicyBinding -Labelname <string>
        An example how to delete sslpolicylabel_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslpolicylabelSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Labelname,

        [string]$Policyname,

        [double]$Priority 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslpolicylabelSslpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) }
            if ( $PSBoundParameters.ContainsKey('Priority') ) { $arguments.Add('priority', $Priority) }
            if ( $PSCmdlet.ShouldProcess("$labelname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Resource $labelname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslpolicylabelSslpolicyBinding: Finished"
    }
}

function Invoke-NSGetSslpolicylabelSslpolicyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslpolicylabel.
    .PARAMETER Labelname
        Name of the SSL policy label to which to bind policies.
    .PARAMETER GetAll
        Retrieve all sslpolicylabel_sslpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslpolicylabel_sslpolicy_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelSslpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelSslpolicyBinding -GetAll
        Get all sslpolicylabel_sslpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelSslpolicyBinding -Count
        Get the number of sslpolicylabel_sslpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelSslpolicyBinding -name <string>
        Get sslpolicylabel_sslpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslpolicylabelSslpolicyBinding -Filter @{ 'name'='<value>' }
        Get sslpolicylabel_sslpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslpolicylabelSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslpolicylabel_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [string]$Labelname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslpolicylabelSslpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslpolicylabel_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslpolicylabel_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslpolicylabel_sslpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslpolicylabel_sslpolicy_binding configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslpolicylabel_sslpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslpolicylabel_sslpolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslpolicylabelSslpolicyBinding: Ended"
    }
}

function Invoke-NSAddSslprofile {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL profile resource.
    .PARAMETER Name
        Name for the SSL profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Sslprofiletype
        Type of profile. Front end profiles apply to the entity that receives requests from a client. Backend profiles apply to the entity that sends client requests to a server.
          
        Possible values = BackEnd, FrontEnd, QUIC-FrontEnd
    .PARAMETER Ssllogprofile
        The name of the ssllogprofile.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time.
        This parameter is not applicable when configuring a backend profile. Allowed DH count values are 0 and &gt;= 500.
          
        Maximum value = 65534
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        The file name and path for the DH parameter.
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        The refresh count for the re-generation of RSA public-key and private-key pair.
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        The Session timeout value in seconds.
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        The redirect URL to be used with the Cipher Redirect feature.
    .PARAMETER Clientauth
        State of client authentication. In service-based SSL offload, the service terminates the SSL handshake if the SSL client does not provide a valid certificate.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        The rule for client certificate requirement in client authentication.
        Possible values = Mandatory, Optional
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL service.
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is set to ENABLED, and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL profile.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Allowunknownsni
        Controls how the handshake is handled when the server name extension does not match any of the bound certificates. These checks are performed only if the session is SNI enabled (i.e. when profile bound to vserver has SNIEnable and Client Hello arrived with SNI extension). Available settings function as follows :
        ENABLED - handshakes with an unknown SNI are allowed to continue, if a default cert is bound.
        DISLABED - handshakes with an unknown SNI are not allowed to continue.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL Backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Pushenctrigger
        Trigger encryption on the basis of the PUSH flag value. Available settings function as follows:
        * ALWAYS - Any PUSH packet triggers encryption.
        * IGNORE - Ignore PUSH packet for triggering encryption.
        * MERGE - For a consecutive sequence of PUSH packets, the last PUSH packet triggers encryption.
        * TIMER - PUSH packet triggering encryption is delayed by the time defined in the set ssl parameter command or in the Change Advanced SSL Settings dialog box.
        Possible values = Always, Merge, Ignore, Timer
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Cleartextport
        Port on which clear-text data is sent by the appliance to the server. Do not specify this parameter for SSL offloading with end-to-end encryption.
    .PARAMETER Insertionencoding
        Encoding method used to insert the subject or issuer's name in HTTP requests to servers.
          
        Possible values = Unicode, UTF-8
    .PARAMETER Denysslreneg
        Deny renegotiation in specified circumstances. Available settings function as follows:
        * NO - Allow SSL renegotiation.
        * FRONTEND_CLIENT - Deny secure and nonsecure SSL renegotiation initiated by the client.
        * FRONTEND_CLIENTSERVER - Deny secure and nonsecure SSL renegotiation initiated by the client or the Citrix ADC during policy-based client authentication.
        * ALL - Deny all secure and nonsecure SSL renegotiation.
        * NONSECURE - Deny nonsecure SSL renegotiation. Allows only clients that support RFC 5746.
          
        Possible values = NO, FRONTEND_CLIENT, FRONTEND_CLIENTSERVER, ALL, NONSECURE
    .PARAMETER Maxrenegrate
        Maximum number of renegotiation requests allowed, in one second, to each SSL entity to which this profile is bound. When set to 0, an unlimited number of renegotiation requests are allowed. Applicable only when Deny SSL renegotiation is set to a value other than ALL.
          
          
        Maximum value = 65535
    .PARAMETER Quantumsize
        Amount of data to collect before the data is pushed to the crypto hardware for encryption. For large downloads, a larger quantum size better utilizes the crypto resources.
          
        Possible values = 4096, 8192, 16384
    .PARAMETER Strictcachecks
        Enable strict CA certificate checks on the appliance.
          
        Possible values = YES, NO
    .PARAMETER Encrypttriggerpktcount
        Maximum number of queued packets after which encryption is triggered. Use this setting for SSL transactions that send small packets from server to Citrix ADC.
          
          
        Maximum value = 50
    .PARAMETER Pushflag
        Insert PUSH flag into decrypted, encrypted, or all records. If the PUSH flag is set to a value other than 0, the buffered records are forwarded on the basis of the value of the PUSH flag. Available settings function as follows:
        0 - Auto (PUSH flag is not set.)
        1 - Insert PUSH flag into every decrypted record.
        2 -Insert PUSH flag into every encrypted record.
        3 - Insert PUSH flag into every decrypted and encrypted record.
          
        Maximum value = 3
    .PARAMETER Dropreqwithnohostheader
        Host header check for SNI enabled sessions. If this check is enabled and the HTTP request does not contain the host header for SNI enabled sessions(i.e vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension), the request is dropped.
          
        Possible values = YES, NO
    .PARAMETER Snihttphostmatch
        Controls how the HTTP 'Host' header value is validated. These checks are performed only if the session is SNI enabled (i.e when vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension) and HTTP request contains 'Host' header.
        Available settings function as follows:
        CERT - Request is forwarded if the 'Host' value is covered
        by the certificate used to establish this SSL session.
        Note: 'CERT' matching mode cannot be applied in
        TLS 1.3 connections established by resuming from a
        previous TLS 1.3 session. On these connections, 'STRICT'
        matching mode will be used instead.
        STRICT - Request is forwarded only if value of 'Host' header
        in HTTP is identical to the 'Server name' value passed
        in 'Client Hello' of the SSL connection.
        NO - No validation is performed on the HTTP 'Host'
        header value.
          
        Possible values = NO, CERT, STRICT
    .PARAMETER Pushenctriggertimeout
        PUSH encryption trigger timeout value. The timeout value is applied only if you set the Push Encryption Trigger parameter to Timer in the SSL virtual server settings.
          
          
        Maximum value = 200
    .PARAMETER Ssltriggertimeout
        Time, in milliseconds, after which encryption is triggered for transactions that are not tracked on the Citrix ADC because their length is not known. There can be a delay of up to 10ms from the specified timeout value before the packet is pushed into the queue.
          
          
        Maximum value = 200
    .PARAMETER Clientauthuseboundcachain
        Certficates bound on the VIP are used for validating the client cert. Certficates came along with client cert are not used for validating the client cert.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslinterception
        Enable or disable transparent interception of SSL sessions.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslireneg
        Enable or disable triggering the client renegotiation when renegotiation request is received from the origin server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssliocspcheck
        Enable or disable OCSP check for origin server certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslimaxsessperserver
        Maximum ssl session to be cached per dynamic origin server. A unique ssl session is created for each SNI received from the client on ClientHello and the matching session is used for server session reuse.
          
          
        Maximum value = 1000
    .PARAMETER Sessionticket
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketlifetime
        This option sets the life time of session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Sessionticketkeyrefresh
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketkeydata
        Session ticket enc/dec key, admin can set it.
    .PARAMETER Sessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 86400
    .PARAMETER Prevsessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Hsts
        State of HSTS protocol support for the SSL profile. Using HSTS, a server can enforce the use of an HTTPS connection for all communication with a client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxage
        Set the maximum time, in seconds, in the strict transport security (STS) header during which the client must send only HTTPS requests to the server.
          
          
        Maximum value = 4294967294
    .PARAMETER Includesubdomains
        Enable HSTS for subdomains. If set to Yes, a client must send only HTTPS requests for subdomains.
          
        Possible values = YES, NO
    .PARAMETER Preload
        Flag indicates the consent of the site owner to have their domain preloaded.
          
        Possible values = YES, NO
    .PARAMETER Skipclientcertpolicycheck
        This flag controls the processing of X509 certificate policies. If this option is Enabled, then the policy check in Client authentication will be skipped. This option can be used only when Client Authentication is Enabled and ClientCert is set to Mandatory.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Zerorttearlydata
        State of TLS 1.3 0-RTT early data support for the SSL Virtual Server. This setting only has an effect if resumption is enabled, as early data cannot be sent along with an initial handshake.
        Early application data has significantly different security properties - in particular there is no guarantee that the data cannot be replayed.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13sessionticketsperauthcontext
        Number of tickets the SSL Virtual Server will issue anytime TLS 1.3 is negotiated, ticket-based resumption is enabled, and either (1) a handshake completes or (2) post-handhsake client auth completes.
        This value can be increased to enable clients to open multiple parallel connections using a fresh ticket for each connection.
        No tickets are sent if resumption is disabled.
          
          
        Maximum value = 10
    .PARAMETER Dhekeyexchangewithpsk
        Whether or not the SSL Virtual Server will require a DHE key exchange to occur when a PSK is accepted during a TLS 1.3 resumption handshake.
        A DHE key exchange ensures forward secrecy even in the event that ticket keys are compromised, at the expense of an additional round trip and resources required to carry out the DHE key exchange.
        If disabled, a DHE key exchange will be performed when a PSK is accepted but only if requested by the client.
        If enabled, the server will require a DHE key exchange when a PSK is accepted regardless of whether the client supports combined PSK-DHE key exchange. This setting only has an effect when resumption is enabled.
          
        Possible values = YES, NO
    .PARAMETER Allowextendedmastersecret
        When set to YES, attempt to use the TLS Extended Master Secret (EMS, as
        described in RFC 7627) when negotiating TLS 1.0, TLS 1.1 and TLS 1.2
        connection parameters. EMS must be supported by both the TLS client and server
        in order to be enabled during a handshake. This setting applies to both
        frontend and backend SSL profiles.
          
        Possible values = YES, NO
    .PARAMETER Alpnprotocol
        Application protocol supported by the server and used in negotiation of the protocol with the client. Possible values are HTTP1.1, HTTP2 and NONE. Default value is NONE which implies application protocol is not enabled hence remain unknown to the TLS layer. This parameter is relevant only if SSL connection is handled by the virtual server of the type SSL_TCP.
          
        Possible values = NONE, HTTP1.1, HTTP2
    .PARAMETER PassThru
        Return details about the created sslprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslprofile -name <string>
        An example how to add sslprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateSet('BackEnd', 'FrontEnd', 'QUIC-FrontEnd')]
        [string]$Sslprofiletype = 'FrontEnd',

        [ValidateLength(1, 127)]
        [string]$Ssllogprofile,

        [double]$Dhcount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dh = 'DISABLED',

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Dhfile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ersa = 'ENABLED',

        [double]$Ersacount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessreuse = 'ENABLED',

        [double]$Sesstimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cipherredirect = 'DISABLED',

        [string]$Cipherurl,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauth = 'DISABLED',

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Clientcert,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dhkeyexpsizelimit = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslredirect = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Redirectportrewrite = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl3 = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls1 = 'ENABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls11 = 'ENABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls12 = 'ENABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls13 = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Snienable = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Allowunknownsni = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ocspstapling = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Serverauth = 'DISABLED',

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Commonname,

        [ValidateSet('Always', 'Merge', 'Ignore', 'Timer')]
        [string]$Pushenctrigger,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify = 'YES',

        [ValidateRange(1, 65535)]
        [int]$Cleartextport,

        [ValidateSet('Unicode', 'UTF-8')]
        [string]$Insertionencoding = 'Unicode',

        [ValidateSet('NO', 'FRONTEND_CLIENT', 'FRONTEND_CLIENTSERVER', 'ALL', 'NONSECURE')]
        [string]$Denysslreneg = 'ALL',

        [double]$Maxrenegrate = '0',

        [ValidateSet('4096', '8192', '16384')]
        [string]$Quantumsize = '8192',

        [ValidateSet('YES', 'NO')]
        [string]$Strictcachecks = 'NO',

        [double]$Encrypttriggerpktcount = '45',

        [double]$Pushflag,

        [ValidateSet('YES', 'NO')]
        [string]$Dropreqwithnohostheader = 'NO',

        [ValidateSet('NO', 'CERT', 'STRICT')]
        [string]$Snihttphostmatch = 'CERT',

        [double]$Pushenctriggertimeout = '1',

        [double]$Ssltriggertimeout = '100',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauthuseboundcachain = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslinterception = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslireneg = 'ENABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssliocspcheck = 'ENABLED',

        [double]$Sslimaxsessperserver = '10',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessionticket = 'DISABLED',

        [double]$Sessionticketlifetime = '300',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessionticketkeyrefresh = 'ENABLED',

        [string]$Sessionticketkeydata,

        [double]$Sessionkeylifetime = '3000',

        [double]$Prevsessionkeylifetime = '0',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Hsts = 'DISABLED',

        [double]$Maxage = '0',

        [ValidateSet('YES', 'NO')]
        [string]$Includesubdomains = 'NO',

        [ValidateSet('YES', 'NO')]
        [string]$Preload = 'NO',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Skipclientcertpolicycheck = 'DISABLED',

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Zerorttearlydata = 'DISABLED',

        [double]$Tls13sessionticketsperauthcontext = '1',

        [ValidateSet('YES', 'NO')]
        [string]$Dhekeyexchangewithpsk = 'NO',

        [ValidateSet('YES', 'NO')]
        [string]$Allowextendedmastersecret = 'NO',

        [ValidateSet('NONE', 'HTTP1.1', 'HTTP2')]
        [string]$Alpnprotocol = 'NONE',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('sslprofiletype') ) { $payload.Add('sslprofiletype', $sslprofiletype) }
            if ( $PSBoundParameters.ContainsKey('ssllogprofile') ) { $payload.Add('ssllogprofile', $ssllogprofile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('allowunknownsni') ) { $payload.Add('allowunknownsni', $allowunknownsni) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('pushenctrigger') ) { $payload.Add('pushenctrigger', $pushenctrigger) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('cleartextport') ) { $payload.Add('cleartextport', $cleartextport) }
            if ( $PSBoundParameters.ContainsKey('insertionencoding') ) { $payload.Add('insertionencoding', $insertionencoding) }
            if ( $PSBoundParameters.ContainsKey('denysslreneg') ) { $payload.Add('denysslreneg', $denysslreneg) }
            if ( $PSBoundParameters.ContainsKey('maxrenegrate') ) { $payload.Add('maxrenegrate', $maxrenegrate) }
            if ( $PSBoundParameters.ContainsKey('quantumsize') ) { $payload.Add('quantumsize', $quantumsize) }
            if ( $PSBoundParameters.ContainsKey('strictcachecks') ) { $payload.Add('strictcachecks', $strictcachecks) }
            if ( $PSBoundParameters.ContainsKey('encrypttriggerpktcount') ) { $payload.Add('encrypttriggerpktcount', $encrypttriggerpktcount) }
            if ( $PSBoundParameters.ContainsKey('pushflag') ) { $payload.Add('pushflag', $pushflag) }
            if ( $PSBoundParameters.ContainsKey('dropreqwithnohostheader') ) { $payload.Add('dropreqwithnohostheader', $dropreqwithnohostheader) }
            if ( $PSBoundParameters.ContainsKey('snihttphostmatch') ) { $payload.Add('snihttphostmatch', $snihttphostmatch) }
            if ( $PSBoundParameters.ContainsKey('pushenctriggertimeout') ) { $payload.Add('pushenctriggertimeout', $pushenctriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('ssltriggertimeout') ) { $payload.Add('ssltriggertimeout', $ssltriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('clientauthuseboundcachain') ) { $payload.Add('clientauthuseboundcachain', $clientauthuseboundcachain) }
            if ( $PSBoundParameters.ContainsKey('sslinterception') ) { $payload.Add('sslinterception', $sslinterception) }
            if ( $PSBoundParameters.ContainsKey('sslireneg') ) { $payload.Add('sslireneg', $sslireneg) }
            if ( $PSBoundParameters.ContainsKey('ssliocspcheck') ) { $payload.Add('ssliocspcheck', $ssliocspcheck) }
            if ( $PSBoundParameters.ContainsKey('sslimaxsessperserver') ) { $payload.Add('sslimaxsessperserver', $sslimaxsessperserver) }
            if ( $PSBoundParameters.ContainsKey('sessionticket') ) { $payload.Add('sessionticket', $sessionticket) }
            if ( $PSBoundParameters.ContainsKey('sessionticketlifetime') ) { $payload.Add('sessionticketlifetime', $sessionticketlifetime) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeyrefresh') ) { $payload.Add('sessionticketkeyrefresh', $sessionticketkeyrefresh) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeydata') ) { $payload.Add('sessionticketkeydata', $sessionticketkeydata) }
            if ( $PSBoundParameters.ContainsKey('sessionkeylifetime') ) { $payload.Add('sessionkeylifetime', $sessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('prevsessionkeylifetime') ) { $payload.Add('prevsessionkeylifetime', $prevsessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('hsts') ) { $payload.Add('hsts', $hsts) }
            if ( $PSBoundParameters.ContainsKey('maxage') ) { $payload.Add('maxage', $maxage) }
            if ( $PSBoundParameters.ContainsKey('includesubdomains') ) { $payload.Add('includesubdomains', $includesubdomains) }
            if ( $PSBoundParameters.ContainsKey('preload') ) { $payload.Add('preload', $preload) }
            if ( $PSBoundParameters.ContainsKey('skipclientcertpolicycheck') ) { $payload.Add('skipclientcertpolicycheck', $skipclientcertpolicycheck) }
            if ( $PSBoundParameters.ContainsKey('zerorttearlydata') ) { $payload.Add('zerorttearlydata', $zerorttearlydata) }
            if ( $PSBoundParameters.ContainsKey('tls13sessionticketsperauthcontext') ) { $payload.Add('tls13sessionticketsperauthcontext', $tls13sessionticketsperauthcontext) }
            if ( $PSBoundParameters.ContainsKey('dhekeyexchangewithpsk') ) { $payload.Add('dhekeyexchangewithpsk', $dhekeyexchangewithpsk) }
            if ( $PSBoundParameters.ContainsKey('allowextendedmastersecret') ) { $payload.Add('allowextendedmastersecret', $allowextendedmastersecret) }
            if ( $PSBoundParameters.ContainsKey('alpnprotocol') ) { $payload.Add('alpnprotocol', $alpnprotocol) }
            if ( $PSCmdlet.ShouldProcess("sslprofile", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslprofile: Finished"
    }
}

function Invoke-NSDeleteSslprofile {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL profile resource.
    .PARAMETER Name
        Name for the SSL profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslprofile -Name <string>
        An example how to delete sslprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslprofile: Finished"
    }
}

function Invoke-NSUpdateSslprofile {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL profile resource.
    .PARAMETER Name
        Name for the SSL profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Ssllogprofile
        The name of the ssllogprofile.
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        The file name and path for the DH parameter.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time.
        This parameter is not applicable when configuring a backend profile. Allowed DH count values are 0 and &gt;= 500.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        The refresh count for the re-generation of RSA public-key and private-key pair.
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        The Session timeout value in seconds.
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        The redirect URL to be used with the Cipher Redirect feature.
    .PARAMETER Clientauth
        State of client authentication. In service-based SSL offload, the service terminates the SSL handshake if the SSL client does not provide a valid certificate.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        The rule for client certificate requirement in client authentication.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL service.
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is set to ENABLED, and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL profile.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Allowunknownsni
        Controls how the handshake is handled when the server name extension does not match any of the bound certificates. These checks are performed only if the session is SNI enabled (i.e. when profile bound to vserver has SNIEnable and Client Hello arrived with SNI extension). Available settings function as follows :
        ENABLED - handshakes with an unknown SNI are allowed to continue, if a default cert is bound.
        DISLABED - handshakes with an unknown SNI are not allowed to continue.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL Backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Pushenctrigger
        Trigger encryption on the basis of the PUSH flag value. Available settings function as follows:
        * ALWAYS - Any PUSH packet triggers encryption.
        * IGNORE - Ignore PUSH packet for triggering encryption.
        * MERGE - For a consecutive sequence of PUSH packets, the last PUSH packet triggers encryption.
        * TIMER - PUSH packet triggering encryption is delayed by the time defined in the set ssl parameter command or in the Change Advanced SSL Settings dialog box.
        Possible values = Always, Merge, Ignore, Timer
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Cleartextport
        Port on which clear-text data is sent by the appliance to the server. Do not specify this parameter for SSL offloading with end-to-end encryption.
    .PARAMETER Insertionencoding
        Encoding method used to insert the subject or issuer's name in HTTP requests to servers.
          
        Possible values = Unicode, UTF-8
    .PARAMETER Denysslreneg
        Deny renegotiation in specified circumstances. Available settings function as follows:
        * NO - Allow SSL renegotiation.
        * FRONTEND_CLIENT - Deny secure and nonsecure SSL renegotiation initiated by the client.
        * FRONTEND_CLIENTSERVER - Deny secure and nonsecure SSL renegotiation initiated by the client or the Citrix ADC during policy-based client authentication.
        * ALL - Deny all secure and nonsecure SSL renegotiation.
        * NONSECURE - Deny nonsecure SSL renegotiation. Allows only clients that support RFC 5746.
          
        Possible values = NO, FRONTEND_CLIENT, FRONTEND_CLIENTSERVER, ALL, NONSECURE
    .PARAMETER Maxrenegrate
        Maximum number of renegotiation requests allowed, in one second, to each SSL entity to which this profile is bound. When set to 0, an unlimited number of renegotiation requests are allowed. Applicable only when Deny SSL renegotiation is set to a value other than ALL.
          
          
        Maximum value = 65535
    .PARAMETER Quantumsize
        Amount of data to collect before the data is pushed to the crypto hardware for encryption. For large downloads, a larger quantum size better utilizes the crypto resources.
          
        Possible values = 4096, 8192, 16384
    .PARAMETER Strictcachecks
        Enable strict CA certificate checks on the appliance.
          
        Possible values = YES, NO
    .PARAMETER Encrypttriggerpktcount
        Maximum number of queued packets after which encryption is triggered. Use this setting for SSL transactions that send small packets from server to Citrix ADC.
          
          
        Maximum value = 50
    .PARAMETER Pushflag
        Insert PUSH flag into decrypted, encrypted, or all records. If the PUSH flag is set to a value other than 0, the buffered records are forwarded on the basis of the value of the PUSH flag. Available settings function as follows:
        0 - Auto (PUSH flag is not set.)
        1 - Insert PUSH flag into every decrypted record.
        2 -Insert PUSH flag into every encrypted record.
        3 - Insert PUSH flag into every decrypted and encrypted record.
          
        Maximum value = 3
    .PARAMETER Dropreqwithnohostheader
        Host header check for SNI enabled sessions. If this check is enabled and the HTTP request does not contain the host header for SNI enabled sessions(i.e vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension), the request is dropped.
          
        Possible values = YES, NO
    .PARAMETER Snihttphostmatch
        Controls how the HTTP 'Host' header value is validated. These checks are performed only if the session is SNI enabled (i.e when vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension) and HTTP request contains 'Host' header.
        Available settings function as follows:
        CERT - Request is forwarded if the 'Host' value is covered
        by the certificate used to establish this SSL session.
        Note: 'CERT' matching mode cannot be applied in
        TLS 1.3 connections established by resuming from a
        previous TLS 1.3 session. On these connections, 'STRICT'
        matching mode will be used instead.
        STRICT - Request is forwarded only if value of 'Host' header
        in HTTP is identical to the 'Server name' value passed
        in 'Client Hello' of the SSL connection.
        NO - No validation is performed on the HTTP 'Host'
        header value.
          
        Possible values = NO, CERT, STRICT
    .PARAMETER Pushenctriggertimeout
        PUSH encryption trigger timeout value. The timeout value is applied only if you set the Push Encryption Trigger parameter to Timer in the SSL virtual server settings.
          
          
        Maximum value = 200
    .PARAMETER Ssltriggertimeout
        Time, in milliseconds, after which encryption is triggered for transactions that are not tracked on the Citrix ADC because their length is not known. There can be a delay of up to 10ms from the specified timeout value before the packet is pushed into the queue.
          
          
        Maximum value = 200
    .PARAMETER Clientauthuseboundcachain
        Certficates bound on the VIP are used for validating the client cert. Certficates came along with client cert are not used for validating the client cert.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslinterception
        Enable or disable transparent interception of SSL sessions.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslireneg
        Enable or disable triggering the client renegotiation when renegotiation request is received from the origin server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssliocspcheck
        Enable or disable OCSP check for origin server certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslimaxsessperserver
        Maximum ssl session to be cached per dynamic origin server. A unique ssl session is created for each SNI received from the client on ClientHello and the matching session is used for server session reuse.
          
          
        Maximum value = 1000
    .PARAMETER Hsts
        State of HSTS protocol support for the SSL profile. Using HSTS, a server can enforce the use of an HTTPS connection for all communication with a client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxage
        Set the maximum time, in seconds, in the strict transport security (STS) header during which the client must send only HTTPS requests to the server.
          
          
        Maximum value = 4294967294
    .PARAMETER Includesubdomains
        Enable HSTS for subdomains. If set to Yes, a client must send only HTTPS requests for subdomains.
          
        Possible values = YES, NO
    .PARAMETER Preload
        Flag indicates the consent of the site owner to have their domain preloaded.
          
        Possible values = YES, NO
    .PARAMETER Sessionticket
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketlifetime
        This option sets the life time of session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Sessionticketkeyrefresh
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketkeydata
        Session ticket enc/dec key, admin can set it.
    .PARAMETER Sessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 86400
    .PARAMETER Prevsessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .PARAMETER Cipherpriority
        cipher priority.
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer entity certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Skipclientcertpolicycheck
        This flag controls the processing of X509 certificate policies. If this option is Enabled, then the policy check in Client authentication will be skipped. This option can be used only when Client Authentication is Enabled and ClientCert is set to Mandatory.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Zerorttearlydata
        State of TLS 1.3 0-RTT early data support for the SSL Virtual Server. This setting only has an effect if resumption is enabled, as early data cannot be sent along with an initial handshake.
        Early application data has significantly different security properties - in particular there is no guarantee that the data cannot be replayed.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13sessionticketsperauthcontext
        Number of tickets the SSL Virtual Server will issue anytime TLS 1.3 is negotiated, ticket-based resumption is enabled, and either (1) a handshake completes or (2) post-handhsake client auth completes.
        This value can be increased to enable clients to open multiple parallel connections using a fresh ticket for each connection.
        No tickets are sent if resumption is disabled.
          
          
        Maximum value = 10
    .PARAMETER Dhekeyexchangewithpsk
        Whether or not the SSL Virtual Server will require a DHE key exchange to occur when a PSK is accepted during a TLS 1.3 resumption handshake.
        A DHE key exchange ensures forward secrecy even in the event that ticket keys are compromised, at the expense of an additional round trip and resources required to carry out the DHE key exchange.
        If disabled, a DHE key exchange will be performed when a PSK is accepted but only if requested by the client.
        If enabled, the server will require a DHE key exchange when a PSK is accepted regardless of whether the client supports combined PSK-DHE key exchange. This setting only has an effect when resumption is enabled.
          
        Possible values = YES, NO
    .PARAMETER Allowextendedmastersecret
        When set to YES, attempt to use the TLS Extended Master Secret (EMS, as
        described in RFC 7627) when negotiating TLS 1.0, TLS 1.1 and TLS 1.2
        connection parameters. EMS must be supported by both the TLS client and server
        in order to be enabled during a handshake. This setting applies to both
        frontend and backend SSL profiles.
          
        Possible values = YES, NO
    .PARAMETER Alpnprotocol
        Application protocol supported by the server and used in negotiation of the protocol with the client. Possible values are HTTP1.1, HTTP2 and NONE. Default value is NONE which implies application protocol is not enabled hence remain unknown to the TLS layer. This parameter is relevant only if SSL connection is handled by the virtual server of the type SSL_TCP.
          
        Possible values = NONE, HTTP1.1, HTTP2
    .PARAMETER PassThru
        Return details about the created sslprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslprofile -name <string>
        An example how to update sslprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateLength(1, 127)]
        [string]$Ssllogprofile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dh,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Dhfile,

        [double]$Dhcount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dhkeyexpsizelimit,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ersa,

        [double]$Ersacount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessreuse,

        [double]$Sesstimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cipherredirect,

        [string]$Cipherurl,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauth,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Clientcert,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslredirect,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Redirectportrewrite,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl3,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls11,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls13,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Snienable,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Allowunknownsni,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ocspstapling,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Serverauth,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Commonname,

        [ValidateSet('Always', 'Merge', 'Ignore', 'Timer')]
        [string]$Pushenctrigger,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify,

        [ValidateRange(1, 65535)]
        [int]$Cleartextport,

        [ValidateSet('Unicode', 'UTF-8')]
        [string]$Insertionencoding,

        [ValidateSet('NO', 'FRONTEND_CLIENT', 'FRONTEND_CLIENTSERVER', 'ALL', 'NONSECURE')]
        [string]$Denysslreneg,

        [double]$Maxrenegrate,

        [ValidateSet('4096', '8192', '16384')]
        [string]$Quantumsize,

        [ValidateSet('YES', 'NO')]
        [string]$Strictcachecks,

        [double]$Encrypttriggerpktcount,

        [double]$Pushflag,

        [ValidateSet('YES', 'NO')]
        [string]$Dropreqwithnohostheader,

        [ValidateSet('NO', 'CERT', 'STRICT')]
        [string]$Snihttphostmatch,

        [double]$Pushenctriggertimeout,

        [double]$Ssltriggertimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauthuseboundcachain,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslinterception,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslireneg,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssliocspcheck,

        [double]$Sslimaxsessperserver,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Hsts,

        [double]$Maxage,

        [ValidateSet('YES', 'NO')]
        [string]$Includesubdomains,

        [ValidateSet('YES', 'NO')]
        [string]$Preload,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessionticket,

        [double]$Sessionticketlifetime,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessionticketkeyrefresh,

        [string]$Sessionticketkeydata,

        [double]$Sessionkeylifetime,

        [double]$Prevsessionkeylifetime,

        [string]$Ciphername,

        [double]$Cipherpriority,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Strictsigdigestcheck,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Skipclientcertpolicycheck,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Zerorttearlydata,

        [double]$Tls13sessionticketsperauthcontext,

        [ValidateSet('YES', 'NO')]
        [string]$Dhekeyexchangewithpsk,

        [ValidateSet('YES', 'NO')]
        [string]$Allowextendedmastersecret,

        [ValidateSet('NONE', 'HTTP1.1', 'HTTP2')]
        [string]$Alpnprotocol,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ssllogprofile') ) { $payload.Add('ssllogprofile', $ssllogprofile) }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('allowunknownsni') ) { $payload.Add('allowunknownsni', $allowunknownsni) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('pushenctrigger') ) { $payload.Add('pushenctrigger', $pushenctrigger) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('cleartextport') ) { $payload.Add('cleartextport', $cleartextport) }
            if ( $PSBoundParameters.ContainsKey('insertionencoding') ) { $payload.Add('insertionencoding', $insertionencoding) }
            if ( $PSBoundParameters.ContainsKey('denysslreneg') ) { $payload.Add('denysslreneg', $denysslreneg) }
            if ( $PSBoundParameters.ContainsKey('maxrenegrate') ) { $payload.Add('maxrenegrate', $maxrenegrate) }
            if ( $PSBoundParameters.ContainsKey('quantumsize') ) { $payload.Add('quantumsize', $quantumsize) }
            if ( $PSBoundParameters.ContainsKey('strictcachecks') ) { $payload.Add('strictcachecks', $strictcachecks) }
            if ( $PSBoundParameters.ContainsKey('encrypttriggerpktcount') ) { $payload.Add('encrypttriggerpktcount', $encrypttriggerpktcount) }
            if ( $PSBoundParameters.ContainsKey('pushflag') ) { $payload.Add('pushflag', $pushflag) }
            if ( $PSBoundParameters.ContainsKey('dropreqwithnohostheader') ) { $payload.Add('dropreqwithnohostheader', $dropreqwithnohostheader) }
            if ( $PSBoundParameters.ContainsKey('snihttphostmatch') ) { $payload.Add('snihttphostmatch', $snihttphostmatch) }
            if ( $PSBoundParameters.ContainsKey('pushenctriggertimeout') ) { $payload.Add('pushenctriggertimeout', $pushenctriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('ssltriggertimeout') ) { $payload.Add('ssltriggertimeout', $ssltriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('clientauthuseboundcachain') ) { $payload.Add('clientauthuseboundcachain', $clientauthuseboundcachain) }
            if ( $PSBoundParameters.ContainsKey('sslinterception') ) { $payload.Add('sslinterception', $sslinterception) }
            if ( $PSBoundParameters.ContainsKey('sslireneg') ) { $payload.Add('sslireneg', $sslireneg) }
            if ( $PSBoundParameters.ContainsKey('ssliocspcheck') ) { $payload.Add('ssliocspcheck', $ssliocspcheck) }
            if ( $PSBoundParameters.ContainsKey('sslimaxsessperserver') ) { $payload.Add('sslimaxsessperserver', $sslimaxsessperserver) }
            if ( $PSBoundParameters.ContainsKey('hsts') ) { $payload.Add('hsts', $hsts) }
            if ( $PSBoundParameters.ContainsKey('maxage') ) { $payload.Add('maxage', $maxage) }
            if ( $PSBoundParameters.ContainsKey('includesubdomains') ) { $payload.Add('includesubdomains', $includesubdomains) }
            if ( $PSBoundParameters.ContainsKey('preload') ) { $payload.Add('preload', $preload) }
            if ( $PSBoundParameters.ContainsKey('sessionticket') ) { $payload.Add('sessionticket', $sessionticket) }
            if ( $PSBoundParameters.ContainsKey('sessionticketlifetime') ) { $payload.Add('sessionticketlifetime', $sessionticketlifetime) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeyrefresh') ) { $payload.Add('sessionticketkeyrefresh', $sessionticketkeyrefresh) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeydata') ) { $payload.Add('sessionticketkeydata', $sessionticketkeydata) }
            if ( $PSBoundParameters.ContainsKey('sessionkeylifetime') ) { $payload.Add('sessionkeylifetime', $sessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('prevsessionkeylifetime') ) { $payload.Add('prevsessionkeylifetime', $prevsessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSBoundParameters.ContainsKey('skipclientcertpolicycheck') ) { $payload.Add('skipclientcertpolicycheck', $skipclientcertpolicycheck) }
            if ( $PSBoundParameters.ContainsKey('zerorttearlydata') ) { $payload.Add('zerorttearlydata', $zerorttearlydata) }
            if ( $PSBoundParameters.ContainsKey('tls13sessionticketsperauthcontext') ) { $payload.Add('tls13sessionticketsperauthcontext', $tls13sessionticketsperauthcontext) }
            if ( $PSBoundParameters.ContainsKey('dhekeyexchangewithpsk') ) { $payload.Add('dhekeyexchangewithpsk', $dhekeyexchangewithpsk) }
            if ( $PSBoundParameters.ContainsKey('allowextendedmastersecret') ) { $payload.Add('allowextendedmastersecret', $allowextendedmastersecret) }
            if ( $PSBoundParameters.ContainsKey('alpnprotocol') ) { $payload.Add('alpnprotocol', $alpnprotocol) }
            if ( $PSCmdlet.ShouldProcess("sslprofile", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslprofile -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslprofile: Finished"
    }
}

function Invoke-NSUnsetSslprofile {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL profile resource.
    .PARAMETER Name
        Name for the SSL profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER Ssllogprofile
        The name of the ssllogprofile.
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        The file name and path for the DH parameter.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time.
        This parameter is not applicable when configuring a backend profile. Allowed DH count values are 0 and &gt;= 500.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        The refresh count for the re-generation of RSA public-key and private-key pair.
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        The Session timeout value in seconds.
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        The redirect URL to be used with the Cipher Redirect feature.
    .PARAMETER Clientauth
        State of client authentication. In service-based SSL offload, the service terminates the SSL handshake if the SSL client does not provide a valid certificate.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        The rule for client certificate requirement in client authentication.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL service.
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
        This parameter is not applicable when configuring a backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is set to ENABLED, and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL profile.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Allowunknownsni
        Controls how the handshake is handled when the server name extension does not match any of the bound certificates. These checks are performed only if the session is SNI enabled (i.e. when profile bound to vserver has SNIEnable and Client Hello arrived with SNI extension). Available settings function as follows :
        ENABLED - handshakes with an unknown SNI are allowed to continue, if a default cert is bound.
        DISLABED - handshakes with an unknown SNI are not allowed to continue.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL Backend profile.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Pushenctrigger
        Trigger encryption on the basis of the PUSH flag value. Available settings function as follows:
        * ALWAYS - Any PUSH packet triggers encryption.
        * IGNORE - Ignore PUSH packet for triggering encryption.
        * MERGE - For a consecutive sequence of PUSH packets, the last PUSH packet triggers encryption.
        * TIMER - PUSH packet triggering encryption is delayed by the time defined in the set ssl parameter command or in the Change Advanced SSL Settings dialog box.
        Possible values = Always, Merge, Ignore, Timer
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Cleartextport
        Port on which clear-text data is sent by the appliance to the server. Do not specify this parameter for SSL offloading with end-to-end encryption.
    .PARAMETER Insertionencoding
        Encoding method used to insert the subject or issuer's name in HTTP requests to servers.
          
        Possible values = Unicode, UTF-8
    .PARAMETER Denysslreneg
        Deny renegotiation in specified circumstances. Available settings function as follows:
        * NO - Allow SSL renegotiation.
        * FRONTEND_CLIENT - Deny secure and nonsecure SSL renegotiation initiated by the client.
        * FRONTEND_CLIENTSERVER - Deny secure and nonsecure SSL renegotiation initiated by the client or the Citrix ADC during policy-based client authentication.
        * ALL - Deny all secure and nonsecure SSL renegotiation.
        * NONSECURE - Deny nonsecure SSL renegotiation. Allows only clients that support RFC 5746.
          
        Possible values = NO, FRONTEND_CLIENT, FRONTEND_CLIENTSERVER, ALL, NONSECURE
    .PARAMETER Maxrenegrate
        Maximum number of renegotiation requests allowed, in one second, to each SSL entity to which this profile is bound. When set to 0, an unlimited number of renegotiation requests are allowed. Applicable only when Deny SSL renegotiation is set to a value other than ALL.
          
          
        Maximum value = 65535
    .PARAMETER Quantumsize
        Amount of data to collect before the data is pushed to the crypto hardware for encryption. For large downloads, a larger quantum size better utilizes the crypto resources.
          
        Possible values = 4096, 8192, 16384
    .PARAMETER Strictcachecks
        Enable strict CA certificate checks on the appliance.
          
        Possible values = YES, NO
    .PARAMETER Encrypttriggerpktcount
        Maximum number of queued packets after which encryption is triggered. Use this setting for SSL transactions that send small packets from server to Citrix ADC.
          
          
        Maximum value = 50
    .PARAMETER Pushflag
        Insert PUSH flag into decrypted, encrypted, or all records. If the PUSH flag is set to a value other than 0, the buffered records are forwarded on the basis of the value of the PUSH flag. Available settings function as follows:
        0 - Auto (PUSH flag is not set.)
        1 - Insert PUSH flag into every decrypted record.
        2 -Insert PUSH flag into every encrypted record.
        3 - Insert PUSH flag into every decrypted and encrypted record.
          
        Maximum value = 3
    .PARAMETER Dropreqwithnohostheader
        Host header check for SNI enabled sessions. If this check is enabled and the HTTP request does not contain the host header for SNI enabled sessions(i.e vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension), the request is dropped.
          
        Possible values = YES, NO
    .PARAMETER Snihttphostmatch
        Controls how the HTTP 'Host' header value is validated. These checks are performed only if the session is SNI enabled (i.e when vserver or profile bound to vserver has SNI enabled and 'Client Hello' arrived with SNI extension) and HTTP request contains 'Host' header.
        Available settings function as follows:
        CERT - Request is forwarded if the 'Host' value is covered
        by the certificate used to establish this SSL session.
        Note: 'CERT' matching mode cannot be applied in
        TLS 1.3 connections established by resuming from a
        previous TLS 1.3 session. On these connections, 'STRICT'
        matching mode will be used instead.
        STRICT - Request is forwarded only if value of 'Host' header
        in HTTP is identical to the 'Server name' value passed
        in 'Client Hello' of the SSL connection.
        NO - No validation is performed on the HTTP 'Host'
        header value.
          
        Possible values = NO, CERT, STRICT
    .PARAMETER Pushenctriggertimeout
        PUSH encryption trigger timeout value. The timeout value is applied only if you set the Push Encryption Trigger parameter to Timer in the SSL virtual server settings.
          
          
        Maximum value = 200
    .PARAMETER Ssltriggertimeout
        Time, in milliseconds, after which encryption is triggered for transactions that are not tracked on the Citrix ADC because their length is not known. There can be a delay of up to 10ms from the specified timeout value before the packet is pushed into the queue.
          
          
        Maximum value = 200
    .PARAMETER Clientauthuseboundcachain
        Certficates bound on the VIP are used for validating the client cert. Certficates came along with client cert are not used for validating the client cert.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslinterception
        Enable or disable transparent interception of SSL sessions.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslireneg
        Enable or disable triggering the client renegotiation when renegotiation request is received from the origin server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssliocspcheck
        Enable or disable OCSP check for origin server certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslimaxsessperserver
        Maximum ssl session to be cached per dynamic origin server. A unique ssl session is created for each SNI received from the client on ClientHello and the matching session is used for server session reuse.
          
          
        Maximum value = 1000
    .PARAMETER Hsts
        State of HSTS protocol support for the SSL profile. Using HSTS, a server can enforce the use of an HTTPS connection for all communication with a client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxage
        Set the maximum time, in seconds, in the strict transport security (STS) header during which the client must send only HTTPS requests to the server.
          
          
        Maximum value = 4294967294
    .PARAMETER Includesubdomains
        Enable HSTS for subdomains. If set to Yes, a client must send only HTTPS requests for subdomains.
          
        Possible values = YES, NO
    .PARAMETER Preload
        Flag indicates the consent of the site owner to have their domain preloaded.
          
        Possible values = YES, NO
    .PARAMETER Sessionticket
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketlifetime
        This option sets the life time of session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Sessionticketkeyrefresh
        This option enables the use of session tickets, as per the RFC 5077.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sessionticketkeydata
        Session ticket enc/dec key, admin can set it.
    .PARAMETER Sessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 86400
    .PARAMETER Prevsessionkeylifetime
        This option sets the life time of symm key used to generate session tickets issued by NS in secs.
          
          
        Maximum value = 172800
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .PARAMETER Cipherpriority
        cipher priority.
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer entity certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Skipclientcertpolicycheck
        This flag controls the processing of X509 certificate policies. If this option is Enabled, then the policy check in Client authentication will be skipped. This option can be used only when Client Authentication is Enabled and ClientCert is set to Mandatory.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Zerorttearlydata
        State of TLS 1.3 0-RTT early data support for the SSL Virtual Server. This setting only has an effect if resumption is enabled, as early data cannot be sent along with an initial handshake.
        Early application data has significantly different security properties - in particular there is no guarantee that the data cannot be replayed.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13sessionticketsperauthcontext
        Number of tickets the SSL Virtual Server will issue anytime TLS 1.3 is negotiated, ticket-based resumption is enabled, and either (1) a handshake completes or (2) post-handhsake client auth completes.
        This value can be increased to enable clients to open multiple parallel connections using a fresh ticket for each connection.
        No tickets are sent if resumption is disabled.
          
          
        Maximum value = 10
    .PARAMETER Dhekeyexchangewithpsk
        Whether or not the SSL Virtual Server will require a DHE key exchange to occur when a PSK is accepted during a TLS 1.3 resumption handshake.
        A DHE key exchange ensures forward secrecy even in the event that ticket keys are compromised, at the expense of an additional round trip and resources required to carry out the DHE key exchange.
        If disabled, a DHE key exchange will be performed when a PSK is accepted but only if requested by the client.
        If enabled, the server will require a DHE key exchange when a PSK is accepted regardless of whether the client supports combined PSK-DHE key exchange. This setting only has an effect when resumption is enabled.
          
        Possible values = YES, NO
    .PARAMETER Allowextendedmastersecret
        When set to YES, attempt to use the TLS Extended Master Secret (EMS, as
        described in RFC 7627) when negotiating TLS 1.0, TLS 1.1 and TLS 1.2
        connection parameters. EMS must be supported by both the TLS client and server
        in order to be enabled during a handshake. This setting applies to both
        frontend and backend SSL profiles.
          
        Possible values = YES, NO
    .PARAMETER Alpnprotocol
        Application protocol supported by the server and used in negotiation of the protocol with the client. Possible values are HTTP1.1, HTTP2 and NONE. Default value is NONE which implies application protocol is not enabled hence remain unknown to the TLS layer. This parameter is relevant only if SSL connection is handled by the virtual server of the type SSL_TCP.
          
        Possible values = NONE, HTTP1.1, HTTP2
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslprofile -name <string>
        An example how to unset sslprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Boolean]$ssllogprofile,

        [Boolean]$dh,

        [Boolean]$dhfile,

        [Boolean]$dhcount,

        [Boolean]$dhkeyexpsizelimit,

        [Boolean]$ersa,

        [Boolean]$ersacount,

        [Boolean]$sessreuse,

        [Boolean]$sesstimeout,

        [Boolean]$cipherredirect,

        [Boolean]$cipherurl,

        [Boolean]$clientauth,

        [Boolean]$clientcert,

        [Boolean]$sslredirect,

        [Boolean]$redirectportrewrite,

        [Boolean]$ssl3,

        [Boolean]$tls1,

        [Boolean]$tls11,

        [Boolean]$tls12,

        [Boolean]$tls13,

        [Boolean]$snienable,

        [Boolean]$allowunknownsni,

        [Boolean]$ocspstapling,

        [Boolean]$serverauth,

        [Boolean]$commonname,

        [Boolean]$pushenctrigger,

        [Boolean]$sendclosenotify,

        [Boolean]$cleartextport,

        [Boolean]$insertionencoding,

        [Boolean]$denysslreneg,

        [Boolean]$maxrenegrate,

        [Boolean]$quantumsize,

        [Boolean]$strictcachecks,

        [Boolean]$encrypttriggerpktcount,

        [Boolean]$pushflag,

        [Boolean]$dropreqwithnohostheader,

        [Boolean]$snihttphostmatch,

        [Boolean]$pushenctriggertimeout,

        [Boolean]$ssltriggertimeout,

        [Boolean]$clientauthuseboundcachain,

        [Boolean]$sslinterception,

        [Boolean]$sslireneg,

        [Boolean]$ssliocspcheck,

        [Boolean]$sslimaxsessperserver,

        [Boolean]$hsts,

        [Boolean]$maxage,

        [Boolean]$includesubdomains,

        [Boolean]$preload,

        [Boolean]$sessionticket,

        [Boolean]$sessionticketlifetime,

        [Boolean]$sessionticketkeyrefresh,

        [Boolean]$sessionticketkeydata,

        [Boolean]$sessionkeylifetime,

        [Boolean]$prevsessionkeylifetime,

        [Boolean]$ciphername,

        [Boolean]$cipherpriority,

        [Boolean]$strictsigdigestcheck,

        [Boolean]$skipclientcertpolicycheck,

        [Boolean]$zerorttearlydata,

        [Boolean]$tls13sessionticketsperauthcontext,

        [Boolean]$dhekeyexchangewithpsk,

        [Boolean]$allowextendedmastersecret,

        [Boolean]$alpnprotocol 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ssllogprofile') ) { $payload.Add('ssllogprofile', $ssllogprofile) }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('allowunknownsni') ) { $payload.Add('allowunknownsni', $allowunknownsni) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('pushenctrigger') ) { $payload.Add('pushenctrigger', $pushenctrigger) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('cleartextport') ) { $payload.Add('cleartextport', $cleartextport) }
            if ( $PSBoundParameters.ContainsKey('insertionencoding') ) { $payload.Add('insertionencoding', $insertionencoding) }
            if ( $PSBoundParameters.ContainsKey('denysslreneg') ) { $payload.Add('denysslreneg', $denysslreneg) }
            if ( $PSBoundParameters.ContainsKey('maxrenegrate') ) { $payload.Add('maxrenegrate', $maxrenegrate) }
            if ( $PSBoundParameters.ContainsKey('quantumsize') ) { $payload.Add('quantumsize', $quantumsize) }
            if ( $PSBoundParameters.ContainsKey('strictcachecks') ) { $payload.Add('strictcachecks', $strictcachecks) }
            if ( $PSBoundParameters.ContainsKey('encrypttriggerpktcount') ) { $payload.Add('encrypttriggerpktcount', $encrypttriggerpktcount) }
            if ( $PSBoundParameters.ContainsKey('pushflag') ) { $payload.Add('pushflag', $pushflag) }
            if ( $PSBoundParameters.ContainsKey('dropreqwithnohostheader') ) { $payload.Add('dropreqwithnohostheader', $dropreqwithnohostheader) }
            if ( $PSBoundParameters.ContainsKey('snihttphostmatch') ) { $payload.Add('snihttphostmatch', $snihttphostmatch) }
            if ( $PSBoundParameters.ContainsKey('pushenctriggertimeout') ) { $payload.Add('pushenctriggertimeout', $pushenctriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('ssltriggertimeout') ) { $payload.Add('ssltriggertimeout', $ssltriggertimeout) }
            if ( $PSBoundParameters.ContainsKey('clientauthuseboundcachain') ) { $payload.Add('clientauthuseboundcachain', $clientauthuseboundcachain) }
            if ( $PSBoundParameters.ContainsKey('sslinterception') ) { $payload.Add('sslinterception', $sslinterception) }
            if ( $PSBoundParameters.ContainsKey('sslireneg') ) { $payload.Add('sslireneg', $sslireneg) }
            if ( $PSBoundParameters.ContainsKey('ssliocspcheck') ) { $payload.Add('ssliocspcheck', $ssliocspcheck) }
            if ( $PSBoundParameters.ContainsKey('sslimaxsessperserver') ) { $payload.Add('sslimaxsessperserver', $sslimaxsessperserver) }
            if ( $PSBoundParameters.ContainsKey('hsts') ) { $payload.Add('hsts', $hsts) }
            if ( $PSBoundParameters.ContainsKey('maxage') ) { $payload.Add('maxage', $maxage) }
            if ( $PSBoundParameters.ContainsKey('includesubdomains') ) { $payload.Add('includesubdomains', $includesubdomains) }
            if ( $PSBoundParameters.ContainsKey('preload') ) { $payload.Add('preload', $preload) }
            if ( $PSBoundParameters.ContainsKey('sessionticket') ) { $payload.Add('sessionticket', $sessionticket) }
            if ( $PSBoundParameters.ContainsKey('sessionticketlifetime') ) { $payload.Add('sessionticketlifetime', $sessionticketlifetime) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeyrefresh') ) { $payload.Add('sessionticketkeyrefresh', $sessionticketkeyrefresh) }
            if ( $PSBoundParameters.ContainsKey('sessionticketkeydata') ) { $payload.Add('sessionticketkeydata', $sessionticketkeydata) }
            if ( $PSBoundParameters.ContainsKey('sessionkeylifetime') ) { $payload.Add('sessionkeylifetime', $sessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('prevsessionkeylifetime') ) { $payload.Add('prevsessionkeylifetime', $prevsessionkeylifetime) }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSBoundParameters.ContainsKey('skipclientcertpolicycheck') ) { $payload.Add('skipclientcertpolicycheck', $skipclientcertpolicycheck) }
            if ( $PSBoundParameters.ContainsKey('zerorttearlydata') ) { $payload.Add('zerorttearlydata', $zerorttearlydata) }
            if ( $PSBoundParameters.ContainsKey('tls13sessionticketsperauthcontext') ) { $payload.Add('tls13sessionticketsperauthcontext', $tls13sessionticketsperauthcontext) }
            if ( $PSBoundParameters.ContainsKey('dhekeyexchangewithpsk') ) { $payload.Add('dhekeyexchangewithpsk', $dhekeyexchangewithpsk) }
            if ( $PSBoundParameters.ContainsKey('allowextendedmastersecret') ) { $payload.Add('allowextendedmastersecret', $allowextendedmastersecret) }
            if ( $PSBoundParameters.ContainsKey('alpnprotocol') ) { $payload.Add('alpnprotocol', $alpnprotocol) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslprofile: Finished"
    }
}

function Invoke-NSGetSslprofile {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL profile resource.
    .PARAMETER Name
        Name for the SSL profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created.
    .PARAMETER GetAll
        Retrieve all sslprofile object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofile -GetAll
        Get all sslprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofile -Count
        Get the number of sslprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofile -name <string>
        Get sslprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofile -Filter @{ 'name'='<value>' }
        Get sslprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofile: Ended"
    }
}

function Invoke-NSGetSslprofileBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslprofile_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileBinding -GetAll
        Get all sslprofile_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileBinding -name <string>
        Get sslprofile_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileBinding: Ended"
    }
}

function Invoke-NSAddSslprofileEcccurveBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Cipherpriority
        Priority of the cipher binding.
          
        Maximum value = 1000
    .PARAMETER Ecccurvename
        Named ECC curve bound to vserver/service.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .PARAMETER PassThru
        Return details about the created sslprofile_ecccurve_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslprofileEcccurveBinding -name <string>
        An example how to add sslprofile_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslprofileEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [double]$Cipherpriority,

        [ValidateSet('ALL', 'P_224', 'P_256', 'P_384', 'P_521')]
        [string]$Ecccurvename,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslprofileEcccurveBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSBoundParameters.ContainsKey('ecccurvename') ) { $payload.Add('ecccurvename', $ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("sslprofile_ecccurve_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslprofile_ecccurve_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofileEcccurveBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslprofileEcccurveBinding: Finished"
    }
}

function Invoke-NSDeleteSslprofileEcccurveBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Ecccurvename
        Named ECC curve bound to vserver/service.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslprofileEcccurveBinding -Name <string>
        An example how to delete sslprofile_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslprofileEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name,

        [string]$Ecccurvename 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslprofileEcccurveBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ecccurvename') ) { $arguments.Add('ecccurvename', $Ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslprofileEcccurveBinding: Finished"
    }
}

function Invoke-NSGetSslprofileEcccurveBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER GetAll
        Retrieve all sslprofile_ecccurve_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_ecccurve_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileEcccurveBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileEcccurveBinding -GetAll
        Get all sslprofile_ecccurve_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileEcccurveBinding -Count
        Get the number of sslprofile_ecccurve_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileEcccurveBinding -name <string>
        Get sslprofile_ecccurve_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileEcccurveBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_ecccurve_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileEcccurveBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_ecccurve_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_ecccurve_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_ecccurve_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_ecccurve_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileEcccurveBinding: Ended"
    }
}

function Invoke-NSAddSslprofileSslcertkeyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Cipherpriority
        Priority of the cipher binding.
          
        Maximum value = 1000
    .PARAMETER Sslicacertkey
        The certkey (CA certificate + private key) to be used for SSL interception.
    .PARAMETER PassThru
        Return details about the created sslprofile_sslcertkey_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslprofileSslcertkeyBinding -name <string>
        An example how to add sslprofile_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslprofileSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [double]$Cipherpriority,

        [string]$Sslicacertkey,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslprofileSslcertkeyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSBoundParameters.ContainsKey('sslicacertkey') ) { $payload.Add('sslicacertkey', $sslicacertkey) }
            if ( $PSCmdlet.ShouldProcess("sslprofile_sslcertkey_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslprofile_sslcertkey_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofileSslcertkeyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslprofileSslcertkeyBinding: Finished"
    }
}

function Invoke-NSDeleteSslprofileSslcertkeyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Sslicacertkey
        The certkey (CA certificate + private key) to be used for SSL interception.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslprofileSslcertkeyBinding -Name <string>
        An example how to delete sslprofile_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslprofileSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name,

        [string]$Sslicacertkey 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslprofileSslcertkeyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Sslicacertkey') ) { $arguments.Add('sslicacertkey', $Sslicacertkey) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslprofileSslcertkeyBinding: Finished"
    }
}

function Invoke-NSGetSslprofileSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER GetAll
        Retrieve all sslprofile_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcertkeyBinding -GetAll
        Get all sslprofile_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcertkeyBinding -Count
        Get the number of sslprofile_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcertkeyBinding -name <string>
        Get sslprofile_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_sslcertkey_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileSslcertkeyBinding: Ended"
    }
}

function Invoke-NSAddSslprofileSslcipherBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Ciphername
        Name of the cipher.
    .PARAMETER Cipherpriority
        cipher priority.
    .PARAMETER PassThru
        Return details about the created sslprofile_sslcipher_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslprofileSslcipherBinding -name <string>
        An example how to add sslprofile_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslprofileSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Ciphername,

        [double]$Cipherpriority,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslprofileSslcipherBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSCmdlet.ShouldProcess("sslprofile_sslcipher_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslprofile_sslcipher_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofileSslcipherBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslprofileSslcipherBinding: Finished"
    }
}

function Invoke-NSDeleteSslprofileSslcipherBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Ciphername
        Name of the cipher.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslprofileSslcipherBinding -Name <string>
        An example how to delete sslprofile_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslprofileSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslprofileSslcipherBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslprofileSslcipherBinding: Finished"
    }
}

function Invoke-NSGetSslprofileSslcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER GetAll
        Retrieve all sslprofile_sslcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_sslcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcipherBinding -GetAll
        Get all sslprofile_sslcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcipherBinding -Count
        Get the number of sslprofile_sslcipher_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcipherBinding -name <string>
        Get sslprofile_sslcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslcipherBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_sslcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileSslcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_sslcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_sslcipher_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_sslcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileSslcipherBinding: Ended"
    }
}

function Invoke-NSAddSslprofileSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .PARAMETER Cipherpriority
        cipher priority.
    .PARAMETER PassThru
        Return details about the created sslprofile_sslciphersuite_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslprofileSslciphersuiteBinding -name <string>
        An example how to add sslprofile_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslprofileSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateLength(1, 127)]
        [string]$Name,

        [string]$Ciphername,

        [double]$Cipherpriority,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslprofileSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSBoundParameters.ContainsKey('cipherpriority') ) { $payload.Add('cipherpriority', $cipherpriority) }
            if ( $PSCmdlet.ShouldProcess("sslprofile_sslciphersuite_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslprofile_sslciphersuite_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslprofileSslciphersuiteBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslprofileSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSDeleteSslprofileSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslprofileSslciphersuiteBinding -Name <string>
        An example how to delete sslprofile_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslprofileSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Name,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslprofileSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $name -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslprofileSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSGetSslprofileSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER GetAll
        Retrieve all sslprofile_sslciphersuite_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_sslciphersuite_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslciphersuiteBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslciphersuiteBinding -GetAll
        Get all sslprofile_sslciphersuite_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslciphersuiteBinding -Count
        Get the number of sslprofile_sslciphersuite_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslciphersuiteBinding -name <string>
        Get sslprofile_sslciphersuite_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslciphersuiteBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_sslciphersuite_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileSslciphersuiteBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_sslciphersuite_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_sslciphersuite_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_sslciphersuite_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslciphersuite_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileSslciphersuiteBinding: Ended"
    }
}

function Invoke-NSGetSslprofileSslvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslvserver that can be bound to sslprofile.
    .PARAMETER Name
        Name of the SSL profile.
    .PARAMETER GetAll
        Retrieve all sslprofile_sslvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslprofile_sslvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslvserverBinding -GetAll
        Get all sslprofile_sslvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslvserverBinding -Count
        Get the number of sslprofile_sslvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslvserverBinding -name <string>
        Get sslprofile_sslvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslprofileSslvserverBinding -Filter @{ 'name'='<value>' }
        Get sslprofile_sslvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslprofileSslvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslprofile_sslvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateLength(1, 127)]
        [string]$Name,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslprofileSslvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslprofile_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslprofile_sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslprofile_sslvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslprofile_sslvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslprofile_sslvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslprofile_sslvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslprofileSslvserverBinding: Ended"
    }
}

function Invoke-NSCreateSslrsakey {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for RSA key resource.
    .PARAMETER Keyfile
        Name for and, optionally, path to the RSA key file. /nsconfig/ssl/ is the default path.
    .PARAMETER Bits
        Size, in bits, of the RSA key.
          
        Maximum value = 4096
    .PARAMETER Exponent
        Public exponent for the RSA key. The exponent is part of the cipher algorithm and is required for creating the RSA key.
          
        Possible values = 3, F4
    .PARAMETER Keyform
        Format in which the RSA key file is stored on the appliance.
          
        Possible values = DER, PEM
    .PARAMETER Des
        Encrypt the generated RSA key by using the DES algorithm. On the command line, you are prompted to enter the pass phrase (password) that is used to encrypt the key.
    .PARAMETER Des3
        Encrypt the generated RSA key by using the Triple-DES algorithm. On the command line, you are prompted to enter the pass phrase (password) that is used to encrypt the key.
    .PARAMETER Aes256
        Encrypt the generated RSA key by using the AES algorithm.
    .PARAMETER Password
        Pass phrase to use for encryption if DES or DES3 option is selected.
    .PARAMETER Pkcs8
        Create the private key in PKCS#8 format.
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslrsakey -keyfile <string> -bits <double>
        An example how to create sslrsakey config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslrsakey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslrsakey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Keyfile,

        [Parameter(Mandatory)]
        [double]$Bits,

        [ValidateSet('3', 'F4')]
        [string]$Exponent,

        [ValidateSet('DER', 'PEM')]
        [string]$Keyform,

        [boolean]$Des,

        [boolean]$Des3,

        [boolean]$Aes256,

        [ValidateLength(1, 31)]
        [string]$Password,

        [boolean]$Pkcs8 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslrsakey: Starting"
    }
    process {
        try {
            $payload = @{ keyfile = $keyfile
                bits              = $bits
            }
            if ( $PSBoundParameters.ContainsKey('exponent') ) { $payload.Add('exponent', $exponent) }
            if ( $PSBoundParameters.ContainsKey('keyform') ) { $payload.Add('keyform', $keyform) }
            if ( $PSBoundParameters.ContainsKey('des') ) { $payload.Add('des', $des) }
            if ( $PSBoundParameters.ContainsKey('des3') ) { $payload.Add('des3', $des3) }
            if ( $PSBoundParameters.ContainsKey('aes256') ) { $payload.Add('aes256', $aes256) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('pkcs8') ) { $payload.Add('pkcs8', $pkcs8) }
            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslrsakey -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslrsakey: Finished"
    }
}

function Invoke-NSUpdateSslservice {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL service resource.
    .PARAMETER Servicename
        Name of the SSL service.
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange. This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        Name for and, optionally, path to the PEM-format DH parameter file to be installed. /nsconfig/ssl/ is the default path. This parameter is not applicable when configuring a backend service.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time. This parameter is not applicable when configuring a backend service. Allowed DH count values are 0 and &gt;= 500.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        Refresh count for regeneration of RSA public-key and private-key pair. Zero (0) specifies infinite usage (no refresh).
        This parameter is not applicable when configuring a backend service.
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        URL of the page to which to redirect the client in case of a cipher mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
        This parameter is not applicable when configuring a backend service.
    .PARAMETER Sslv2redirect
        State of SSLv2 Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a protocol version mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslv2url
        URL of the page to which to redirect the client in case of a protocol version mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
        This parameter is not applicable when configuring a backend service.
    .PARAMETER Clientauth
        State of client authentication. In service-based SSL offload, the service terminates the SSL handshake if the SSL client does not provide a valid certificate.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        Type of client authentication. If this parameter is set to MANDATORY, the appliance terminates the SSL handshake if the SSL client does not provide a valid certificate. With the OPTIONAL setting, the appliance requests a certificate from the SSL clients but proceeds with the SSL transaction even if the client presents an invalid certificate.
        This parameter is not applicable when configuring a backend SSL service.
        Caution: Define proper access control policies before changing this setting to Optional.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL service.
          
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
          
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is set to ENABLED, and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl2
        State of SSLv2 protocol support for the SSL service.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL service.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls1
        State of DTLSv1.0 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls12
        State of DTLSv1.2 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Pushenctrigger
        Trigger encryption on the basis of the PUSH flag value. Available settings function as follows:
        * ALWAYS - Any PUSH packet triggers encryption.
        * IGNORE - Ignore PUSH packet for triggering encryption.
        * MERGE - For a consecutive sequence of PUSH packets, the last PUSH packet triggers encryption.
        * TIMER - PUSH packet triggering encryption is delayed by the time defined in the set ssl parameter command or in the Change Advanced SSL Settings dialog box.
        Possible values = Always, Merge, Ignore, Timer
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Dtlsprofilename
        Name of the DTLS profile that contains DTLS settings for the service.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the service.
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer's certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created sslservice item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslservice -servicename <string>
        An example how to update sslservice config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dh,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Dhfile,

        [double]$Dhcount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dhkeyexpsizelimit,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ersa,

        [double]$Ersacount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessreuse,

        [double]$Sesstimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cipherredirect,

        [string]$Cipherurl,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslv2redirect,

        [string]$Sslv2url,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauth,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Clientcert,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslredirect,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Redirectportrewrite,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl2,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl3,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls11,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls13,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dtls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dtls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Snienable,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ocspstapling,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Serverauth,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Commonname,

        [ValidateSet('Always', 'Merge', 'Ignore', 'Timer')]
        [string]$Pushenctrigger,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify,

        [ValidateLength(1, 127)]
        [string]$Dtlsprofilename,

        [ValidateLength(1, 127)]
        [string]$Sslprofile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Strictsigdigestcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslservice: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('sslv2redirect') ) { $payload.Add('sslv2redirect', $sslv2redirect) }
            if ( $PSBoundParameters.ContainsKey('sslv2url') ) { $payload.Add('sslv2url', $sslv2url) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl2') ) { $payload.Add('ssl2', $ssl2) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('dtls1') ) { $payload.Add('dtls1', $dtls1) }
            if ( $PSBoundParameters.ContainsKey('dtls12') ) { $payload.Add('dtls12', $dtls12) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('pushenctrigger') ) { $payload.Add('pushenctrigger', $pushenctrigger) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('dtlsprofilename') ) { $payload.Add('dtlsprofilename', $dtlsprofilename) }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSCmdlet.ShouldProcess("sslservice", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservice -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslservice: Finished"
    }
}

function Invoke-NSUnsetSslservice {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL service resource.
    .PARAMETER Servicename
        Name of the SSL service.
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange. This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        Name for and, optionally, path to the PEM-format DH parameter file to be installed. /nsconfig/ssl/ is the default path. This parameter is not applicable when configuring a backend service.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time. This parameter is not applicable when configuring a backend service. Allowed DH count values are 0 and &gt;= 500.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        Refresh count for regeneration of RSA public-key and private-key pair. Zero (0) specifies infinite usage (no refresh).
        This parameter is not applicable when configuring a backend service.
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        URL of the page to which to redirect the client in case of a cipher mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
        This parameter is not applicable when configuring a backend service.
    .PARAMETER Sslv2redirect
        State of SSLv2 Redirect. If this parameter is set to ENABLED, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a protocol version mismatch between the virtual server or service and the client.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslv2url
        URL of the page to which to redirect the client in case of a protocol version mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
        This parameter is not applicable when configuring a backend service.
    .PARAMETER Clientauth
        State of client authentication. In service-based SSL offload, the service terminates the SSL handshake if the SSL client does not provide a valid certificate.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        Type of client authentication. If this parameter is set to MANDATORY, the appliance terminates the SSL handshake if the SSL client does not provide a valid certificate. With the OPTIONAL setting, the appliance requests a certificate from the SSL clients but proceeds with the SSL transaction even if the client presents an invalid certificate.
        This parameter is not applicable when configuring a backend SSL service.
        Caution: Define proper access control policies before changing this setting to Optional.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL service.
          
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
          
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is set to ENABLED, and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl2
        State of SSLv2 protocol support for the SSL service.
        This parameter is not applicable when configuring a backend service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL service.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls1
        State of DTLSv1.0 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls12
        State of DTLSv1.2 protocol support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL service.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Dtlsprofilename
        Name of the DTLS profile that contains DTLS settings for the service.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the service.
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer's certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslservice -servicename <string>
        An example how to unset sslservice config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Boolean]$dh,

        [Boolean]$dhfile,

        [Boolean]$dhcount,

        [Boolean]$dhkeyexpsizelimit,

        [Boolean]$ersa,

        [Boolean]$ersacount,

        [Boolean]$sessreuse,

        [Boolean]$sesstimeout,

        [Boolean]$cipherredirect,

        [Boolean]$cipherurl,

        [Boolean]$sslv2redirect,

        [Boolean]$sslv2url,

        [Boolean]$clientauth,

        [Boolean]$clientcert,

        [Boolean]$sslredirect,

        [Boolean]$redirectportrewrite,

        [Boolean]$ssl2,

        [Boolean]$ssl3,

        [Boolean]$tls1,

        [Boolean]$tls11,

        [Boolean]$tls12,

        [Boolean]$tls13,

        [Boolean]$dtls1,

        [Boolean]$dtls12,

        [Boolean]$snienable,

        [Boolean]$ocspstapling,

        [Boolean]$serverauth,

        [Boolean]$commonname,

        [Boolean]$sendclosenotify,

        [Boolean]$dtlsprofilename,

        [Boolean]$sslprofile,

        [Boolean]$strictsigdigestcheck 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslservice: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('sslv2redirect') ) { $payload.Add('sslv2redirect', $sslv2redirect) }
            if ( $PSBoundParameters.ContainsKey('sslv2url') ) { $payload.Add('sslv2url', $sslv2url) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl2') ) { $payload.Add('ssl2', $ssl2) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('dtls1') ) { $payload.Add('dtls1', $dtls1) }
            if ( $PSBoundParameters.ContainsKey('dtls12') ) { $payload.Add('dtls12', $dtls12) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('dtlsprofilename') ) { $payload.Add('dtlsprofilename', $dtlsprofilename) }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslservice -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslservice: Finished"
    }
}

function Invoke-NSGetSslservice {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL service resource.
    .PARAMETER Servicename
        Name of the SSL service.
    .PARAMETER GetAll
        Retrieve all sslservice object(s).
    .PARAMETER Count
        If specified, the count of the sslservice object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservice
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservice -GetAll
        Get all sslservice data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservice -Count
        Get the number of sslservice objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservice -name <string>
        Get sslservice object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservice -Filter @{ 'name'='<value>' }
        Get sslservice data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslservice: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslservice objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservice: Ended"
    }
}

function Invoke-NSGetSslserviceBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslservice_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceBinding -GetAll
        Get all sslservice_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceBinding -name <string>
        Get sslservice_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceBinding -Filter @{ 'name'='<value>' }
        Get sslservice_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceBinding: Ended"
    }
}

function Invoke-NSAddSslserviceEcccurveBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ecccurvename
        Named ECC curve bound to service/vserver.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .PARAMETER PassThru
        Return details about the created sslservice_ecccurve_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslserviceEcccurveBinding -servicename <string>
        An example how to add sslservice_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslserviceEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [ValidateSet('ALL', 'P_224', 'P_256', 'P_384', 'P_521')]
        [string]$Ecccurvename,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslserviceEcccurveBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('ecccurvename') ) { $payload.Add('ecccurvename', $ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("sslservice_ecccurve_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice_ecccurve_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslserviceEcccurveBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslserviceEcccurveBinding: Finished"
    }
}

function Invoke-NSDeleteSslserviceEcccurveBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ecccurvename
        Named ECC curve bound to service/vserver.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslserviceEcccurveBinding -Servicename <string>
        An example how to delete sslservice_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslserviceEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicename,

        [string]$Ecccurvename 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslserviceEcccurveBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ecccurvename') ) { $arguments.Add('ecccurvename', $Ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Resource $servicename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslserviceEcccurveBinding: Finished"
    }
}

function Invoke-NSGetSslserviceEcccurveBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservice_ecccurve_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_ecccurve_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceEcccurveBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceEcccurveBinding -GetAll
        Get all sslservice_ecccurve_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceEcccurveBinding -Count
        Get the number of sslservice_ecccurve_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceEcccurveBinding -name <string>
        Get sslservice_ecccurve_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceEcccurveBinding -Filter @{ 'name'='<value>' }
        Get sslservice_ecccurve_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceEcccurveBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_ecccurve_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_ecccurve_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_ecccurve_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_ecccurve_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceEcccurveBinding: Ended"
    }
}

function Invoke-NSAddSslserviceSslcertkeyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Certkeyname
        The certificate key pair binding.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Skipcaname
        The flag is used to indicate whether this particular CA certificate's CA_Name needs to be sent to the SSL client while requesting for client certificate in a SSL handshake.
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .PARAMETER Ocspcheck
        Rule to use for the OCSP responder associated with the CA certificate during client authentication. If MANDATORY is specified, deny all SSL clients if the OCSP check fails because of connectivity issues with the remote OCSP server, or any other reason that prevents the OCSP check. With the OPTIONAL setting, allow SSL clients even if the OCSP check fails except when the client certificate is revoked.
        Possible values = Mandatory, Optional
    .PARAMETER PassThru
        Return details about the created sslservice_sslcertkey_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslserviceSslcertkeyBinding -servicename <string>
        An example how to add sslservice_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslserviceSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [string]$Certkeyname,

        [boolean]$Ca,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Crlcheck,

        [boolean]$Skipcaname,

        [boolean]$Snicert,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Ocspcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslserviceSslcertkeyBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('certkeyname') ) { $payload.Add('certkeyname', $certkeyname) }
            if ( $PSBoundParameters.ContainsKey('ca') ) { $payload.Add('ca', $ca) }
            if ( $PSBoundParameters.ContainsKey('crlcheck') ) { $payload.Add('crlcheck', $crlcheck) }
            if ( $PSBoundParameters.ContainsKey('skipcaname') ) { $payload.Add('skipcaname', $skipcaname) }
            if ( $PSBoundParameters.ContainsKey('snicert') ) { $payload.Add('snicert', $snicert) }
            if ( $PSBoundParameters.ContainsKey('ocspcheck') ) { $payload.Add('ocspcheck', $ocspcheck) }
            if ( $PSCmdlet.ShouldProcess("sslservice_sslcertkey_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice_sslcertkey_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslserviceSslcertkeyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslserviceSslcertkeyBinding: Finished"
    }
}

function Invoke-NSDeleteSslserviceSslcertkeyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Certkeyname
        The certificate key pair binding.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslserviceSslcertkeyBinding -Servicename <string>
        An example how to delete sslservice_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslserviceSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicename,

        [string]$Certkeyname,

        [boolean]$Ca,

        [string]$Crlcheck,

        [boolean]$Snicert 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslserviceSslcertkeyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Certkeyname') ) { $arguments.Add('certkeyname', $Certkeyname) }
            if ( $PSBoundParameters.ContainsKey('Ca') ) { $arguments.Add('ca', $Ca) }
            if ( $PSBoundParameters.ContainsKey('Crlcheck') ) { $arguments.Add('crlcheck', $Crlcheck) }
            if ( $PSBoundParameters.ContainsKey('Snicert') ) { $arguments.Add('snicert', $Snicert) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Resource $servicename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslserviceSslcertkeyBinding: Finished"
    }
}

function Invoke-NSGetSslserviceSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservice_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcertkeyBinding -GetAll
        Get all sslservice_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcertkeyBinding -Count
        Get the number of sslservice_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcertkeyBinding -name <string>
        Get sslservice_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslservice_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_sslcertkey_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceSslcertkeyBinding: Ended"
    }
}

function Invoke-NSAddSslserviceSslcipherBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ciphername
        Name of the individual cipher, user-defined cipher group, or predefined (built-in) cipher alias.
    .PARAMETER PassThru
        Return details about the created sslservice_sslcipher_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslserviceSslcipherBinding -servicename <string>
        An example how to add sslservice_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslserviceSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslserviceSslcipherBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslservice_sslcipher_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice_sslcipher_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslserviceSslcipherBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslserviceSslcipherBinding: Finished"
    }
}

function Invoke-NSDeleteSslserviceSslcipherBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ciphername
        Name of the individual cipher, user-defined cipher group, or predefined (built-in) cipher alias.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslserviceSslcipherBinding -Servicename <string>
        An example how to delete sslservice_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslserviceSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicename,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslserviceSslcipherBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Resource $servicename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslserviceSslcipherBinding: Finished"
    }
}

function Invoke-NSGetSslserviceSslcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservice_sslcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_sslcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcipherBinding -GetAll
        Get all sslservice_sslcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcipherBinding -Count
        Get the number of sslservice_sslcipher_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcipherBinding -name <string>
        Get sslservice_sslcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslcipherBinding -Filter @{ 'name'='<value>' }
        Get sslservice_sslcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceSslcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_sslcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_sslcipher_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_sslcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceSslcipherBinding: Ended"
    }
}

function Invoke-NSAddSslserviceSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .PARAMETER PassThru
        Return details about the created sslservice_sslciphersuite_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslserviceSslciphersuiteBinding -servicename <string>
        An example how to add sslservice_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslserviceSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslserviceSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslservice_sslciphersuite_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice_sslciphersuite_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslserviceSslciphersuiteBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslserviceSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSDeleteSslserviceSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslserviceSslciphersuiteBinding -Servicename <string>
        An example how to delete sslservice_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslserviceSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicename,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslserviceSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $servicename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslserviceSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSGetSslserviceSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservice_sslciphersuite_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_sslciphersuite_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslciphersuiteBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslciphersuiteBinding -GetAll
        Get all sslservice_sslciphersuite_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslciphersuiteBinding -Count
        Get the number of sslservice_sslciphersuite_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslciphersuiteBinding -name <string>
        Get sslservice_sslciphersuite_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslciphersuiteBinding -Filter @{ 'name'='<value>' }
        Get sslservice_sslciphersuite_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceSslciphersuiteBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_sslciphersuite_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_sslciphersuite_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_sslciphersuite_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslciphersuite_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceSslciphersuiteBinding: Ended"
    }
}

function Invoke-NSAddSslserviceSslpolicyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Policyname
        The SSL policy binding.
    .PARAMETER Priority
        The priority of the policies bound to this SSL service.
          
        Maximum value = 65534
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Invoke
        Invoke flag. This attribute is relevant only for ADVANCED policies.
    .PARAMETER Labeltype
        Type of policy label invocation.
        Possible values = vserver, service, policylabel
    .PARAMETER Labelname
        Name of the label to invoke if the current policy rule evaluates to TRUE.
    .PARAMETER PassThru
        Return details about the created sslservice_sslpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslserviceSslpolicyBinding -servicename <string>
        An example how to add sslservice_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslserviceSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [string]$Policyname,

        [double]$Priority,

        [string]$Gotopriorityexpression,

        [boolean]$Invoke,

        [ValidateSet('vserver', 'service', 'policylabel')]
        [string]$Labeltype,

        [string]$Labelname,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslserviceSslpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicename = $servicename }
            if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('invoke') ) { $payload.Add('invoke', $invoke) }
            if ( $PSBoundParameters.ContainsKey('labeltype') ) { $payload.Add('labeltype', $labeltype) }
            if ( $PSBoundParameters.ContainsKey('labelname') ) { $payload.Add('labelname', $labelname) }
            if ( $PSCmdlet.ShouldProcess("sslservice_sslpolicy_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservice_sslpolicy_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslserviceSslpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslserviceSslpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteSslserviceSslpolicyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER Policyname
        The SSL policy binding.
    .PARAMETER Priority
        The priority of the policies bound to this SSL service.
          
        Maximum value = 65534
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslserviceSslpolicyBinding -Servicename <string>
        An example how to delete sslservice_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslserviceSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicename,

        [string]$Policyname,

        [double]$Priority 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslserviceSslpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) }
            if ( $PSBoundParameters.ContainsKey('Priority') ) { $arguments.Add('priority', $Priority) }
            if ( $PSCmdlet.ShouldProcess("$servicename", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Resource $servicename -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslserviceSslpolicyBinding: Finished"
    }
}

function Invoke-NSGetSslserviceSslpolicyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslservice.
    .PARAMETER Servicename
        Name of the SSL service for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservice_sslpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservice_sslpolicy_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslpolicyBinding -GetAll
        Get all sslservice_sslpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslpolicyBinding -Count
        Get the number of sslservice_sslpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslpolicyBinding -name <string>
        Get sslservice_sslpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslserviceSslpolicyBinding -Filter @{ 'name'='<value>' }
        Get sslservice_sslpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslserviceSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservice_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicename,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslserviceSslpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservice_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservice_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservice_sslpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservice_sslpolicy_binding configuration for property 'servicename'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Resource $servicename -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservice_sslpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservice_sslpolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslserviceSslpolicyBinding: Ended"
    }
}

function Invoke-NSUpdateSslservicegroup {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL service group resource.
    .PARAMETER Servicegroupname
        Name of the SSL service group for which to set advanced configuration.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the Service Group.
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL service group.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the service. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer's certificate is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created sslservicegroup item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslservicegroup -servicegroupname <string>
        An example how to update sslservicegroup config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslservicegroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [ValidateLength(1, 127)]
        [string]$Sslprofile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessreuse,

        [double]$Sesstimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl3,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls11,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls13,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Snienable,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ocspstapling,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Serverauth,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Commonname,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Strictsigdigestcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslservicegroup: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSCmdlet.ShouldProcess("sslservicegroup", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservicegroup -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservicegroup -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslservicegroup: Finished"
    }
}

function Invoke-NSUnsetSslservicegroup {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL service group resource.
    .PARAMETER Servicegroupname
        Name of the SSL service group for which to set advanced configuration.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the Service Group.
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL service group.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the service. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Serverauth
        State of server authentication support for the SSL service group.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Commonname
        Name to be checked against the CommonName (CN) field in the server certificate bound to the SSL server.
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer's certificate is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslservicegroup -servicegroupname <string>
        An example how to unset sslservicegroup config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslservicegroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Boolean]$sslprofile,

        [Boolean]$sessreuse,

        [Boolean]$sesstimeout,

        [Boolean]$ssl3,

        [Boolean]$tls1,

        [Boolean]$tls11,

        [Boolean]$tls12,

        [Boolean]$tls13,

        [Boolean]$snienable,

        [Boolean]$ocspstapling,

        [Boolean]$serverauth,

        [Boolean]$commonname,

        [Boolean]$sendclosenotify,

        [Boolean]$strictsigdigestcheck 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslservicegroup: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('serverauth') ) { $payload.Add('serverauth', $serverauth) }
            if ( $PSBoundParameters.ContainsKey('commonname') ) { $payload.Add('commonname', $commonname) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSCmdlet.ShouldProcess("$servicegroupname", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslservicegroup -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslservicegroup: Finished"
    }
}

function Invoke-NSGetSslservicegroup {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL service group resource.
    .PARAMETER Servicegroupname
        Name of the SSL service group for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslservicegroup object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroup
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroup -GetAll
        Get all sslservicegroup data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroup -Count
        Get the number of sslservicegroup objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroup -name <string>
        Get sslservicegroup object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroup -Filter @{ 'name'='<value>' }
        Get sslservicegroup data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroup
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroup: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslservicegroup objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroup: Ended"
    }
}

function Invoke-NSGetSslservicegroupBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslservicegroup.
    .PARAMETER Servicegroupname
        Name of the SSL service group for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslservicegroup_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupBinding -GetAll
        Get all sslservicegroup_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupBinding -name <string>
        Get sslservicegroup_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupBinding -Filter @{ 'name'='<value>' }
        Get sslservicegroup_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroupBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroupBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservicegroup_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup_binding configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroupBinding: Ended"
    }
}

function Invoke-NSAddSslservicegroupEcccurveBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ecccurvename
        Named ECC curve bound to servicegroup.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .PARAMETER PassThru
        Return details about the created sslservicegroup_ecccurve_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslservicegroupEcccurveBinding -servicegroupname <string>
        An example how to add sslservicegroup_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslservicegroupEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [ValidateSet('ALL', 'P_224', 'P_256', 'P_384', 'P_521')]
        [string]$Ecccurvename,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslservicegroupEcccurveBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('ecccurvename') ) { $payload.Add('ecccurvename', $ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("sslservicegroup_ecccurve_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservicegroup_ecccurve_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservicegroupEcccurveBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslservicegroupEcccurveBinding: Finished"
    }
}

function Invoke-NSDeleteSslservicegroupEcccurveBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ecccurvename
        Named ECC curve bound to servicegroup.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslservicegroupEcccurveBinding -Servicegroupname <string>
        An example how to delete sslservicegroup_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslservicegroupEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicegroupname,

        [string]$Ecccurvename 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslservicegroupEcccurveBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ecccurvename') ) { $arguments.Add('ecccurvename', $Ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("$servicegroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslservicegroupEcccurveBinding: Finished"
    }
}

function Invoke-NSGetSslservicegroupEcccurveBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER GetAll
        Retrieve all sslservicegroup_ecccurve_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup_ecccurve_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupEcccurveBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupEcccurveBinding -GetAll
        Get all sslservicegroup_ecccurve_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupEcccurveBinding -Count
        Get the number of sslservicegroup_ecccurve_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupEcccurveBinding -name <string>
        Get sslservicegroup_ecccurve_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupEcccurveBinding -Filter @{ 'name'='<value>' }
        Get sslservicegroup_ecccurve_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroupEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroupEcccurveBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservicegroup_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup_ecccurve_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup_ecccurve_binding configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup_ecccurve_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_ecccurve_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroupEcccurveBinding: Ended"
    }
}

function Invoke-NSAddSslservicegroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Certkeyname
        The name of the certificate bound to the SSL service group.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .PARAMETER Ocspcheck
        The state of the OCSP check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER PassThru
        Return details about the created sslservicegroup_sslcertkey_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslservicegroupSslcertkeyBinding -servicegroupname <string>
        An example how to add sslservicegroup_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslservicegroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [string]$Certkeyname,

        [boolean]$Ca,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Crlcheck,

        [boolean]$Snicert,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Ocspcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslservicegroupSslcertkeyBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('certkeyname') ) { $payload.Add('certkeyname', $certkeyname) }
            if ( $PSBoundParameters.ContainsKey('ca') ) { $payload.Add('ca', $ca) }
            if ( $PSBoundParameters.ContainsKey('crlcheck') ) { $payload.Add('crlcheck', $crlcheck) }
            if ( $PSBoundParameters.ContainsKey('snicert') ) { $payload.Add('snicert', $snicert) }
            if ( $PSBoundParameters.ContainsKey('ocspcheck') ) { $payload.Add('ocspcheck', $ocspcheck) }
            if ( $PSCmdlet.ShouldProcess("sslservicegroup_sslcertkey_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservicegroup_sslcertkey_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservicegroupSslcertkeyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslservicegroupSslcertkeyBinding: Finished"
    }
}

function Invoke-NSDeleteSslservicegroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Certkeyname
        The name of the certificate bound to the SSL service group.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslservicegroupSslcertkeyBinding -Servicegroupname <string>
        An example how to delete sslservicegroup_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslservicegroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicegroupname,

        [string]$Certkeyname,

        [boolean]$Ca,

        [string]$Crlcheck,

        [boolean]$Snicert 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslcertkeyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Certkeyname') ) { $arguments.Add('certkeyname', $Certkeyname) }
            if ( $PSBoundParameters.ContainsKey('Ca') ) { $arguments.Add('ca', $Ca) }
            if ( $PSBoundParameters.ContainsKey('Crlcheck') ) { $arguments.Add('crlcheck', $Crlcheck) }
            if ( $PSBoundParameters.ContainsKey('Snicert') ) { $arguments.Add('snicert', $Snicert) }
            if ( $PSCmdlet.ShouldProcess("$servicegroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslcertkeyBinding: Finished"
    }
}

function Invoke-NSGetSslservicegroupSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER GetAll
        Retrieve all sslservicegroup_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcertkeyBinding -GetAll
        Get all sslservicegroup_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcertkeyBinding -Count
        Get the number of sslservicegroup_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcertkeyBinding -name <string>
        Get sslservicegroup_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslservicegroup_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroupSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroupSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservicegroup_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup_sslcertkey_binding configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroupSslcertkeyBinding: Ended"
    }
}

function Invoke-NSAddSslservicegroupSslcipherBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ciphername
        A cipher-suite can consist of an individual cipher name, the system predefined cipher-alias name, or user defined cipher-group name.
    .PARAMETER PassThru
        Return details about the created sslservicegroup_sslcipher_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslservicegroupSslcipherBinding -servicegroupname <string>
        An example how to add sslservicegroup_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslservicegroupSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslservicegroupSslcipherBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslservicegroup_sslcipher_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservicegroup_sslcipher_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservicegroupSslcipherBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslservicegroupSslcipherBinding: Finished"
    }
}

function Invoke-NSDeleteSslservicegroupSslcipherBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ciphername
        A cipher-suite can consist of an individual cipher name, the system predefined cipher-alias name, or user defined cipher-group name.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslservicegroupSslcipherBinding -Servicegroupname <string>
        An example how to delete sslservicegroup_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslservicegroupSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicegroupname,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslcipherBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$servicegroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslcipherBinding: Finished"
    }
}

function Invoke-NSGetSslservicegroupSslcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER GetAll
        Retrieve all sslservicegroup_sslcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup_sslcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcipherBinding -GetAll
        Get all sslservicegroup_sslcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcipherBinding -Count
        Get the number of sslservicegroup_sslcipher_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcipherBinding -name <string>
        Get sslservicegroup_sslcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslcipherBinding -Filter @{ 'name'='<value>' }
        Get sslservicegroup_sslcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroupSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroupSslcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservicegroup_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup_sslcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup_sslcipher_binding configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup_sslcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroupSslcipherBinding: Ended"
    }
}

function Invoke-NSAddSslservicegroupSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ciphername
        The name of the cipher group/alias/name configured for the SSL service group.
    .PARAMETER PassThru
        Return details about the created sslservicegroup_sslciphersuite_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslservicegroupSslciphersuiteBinding -servicegroupname <string>
        An example how to add sslservicegroup_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslservicegroupSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslservicegroupSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $payload = @{ servicegroupname = $servicegroupname }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslservicegroup_sslciphersuite_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslservicegroup_sslciphersuite_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslservicegroupSslciphersuiteBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslservicegroupSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSDeleteSslservicegroupSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER Ciphername
        The name of the cipher group/alias/name configured for the SSL service group.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslservicegroupSslciphersuiteBinding -Servicegroupname <string>
        An example how to delete sslservicegroup_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslservicegroupSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Servicegroupname,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$servicegroupname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslservicegroupSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSGetSslservicegroupSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslservicegroup.
    .PARAMETER Servicegroupname
        The name of the SSL service to which the SSL policy needs to be bound.
    .PARAMETER GetAll
        Retrieve all sslservicegroup_sslciphersuite_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslservicegroup_sslciphersuite_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslciphersuiteBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslciphersuiteBinding -GetAll
        Get all sslservicegroup_sslciphersuite_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslciphersuiteBinding -Count
        Get the number of sslservicegroup_sslciphersuite_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslciphersuiteBinding -name <string>
        Get sslservicegroup_sslciphersuite_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslservicegroupSslciphersuiteBinding -Filter @{ 'name'='<value>' }
        Get sslservicegroup_sslciphersuite_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslservicegroupSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslservicegroup_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Servicegroupname,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslservicegroupSslciphersuiteBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslservicegroup_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslservicegroup_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslservicegroup_sslciphersuite_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslservicegroup_sslciphersuite_binding configuration for property 'servicegroupname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $servicegroupname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslservicegroup_sslciphersuite_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslservicegroup_sslciphersuite_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslservicegroupSslciphersuiteBinding: Ended"
    }
}

function Invoke-NSUpdateSslvserver {
    <#
    .SYNOPSIS
        Update SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL virtual server resource.
    .PARAMETER Vservername
        Name of the SSL virtual server for which to set advanced configuration.
    .PARAMETER Cleartextport
        Port on which clear-text data is sent by the appliance to the server. Do not specify this parameter for SSL offloading with end-to-end encryption.
          
          
        Maximum value = 65534
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        Name of and, optionally, path to the DH parameter file, in PEM format, to be installed. /nsconfig/ssl/ is the default path.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        Refresh count for regeneration of the RSA public-key and private-key pair. Zero (0) specifies infinite usage (no refresh).
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If cipher redirect is enabled, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        The redirect URL to be used with the Cipher Redirect feature.
    .PARAMETER Sslv2redirect
        State of SSLv2 Redirect. If SSLv2 redirect is enabled, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a protocol version mismatch between the virtual server or service and the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslv2url
        URL of the page to which to redirect the client in case of a protocol version mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
    .PARAMETER Clientauth
        State of client authentication. If client authentication is enabled, the virtual server terminates the SSL handshake if the SSL client does not provide a valid certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        Type of client authentication. If this parameter is set to MANDATORY, the appliance terminates the SSL handshake if the SSL client does not provide a valid certificate. With the OPTIONAL setting, the appliance requests a certificate from the SSL clients but proceeds with the SSL transaction even if the client presents an invalid certificate.
        Caution: Define proper access control policies before changing this setting to Optional.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL virtual server.
          
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is ENABLED and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl2
        State of SSLv2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL Virtual Server.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls1
        State of DTLSv1.0 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls12
        State of DTLSv1.2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Pushenctrigger
        Trigger encryption on the basis of the PUSH flag value. Available settings function as follows:
        * ALWAYS - Any PUSH packet triggers encryption.
        * IGNORE - Ignore PUSH packet for triggering encryption.
        * MERGE - For a consecutive sequence of PUSH packets, the last PUSH packet triggers encryption.
        * TIMER - PUSH packet triggering encryption is delayed by the time defined in the set ssl parameter command or in the Change Advanced SSL Settings dialog box.
        Possible values = Always, Merge, Ignore, Timer
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Dtlsprofilename
        Name of the DTLS profile whose settings are to be applied to the virtual server.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the virtual server.
    .PARAMETER Hsts
        State of HSTS protocol support for the SSL Virtual Server. Using HSTS, a server can enforce the use of an HTTPS connection for all communication with a client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxage
        Set the maximum time, in seconds, in the strict transport security (STS) header during which the client must send only HTTPS requests to the server.
          
          
        Maximum value = 4294967294
    .PARAMETER Includesubdomains
        Enable HSTS for subdomains. If set to Yes, a client must send only HTTPS requests for subdomains.
          
        Possible values = YES, NO
    .PARAMETER Preload
        Flag indicates the consent of the site owner to have their domain preloaded.
          
        Possible values = YES, NO
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer entity certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Zerorttearlydata
        State of TLS 1.3 0-RTT early data support for the SSL Virtual Server. This setting only has an effect if resumption is enabled, as early data cannot be sent along with an initial handshake.
        Early application data has significantly different security properties - in particular there is no guarantee that the data cannot be replayed.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13sessionticketsperauthcontext
        Number of tickets the SSL Virtual Server will issue anytime TLS 1.3 is negotiated, ticket-based resumption is enabled, and either (1) a handshake completes or (2) post-handhsake client auth completes.
        This value can be increased to enable clients to open multiple parallel connections using a fresh ticket for each connection.
        No tickets are sent if resumption is disabled.
          
          
        Maximum value = 10
    .PARAMETER Dhekeyexchangewithpsk
        Whether or not the SSL Virtual Server will require a DHE key exchange to occur when a PSK is accepted during a TLS 1.3 resumption handshake.
        A DHE key exchange ensures forward secrecy even in the event that ticket keys are compromised, at the expense of an additional round trip and resources required to carry out the DHE key exchange.
        If disabled, a DHE key exchange will be performed when a PSK is accepted but only if requested by the client.
        If enabled, the server will require a DHE key exchange when a PSK is accepted regardless of whether the client supports combined PSK-DHE key exchange. This setting only has an effect when resumption is enabled.
          
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created sslvserver item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateSslvserver -vservername <string>
        An example how to update sslvserver config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateSslvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [int]$Cleartextport,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dh,

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Dhfile,

        [double]$Dhcount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dhkeyexpsizelimit,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ersa,

        [double]$Ersacount,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sessreuse,

        [double]$Sesstimeout,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Cipherredirect,

        [string]$Cipherurl,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslv2redirect,

        [string]$Sslv2url,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Clientauth,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Clientcert,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Sslredirect,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Redirectportrewrite,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl2,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ssl3,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls11,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Tls13,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dtls1,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Dtls12,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Snienable,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Ocspstapling,

        [ValidateSet('Always', 'Merge', 'Ignore', 'Timer')]
        [string]$Pushenctrigger,

        [ValidateSet('YES', 'NO')]
        [string]$Sendclosenotify,

        [ValidateLength(1, 127)]
        [string]$Dtlsprofilename,

        [ValidateLength(1, 127)]
        [string]$Sslprofile,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Hsts,

        [double]$Maxage,

        [ValidateSet('YES', 'NO')]
        [string]$Includesubdomains,

        [ValidateSet('YES', 'NO')]
        [string]$Preload,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Strictsigdigestcheck,

        [ValidateSet('ENABLED', 'DISABLED')]
        [string]$Zerorttearlydata,

        [double]$Tls13sessionticketsperauthcontext,

        [ValidateSet('YES', 'NO')]
        [string]$Dhekeyexchangewithpsk,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateSslvserver: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('cleartextport') ) { $payload.Add('cleartextport', $cleartextport) }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('sslv2redirect') ) { $payload.Add('sslv2redirect', $sslv2redirect) }
            if ( $PSBoundParameters.ContainsKey('sslv2url') ) { $payload.Add('sslv2url', $sslv2url) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl2') ) { $payload.Add('ssl2', $ssl2) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('dtls1') ) { $payload.Add('dtls1', $dtls1) }
            if ( $PSBoundParameters.ContainsKey('dtls12') ) { $payload.Add('dtls12', $dtls12) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('pushenctrigger') ) { $payload.Add('pushenctrigger', $pushenctrigger) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('dtlsprofilename') ) { $payload.Add('dtlsprofilename', $dtlsprofilename) }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('hsts') ) { $payload.Add('hsts', $hsts) }
            if ( $PSBoundParameters.ContainsKey('maxage') ) { $payload.Add('maxage', $maxage) }
            if ( $PSBoundParameters.ContainsKey('includesubdomains') ) { $payload.Add('includesubdomains', $includesubdomains) }
            if ( $PSBoundParameters.ContainsKey('preload') ) { $payload.Add('preload', $preload) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSBoundParameters.ContainsKey('zerorttearlydata') ) { $payload.Add('zerorttearlydata', $zerorttearlydata) }
            if ( $PSBoundParameters.ContainsKey('tls13sessionticketsperauthcontext') ) { $payload.Add('tls13sessionticketsperauthcontext', $tls13sessionticketsperauthcontext) }
            if ( $PSBoundParameters.ContainsKey('dhekeyexchangewithpsk') ) { $payload.Add('dhekeyexchangewithpsk', $dhekeyexchangewithpsk) }
            if ( $PSCmdlet.ShouldProcess("sslvserver", "Update SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserver -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateSslvserver: Finished"
    }
}

function Invoke-NSUnsetSslvserver {
    <#
    .SYNOPSIS
        Unset SSL Configuration config Object.
    .DESCRIPTION
        Configuration for SSL virtual server resource.
    .PARAMETER Vservername
        Name of the SSL virtual server for which to set advanced configuration.
    .PARAMETER Cleartextport
        Port on which clear-text data is sent by the appliance to the server. Do not specify this parameter for SSL offloading with end-to-end encryption.
          
          
        Maximum value = 65534
    .PARAMETER Dh
        State of Diffie-Hellman (DH) key exchange.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dhfile
        Name of and, optionally, path to the DH parameter file, in PEM format, to be installed. /nsconfig/ssl/ is the default path.
    .PARAMETER Dhcount
        Number of interactions, between the client and the Citrix ADC, after which the DH private-public pair is regenerated. A value of zero (0) specifies refresh every time.
          
        Maximum value = 65534
    .PARAMETER Dhkeyexpsizelimit
        This option enables the use of NIST recommended (NIST Special Publication 800-56A) bit size for private-key size. For example, for DH params of size 2048bit, the private-key size recommended is 224bits. This is rounded-up to 256bits.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersa
        State of Ephemeral RSA (eRSA) key exchange. Ephemeral RSA allows clients that support only export ciphers to communicate with the secure server even if the server certificate does not support export clients. The ephemeral RSA key is automatically generated when you bind an export cipher to an SSL or TCP-based SSL virtual server or service. When you remove the export cipher, the eRSA key is not deleted. It is reused at a later date when another export cipher is bound to an SSL or TCP-based SSL virtual server or service. The eRSA key is deleted when the appliance restarts.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ersacount
        Refresh count for regeneration of the RSA public-key and private-key pair. Zero (0) specifies infinite usage (no refresh).
          
        Maximum value = 65534
    .PARAMETER Sessreuse
        State of session reuse. Establishing the initial handshake requires CPU-intensive public key encryption operations. With the ENABLED setting, session key exchange is avoided for session resumption requests received from the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sesstimeout
        Time, in seconds, for which to keep the session active. Any session resumption request received after the timeout period will require a fresh SSL handshake and establishment of a new SSL session.
          
          
        Maximum value = 4294967294
    .PARAMETER Cipherredirect
        State of Cipher Redirect. If cipher redirect is enabled, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a cipher mismatch between the virtual server or service and the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Cipherurl
        The redirect URL to be used with the Cipher Redirect feature.
    .PARAMETER Sslv2redirect
        State of SSLv2 Redirect. If SSLv2 redirect is enabled, you can configure an SSL virtual server or service to display meaningful error messages if the SSL handshake fails because of a protocol version mismatch between the virtual server or service and the client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sslv2url
        URL of the page to which to redirect the client in case of a protocol version mismatch. Typically, this page has a clear explanation of the error or an alternative location that the transaction can continue from.
    .PARAMETER Clientauth
        State of client authentication. If client authentication is enabled, the virtual server terminates the SSL handshake if the SSL client does not provide a valid certificate.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Clientcert
        Type of client authentication. If this parameter is set to MANDATORY, the appliance terminates the SSL handshake if the SSL client does not provide a valid certificate. With the OPTIONAL setting, the appliance requests a certificate from the SSL clients but proceeds with the SSL transaction even if the client presents an invalid certificate.
        Caution: Define proper access control policies before changing this setting to Optional.
        Possible values = Mandatory, Optional
    .PARAMETER Sslredirect
        State of HTTPS redirects for the SSL virtual server.
          
        For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warning message appears on the screen, prompting the user to continue or disconnect.
        If SSL Redirect is ENABLED, the redirect message is automatically converted from http:// to https:// and the SSL session does not break.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Redirectportrewrite
        State of the port rewrite while performing HTTPS redirect. If this parameter is ENABLED and the URL from the server does not contain the standard port, the port is rewritten to the standard.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl2
        State of SSLv2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ssl3
        State of SSLv3 protocol support for the SSL Virtual Server.
        Note: On platforms with SSL acceleration chips, if the SSL chip does not support SSLv3, this parameter cannot be set to ENABLED.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls1
        State of TLSv1.0 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls11
        State of TLSv1.1 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls12
        State of TLSv1.2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13
        State of TLSv1.3 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls1
        State of DTLSv1.0 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Dtls12
        State of DTLSv1.2 protocol support for the SSL Virtual Server.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Snienable
        State of the Server Name Indication (SNI) feature on the virtual server and service-based offload. SNI helps to enable SSL encryption on multiple domains on a single virtual server or service if the domains are controlled by the same organization and share the same second-level domain name. For example, *.sports.net can be used to secure domains such as login.sports.net and help.sports.net.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Ocspstapling
        State of OCSP stapling support on the SSL virtual server. Supported only if the protocol used is higher than SSLv3. Possible values:
        ENABLED: The appliance sends a request to the OCSP responder to check the status of the server certificate and caches the response for the specified time. If the response is valid at the time of SSL handshake with the client, the OCSP-based server certificate status is sent to the client during the handshake.
        DISABLED: The appliance does not check the status of the server certificate. .
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Sendclosenotify
        Enable sending SSL Close-Notify at the end of a transaction.
          
        Possible values = YES, NO
    .PARAMETER Dtlsprofilename
        Name of the DTLS profile whose settings are to be applied to the virtual server.
    .PARAMETER Sslprofile
        Name of the SSL profile that contains SSL settings for the virtual server.
    .PARAMETER Hsts
        State of HSTS protocol support for the SSL Virtual Server. Using HSTS, a server can enforce the use of an HTTPS connection for all communication with a client.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxage
        Set the maximum time, in seconds, in the strict transport security (STS) header during which the client must send only HTTPS requests to the server.
          
          
        Maximum value = 4294967294
    .PARAMETER Includesubdomains
        Enable HSTS for subdomains. If set to Yes, a client must send only HTTPS requests for subdomains.
          
        Possible values = YES, NO
    .PARAMETER Preload
        Flag indicates the consent of the site owner to have their domain preloaded.
          
        Possible values = YES, NO
    .PARAMETER Strictsigdigestcheck
        Parameter indicating to check whether peer entity certificate during TLS1.2 handshake is signed with one of signature-hash combination supported by Citrix ADC.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Zerorttearlydata
        State of TLS 1.3 0-RTT early data support for the SSL Virtual Server. This setting only has an effect if resumption is enabled, as early data cannot be sent along with an initial handshake.
        Early application data has significantly different security properties - in particular there is no guarantee that the data cannot be replayed.
          
        Possible values = ENABLED, DISABLED
    .PARAMETER Tls13sessionticketsperauthcontext
        Number of tickets the SSL Virtual Server will issue anytime TLS 1.3 is negotiated, ticket-based resumption is enabled, and either (1) a handshake completes or (2) post-handhsake client auth completes.
        This value can be increased to enable clients to open multiple parallel connections using a fresh ticket for each connection.
        No tickets are sent if resumption is disabled.
          
          
        Maximum value = 10
    .PARAMETER Dhekeyexchangewithpsk
        Whether or not the SSL Virtual Server will require a DHE key exchange to occur when a PSK is accepted during a TLS 1.3 resumption handshake.
        A DHE key exchange ensures forward secrecy even in the event that ticket keys are compromised, at the expense of an additional round trip and resources required to carry out the DHE key exchange.
        If disabled, a DHE key exchange will be performed when a PSK is accepted but only if requested by the client.
        If enabled, the server will require a DHE key exchange when a PSK is accepted regardless of whether the client supports combined PSK-DHE key exchange. This setting only has an effect when resumption is enabled.
          
        Possible values = YES, NO
    .EXAMPLE
        PS C:\>Invoke-NSUnsetSslvserver -vservername <string>
        An example how to unset sslvserver config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetSslvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Boolean]$cleartextport,

        [Boolean]$dh,

        [Boolean]$dhfile,

        [Boolean]$dhcount,

        [Boolean]$dhkeyexpsizelimit,

        [Boolean]$ersa,

        [Boolean]$ersacount,

        [Boolean]$sessreuse,

        [Boolean]$sesstimeout,

        [Boolean]$cipherredirect,

        [Boolean]$cipherurl,

        [Boolean]$sslv2redirect,

        [Boolean]$sslv2url,

        [Boolean]$clientauth,

        [Boolean]$clientcert,

        [Boolean]$sslredirect,

        [Boolean]$redirectportrewrite,

        [Boolean]$ssl2,

        [Boolean]$ssl3,

        [Boolean]$tls1,

        [Boolean]$tls11,

        [Boolean]$tls12,

        [Boolean]$tls13,

        [Boolean]$dtls1,

        [Boolean]$dtls12,

        [Boolean]$snienable,

        [Boolean]$ocspstapling,

        [Boolean]$sendclosenotify,

        [Boolean]$dtlsprofilename,

        [Boolean]$sslprofile,

        [Boolean]$hsts,

        [Boolean]$maxage,

        [Boolean]$includesubdomains,

        [Boolean]$preload,

        [Boolean]$strictsigdigestcheck,

        [Boolean]$zerorttearlydata,

        [Boolean]$tls13sessionticketsperauthcontext,

        [Boolean]$dhekeyexchangewithpsk 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetSslvserver: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('cleartextport') ) { $payload.Add('cleartextport', $cleartextport) }
            if ( $PSBoundParameters.ContainsKey('dh') ) { $payload.Add('dh', $dh) }
            if ( $PSBoundParameters.ContainsKey('dhfile') ) { $payload.Add('dhfile', $dhfile) }
            if ( $PSBoundParameters.ContainsKey('dhcount') ) { $payload.Add('dhcount', $dhcount) }
            if ( $PSBoundParameters.ContainsKey('dhkeyexpsizelimit') ) { $payload.Add('dhkeyexpsizelimit', $dhkeyexpsizelimit) }
            if ( $PSBoundParameters.ContainsKey('ersa') ) { $payload.Add('ersa', $ersa) }
            if ( $PSBoundParameters.ContainsKey('ersacount') ) { $payload.Add('ersacount', $ersacount) }
            if ( $PSBoundParameters.ContainsKey('sessreuse') ) { $payload.Add('sessreuse', $sessreuse) }
            if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) }
            if ( $PSBoundParameters.ContainsKey('cipherredirect') ) { $payload.Add('cipherredirect', $cipherredirect) }
            if ( $PSBoundParameters.ContainsKey('cipherurl') ) { $payload.Add('cipherurl', $cipherurl) }
            if ( $PSBoundParameters.ContainsKey('sslv2redirect') ) { $payload.Add('sslv2redirect', $sslv2redirect) }
            if ( $PSBoundParameters.ContainsKey('sslv2url') ) { $payload.Add('sslv2url', $sslv2url) }
            if ( $PSBoundParameters.ContainsKey('clientauth') ) { $payload.Add('clientauth', $clientauth) }
            if ( $PSBoundParameters.ContainsKey('clientcert') ) { $payload.Add('clientcert', $clientcert) }
            if ( $PSBoundParameters.ContainsKey('sslredirect') ) { $payload.Add('sslredirect', $sslredirect) }
            if ( $PSBoundParameters.ContainsKey('redirectportrewrite') ) { $payload.Add('redirectportrewrite', $redirectportrewrite) }
            if ( $PSBoundParameters.ContainsKey('ssl2') ) { $payload.Add('ssl2', $ssl2) }
            if ( $PSBoundParameters.ContainsKey('ssl3') ) { $payload.Add('ssl3', $ssl3) }
            if ( $PSBoundParameters.ContainsKey('tls1') ) { $payload.Add('tls1', $tls1) }
            if ( $PSBoundParameters.ContainsKey('tls11') ) { $payload.Add('tls11', $tls11) }
            if ( $PSBoundParameters.ContainsKey('tls12') ) { $payload.Add('tls12', $tls12) }
            if ( $PSBoundParameters.ContainsKey('tls13') ) { $payload.Add('tls13', $tls13) }
            if ( $PSBoundParameters.ContainsKey('dtls1') ) { $payload.Add('dtls1', $dtls1) }
            if ( $PSBoundParameters.ContainsKey('dtls12') ) { $payload.Add('dtls12', $dtls12) }
            if ( $PSBoundParameters.ContainsKey('snienable') ) { $payload.Add('snienable', $snienable) }
            if ( $PSBoundParameters.ContainsKey('ocspstapling') ) { $payload.Add('ocspstapling', $ocspstapling) }
            if ( $PSBoundParameters.ContainsKey('sendclosenotify') ) { $payload.Add('sendclosenotify', $sendclosenotify) }
            if ( $PSBoundParameters.ContainsKey('dtlsprofilename') ) { $payload.Add('dtlsprofilename', $dtlsprofilename) }
            if ( $PSBoundParameters.ContainsKey('sslprofile') ) { $payload.Add('sslprofile', $sslprofile) }
            if ( $PSBoundParameters.ContainsKey('hsts') ) { $payload.Add('hsts', $hsts) }
            if ( $PSBoundParameters.ContainsKey('maxage') ) { $payload.Add('maxage', $maxage) }
            if ( $PSBoundParameters.ContainsKey('includesubdomains') ) { $payload.Add('includesubdomains', $includesubdomains) }
            if ( $PSBoundParameters.ContainsKey('preload') ) { $payload.Add('preload', $preload) }
            if ( $PSBoundParameters.ContainsKey('strictsigdigestcheck') ) { $payload.Add('strictsigdigestcheck', $strictsigdigestcheck) }
            if ( $PSBoundParameters.ContainsKey('zerorttearlydata') ) { $payload.Add('zerorttearlydata', $zerorttearlydata) }
            if ( $PSBoundParameters.ContainsKey('tls13sessionticketsperauthcontext') ) { $payload.Add('tls13sessionticketsperauthcontext', $tls13sessionticketsperauthcontext) }
            if ( $PSBoundParameters.ContainsKey('dhekeyexchangewithpsk') ) { $payload.Add('dhekeyexchangewithpsk', $dhekeyexchangewithpsk) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Unset SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type sslvserver -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUnsetSslvserver: Finished"
    }
}

function Invoke-NSGetSslvserver {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for SSL virtual server resource.
    .PARAMETER Vservername
        Name of the SSL virtual server for which to set advanced configuration.
    .PARAMETER GetAll
        Retrieve all sslvserver object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserver
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserver -GetAll
        Get all sslvserver data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserver -Count
        Get the number of sslvserver objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserver -name <string>
        Get sslvserver object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserver -Filter @{ 'name'='<value>' }
        Get sslvserver data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Parameter(ParameterSetName = 'Get')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserver: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslvserver objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserver: Ended"
    }
}

function Invoke-NSGetSslvserverBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server for which to show detailed information.
    .PARAMETER GetAll
        Retrieve all sslvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverBinding -GetAll
        Get all sslvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverBinding -name <string>
        Get sslvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverBinding: Ended"
    }
}

function Invoke-NSAddSslvserverEcccurveBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ecccurvename
        Named ECC curve bound to vserver/service.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .PARAMETER PassThru
        Return details about the created sslvserver_ecccurve_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverEcccurveBinding -vservername <string>
        An example how to add sslvserver_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [ValidateSet('ALL', 'P_224', 'P_256', 'P_384', 'P_521')]
        [string]$Ecccurvename,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverEcccurveBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('ecccurvename') ) { $payload.Add('ecccurvename', $ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_ecccurve_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_ecccurve_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverEcccurveBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverEcccurveBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverEcccurveBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ecccurvename
        Named ECC curve bound to vserver/service.
        Possible values = ALL, P_224, P_256, P_384, P_521
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverEcccurveBinding -Vservername <string>
        An example how to delete sslvserver_ecccurve_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Ecccurvename 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverEcccurveBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ecccurvename') ) { $arguments.Add('ecccurvename', $Ecccurvename) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverEcccurveBinding: Finished"
    }
}

function Invoke-NSGetSslvserverEcccurveBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the ecccurve that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_ecccurve_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_ecccurve_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverEcccurveBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverEcccurveBinding -GetAll
        Get all sslvserver_ecccurve_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverEcccurveBinding -Count
        Get the number of sslvserver_ecccurve_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverEcccurveBinding -name <string>
        Get sslvserver_ecccurve_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverEcccurveBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_ecccurve_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverEcccurveBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_ecccurve_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverEcccurveBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_ecccurve_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_ecccurve_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_ecccurve_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_ecccurve_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_ecccurve_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverEcccurveBinding: Ended"
    }
}

function Invoke-NSAddSslvserverSslcertkeyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Certkeyname
        The name of the certificate key pair binding.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Skipcaname
        The flag is used to indicate whether this particular CA certificate's CA_Name needs to be sent to the SSL client while requesting for client certificate in a SSL handshake.
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .PARAMETER Ocspcheck
        The state of the OCSP check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER PassThru
        Return details about the created sslvserver_sslcertkey_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverSslcertkeyBinding -vservername <string>
        An example how to add sslvserver_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [string]$Certkeyname,

        [boolean]$Ca,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Crlcheck,

        [boolean]$Skipcaname,

        [boolean]$Snicert,

        [ValidateSet('Mandatory', 'Optional')]
        [string]$Ocspcheck,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverSslcertkeyBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('certkeyname') ) { $payload.Add('certkeyname', $certkeyname) }
            if ( $PSBoundParameters.ContainsKey('ca') ) { $payload.Add('ca', $ca) }
            if ( $PSBoundParameters.ContainsKey('crlcheck') ) { $payload.Add('crlcheck', $crlcheck) }
            if ( $PSBoundParameters.ContainsKey('skipcaname') ) { $payload.Add('skipcaname', $skipcaname) }
            if ( $PSBoundParameters.ContainsKey('snicert') ) { $payload.Add('snicert', $snicert) }
            if ( $PSBoundParameters.ContainsKey('ocspcheck') ) { $payload.Add('ocspcheck', $ocspcheck) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_sslcertkey_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_sslcertkey_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverSslcertkeyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverSslcertkeyBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverSslcertkeyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Certkeyname
        The name of the certificate key pair binding.
    .PARAMETER Ca
        CA certificate.
    .PARAMETER Crlcheck
        The state of the CRL check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .PARAMETER Snicert
        The name of the CertKey. Use this option to bind Certkey(s) which will be used in SNI processing.
    .PARAMETER Ocspcheck
        The state of the OCSP check parameter. (Mandatory/Optional).
        Possible values = Mandatory, Optional
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverSslcertkeyBinding -Vservername <string>
        An example how to delete sslvserver_sslcertkey_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Certkeyname,

        [boolean]$Ca,

        [string]$Crlcheck,

        [boolean]$Snicert,

        [string]$Ocspcheck 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcertkeyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Certkeyname') ) { $arguments.Add('certkeyname', $Certkeyname) }
            if ( $PSBoundParameters.ContainsKey('Ca') ) { $arguments.Add('ca', $Ca) }
            if ( $PSBoundParameters.ContainsKey('Crlcheck') ) { $arguments.Add('crlcheck', $Crlcheck) }
            if ( $PSBoundParameters.ContainsKey('Snicert') ) { $arguments.Add('snicert', $Snicert) }
            if ( $PSBoundParameters.ContainsKey('Ocspcheck') ) { $arguments.Add('ocspcheck', $Ocspcheck) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcertkeyBinding: Finished"
    }
}

function Invoke-NSGetSslvserverSslcertkeyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkey that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_sslcertkey_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_sslcertkey_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeyBinding -GetAll
        Get all sslvserver_sslcertkey_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeyBinding -Count
        Get the number of sslvserver_sslcertkey_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeyBinding -name <string>
        Get sslvserver_sslcertkey_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeyBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_sslcertkey_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverSslcertkeyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkey_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverSslcertkeyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_sslcertkey_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_sslcertkey_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_sslcertkey_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_sslcertkey_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkey_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverSslcertkeyBinding: Ended"
    }
}

function Invoke-NSAddSslvserverSslcertkeybundleBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkeybundle that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Certkeybundlename
        Certkeybundle name bound to the vserver.
    .PARAMETER Snicertkeybundle
        Use this option to bind certkeybundle which will be used in SNI processing.
    .PARAMETER PassThru
        Return details about the created sslvserver_sslcertkeybundle_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverSslcertkeybundleBinding -vservername <string>
        An example how to add sslvserver_sslcertkeybundle_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverSslcertkeybundleBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkeybundle_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [string]$Certkeybundlename,

        [boolean]$Snicertkeybundle,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverSslcertkeybundleBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('certkeybundlename') ) { $payload.Add('certkeybundlename', $certkeybundlename) }
            if ( $PSBoundParameters.ContainsKey('snicertkeybundle') ) { $payload.Add('snicertkeybundle', $snicertkeybundle) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_sslcertkeybundle_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_sslcertkeybundle_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverSslcertkeybundleBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverSslcertkeybundleBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverSslcertkeybundleBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcertkeybundle that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Certkeybundlename
        Certkeybundle name bound to the vserver.
    .PARAMETER Snicertkeybundle
        Use this option to bind certkeybundle which will be used in SNI processing.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverSslcertkeybundleBinding -Vservername <string>
        An example how to delete sslvserver_sslcertkeybundle_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverSslcertkeybundleBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkeybundle_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Certkeybundlename,

        [boolean]$Snicertkeybundle 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcertkeybundleBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Certkeybundlename') ) { $arguments.Add('certkeybundlename', $Certkeybundlename) }
            if ( $PSBoundParameters.ContainsKey('Snicertkeybundle') ) { $arguments.Add('snicertkeybundle', $Snicertkeybundle) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcertkeybundleBinding: Finished"
    }
}

function Invoke-NSGetSslvserverSslcertkeybundleBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcertkeybundle that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_sslcertkeybundle_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_sslcertkeybundle_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeybundleBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeybundleBinding -GetAll
        Get all sslvserver_sslcertkeybundle_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeybundleBinding -Count
        Get the number of sslvserver_sslcertkeybundle_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeybundleBinding -name <string>
        Get sslvserver_sslcertkeybundle_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcertkeybundleBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_sslcertkeybundle_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverSslcertkeybundleBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcertkeybundle_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverSslcertkeybundleBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_sslcertkeybundle_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_sslcertkeybundle_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_sslcertkeybundle_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_sslcertkeybundle_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_sslcertkeybundle_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcertkeybundle_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverSslcertkeybundleBinding: Ended"
    }
}

function Invoke-NSAddSslvserverSslcipherBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ciphername
        Name of the individual cipher, user-defined cipher group, or predefined (built-in) cipher alias.
    .PARAMETER PassThru
        Return details about the created sslvserver_sslcipher_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverSslcipherBinding -vservername <string>
        An example how to add sslvserver_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverSslcipherBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_sslcipher_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_sslcipher_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverSslcipherBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverSslcipherBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverSslcipherBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ciphername
        Name of the individual cipher, user-defined cipher group, or predefined (built-in) cipher alias.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverSslcipherBinding -Vservername <string>
        An example how to delete sslvserver_sslcipher_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcipherBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverSslcipherBinding: Finished"
    }
}

function Invoke-NSGetSslvserverSslcipherBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslcipher that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_sslcipher_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_sslcipher_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcipherBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcipherBinding -GetAll
        Get all sslvserver_sslcipher_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcipherBinding -Count
        Get the number of sslvserver_sslcipher_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcipherBinding -name <string>
        Get sslvserver_sslcipher_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslcipherBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_sslcipher_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverSslcipherBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslcipher_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverSslcipherBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_sslcipher_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_sslcipher_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_sslcipher_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_sslcipher_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslcipher_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverSslcipherBinding: Ended"
    }
}

function Invoke-NSAddSslvserverSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .PARAMETER PassThru
        Return details about the created sslvserver_sslciphersuite_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverSslciphersuiteBinding -vservername <string>
        An example how to add sslvserver_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [string]$Ciphername,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('ciphername') ) { $payload.Add('ciphername', $ciphername) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_sslciphersuite_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_sslciphersuite_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverSslciphersuiteBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Ciphername
        The cipher group/alias/individual cipher configuration.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverSslciphersuiteBinding -Vservername <string>
        An example how to delete sslvserver_sslciphersuite_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Ciphername 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverSslciphersuiteBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Ciphername') ) { $arguments.Add('ciphername', $Ciphername) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverSslciphersuiteBinding: Finished"
    }
}

function Invoke-NSGetSslvserverSslciphersuiteBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslciphersuite that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_sslciphersuite_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_sslciphersuite_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslciphersuiteBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslciphersuiteBinding -GetAll
        Get all sslvserver_sslciphersuite_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslciphersuiteBinding -Count
        Get the number of sslvserver_sslciphersuite_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslciphersuiteBinding -name <string>
        Get sslvserver_sslciphersuite_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslciphersuiteBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_sslciphersuite_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverSslciphersuiteBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslciphersuite_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverSslciphersuiteBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_sslciphersuite_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_sslciphersuite_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_sslciphersuite_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_sslciphersuite_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslciphersuite_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverSslciphersuiteBinding: Ended"
    }
}

function Invoke-NSAddSslvserverSslpolicyBinding {
    <#
    .SYNOPSIS
        Add SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Policyname
        The name of the SSL policy binding.
    .PARAMETER Priority
        The priority of the policies bound to this SSL service.
          
        Maximum value = 65534
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Invoke
        Invoke flag. This attribute is relevant only for ADVANCED policies.
    .PARAMETER Labeltype
        Type of policy label invocation.
        Possible values = vserver, service, policylabel
    .PARAMETER Labelname
        Name of the label to invoke if the current policy rule evaluates to TRUE.
    .PARAMETER Type
        Bind point to which to bind the policy. Possible Values: REQUEST, INTERCEPT_REQ and CLIENTHELLO_REQ. These bindpoints mean: 1. REQUEST: Policy evaluation will be done at appplication above SSL. This bindpoint is default and is used for actions based on clientauth and client cert. 2. INTERCEPT_REQ: Policy evaluation will be done during SSL handshake to decide whether to intercept or not. Actions allowed with this type are: INTERCEPT, BYPASS and RESET. 3. CLIENTHELLO_REQ: Policy evaluation will be done during handling of Client Hello Request. Action allowed with this type is: RESET, FORWARD and PICKCACERTGRP.
          
        Possible values = INTERCEPT_REQ, REQUEST, CLIENTHELLO_REQ
    .PARAMETER PassThru
        Return details about the created sslvserver_sslpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddSslvserverSslpolicyBinding -vservername <string>
        An example how to add sslvserver_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddSslvserverSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [string]$Policyname,

        [double]$Priority,

        [string]$Gotopriorityexpression,

        [boolean]$Invoke,

        [ValidateSet('vserver', 'service', 'policylabel')]
        [string]$Labeltype,

        [string]$Labelname,

        [ValidateSet('INTERCEPT_REQ', 'REQUEST', 'CLIENTHELLO_REQ')]
        [string]$Type = 'REQUEST',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddSslvserverSslpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ vservername = $vservername }
            if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('invoke') ) { $payload.Add('invoke', $invoke) }
            if ( $PSBoundParameters.ContainsKey('labeltype') ) { $payload.Add('labeltype', $labeltype) }
            if ( $PSBoundParameters.ContainsKey('labelname') ) { $payload.Add('labelname', $labelname) }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSCmdlet.ShouldProcess("sslvserver_sslpolicy_binding", "Add SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type sslvserver_sslpolicy_binding -Payload $payload -GetWarning
                #HTTP Status Code on Success: 201 Created
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                if ( $PSBoundParameters.ContainsKey('PassThru') ) {
                    Write-Output (Invoke-NSGetSslvserverSslpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddSslvserverSslpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteSslvserverSslpolicyBinding {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER Policyname
        The name of the SSL policy binding.
    .PARAMETER Priority
        The priority of the policies bound to this SSL service.
          
        Maximum value = 65534
    .PARAMETER Type
        Bind point to which to bind the policy. Possible Values: REQUEST, INTERCEPT_REQ and CLIENTHELLO_REQ. These bindpoints mean: 1. REQUEST: Policy evaluation will be done at appplication above SSL. This bindpoint is default and is used for actions based on clientauth and client cert. 2. INTERCEPT_REQ: Policy evaluation will be done during SSL handshake to decide whether to intercept or not. Actions allowed with this type are: INTERCEPT, BYPASS and RESET. 3. CLIENTHELLO_REQ: Policy evaluation will be done during handling of Client Hello Request. Action allowed with this type is: RESET, FORWARD and PICKCACERTGRP.
          
        Possible values = INTERCEPT_REQ, REQUEST, CLIENTHELLO_REQ
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslvserverSslpolicyBinding -Vservername <string>
        An example how to delete sslvserver_sslpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslvserverSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Vservername,

        [string]$Policyname,

        [double]$Priority,

        [string]$Type 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslvserverSslpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) }
            if ( $PSBoundParameters.ContainsKey('Priority') ) { $arguments.Add('priority', $Priority) }
            if ( $PSBoundParameters.ContainsKey('Type') ) { $arguments.Add('type', $Type) }
            if ( $PSCmdlet.ShouldProcess("$vservername", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Resource $vservername -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslvserverSslpolicyBinding: Finished"
    }
}

function Invoke-NSGetSslvserverSslpolicyBinding {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Binding object showing the sslpolicy that can be bound to sslvserver.
    .PARAMETER Vservername
        Name of the SSL virtual server.
    .PARAMETER GetAll
        Retrieve all sslvserver_sslpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the sslvserver_sslpolicy_binding object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslpolicyBinding -GetAll
        Get all sslvserver_sslpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslpolicyBinding -Count
        Get the number of sslvserver_sslpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslpolicyBinding -name <string>
        Get sslvserver_sslpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslvserverSslpolicyBinding -Filter @{ 'name'='<value>' }
        Get sslvserver_sslpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslvserverSslpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslvserver_sslpolicy_binding/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'GetByResource')]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Vservername,

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetSslvserverSslpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all sslvserver_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslvserver_sslpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslvserver_sslpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslvserver_sslpolicy_binding configuration for property 'vservername'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Resource $vservername -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving sslvserver_sslpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslvserver_sslpolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslvserverSslpolicyBinding: Ended"
    }
}

function Invoke-NSCreateSslwrapkey {
    <#
    .SYNOPSIS
        Create SSL Configuration config Object.
    .DESCRIPTION
        Configuration for WRAP key resource.
    .PARAMETER Wrapkeyname
        Name for the wrap key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the wrap key is created.
    .PARAMETER Password
        Password string for the wrap key.
    .PARAMETER Salt
        Salt string for the wrap key.
    .EXAMPLE
        PS C:\>Invoke-NSCreateSslwrapkey -wrapkeyname <string> -password <string> -salt <string>
        An example how to create sslwrapkey config Object(s).
    .NOTES
        File Name : Invoke-NSCreateSslwrapkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslwrapkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')]
        [string]$Wrapkeyname,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Password,

        [Parameter(Mandatory)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Salt 

    )
    begin {
        Write-Verbose "Invoke-NSCreateSslwrapkey: Starting"
    }
    process {
        try {
            $payload = @{ wrapkeyname = $wrapkeyname
                password              = $password
                salt                  = $salt
            }

            if ( $PSCmdlet.ShouldProcess($Name, "Create SSL Configuration config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type sslwrapkey -Action create -Payload $payload -GetWarning
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $result
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSCreateSslwrapkey: Finished"
    }
}

function Invoke-NSDeleteSslwrapkey {
    <#
    .SYNOPSIS
        Delete SSL Configuration config Object.
    .DESCRIPTION
        Configuration for WRAP key resource.
    .PARAMETER Wrapkeyname
        Name for the wrap key. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the wrap key is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteSslwrapkey -Wrapkeyname <string>
        An example how to delete sslwrapkey config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteSslwrapkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslwrapkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(Mandatory)]
        [string]$Wrapkeyname 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteSslwrapkey: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$wrapkeyname", "Delete SSL Configuration config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type sslwrapkey -NitroPath nitro/v1/config -Resource $wrapkeyname -Arguments $arguments
                #HTTP Status Code on Success: 200 OK
                #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error
                Write-Output $response
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSDeleteSslwrapkey: Finished"
    }
}

function Invoke-NSGetSslwrapkey {
    <#
    .SYNOPSIS
        Get SSL Configuration config object(s).
    .DESCRIPTION
        Configuration for WRAP key resource.
    .PARAMETER GetAll
        Retrieve all sslwrapkey object(s).
    .PARAMETER Count
        If specified, the count of the sslwrapkey object(s) will be returned.
    .PARAMETER Filter
        Specify a filter.
        -Filter @{ 'name'='<value>' }
    .PARAMETER ViewSummary
        When specified, only a summary of information is returned.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslwrapkey
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslwrapkey -GetAll
        Get all sslwrapkey data.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslwrapkey -Count
        Get the number of sslwrapkey objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslwrapkey -name <string>
        Get sslwrapkey object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetSslwrapkey -Filter @{ 'name'='<value>' }
        Get sslwrapkey data with a filter.
    .NOTES
        File Name : Invoke-NSGetSslwrapkey
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/sslwrapkey/
        Requires : PowerShell v5.1 and up
                    NS 13.x and up.
                    NS 12 and lower may work, not guaranteed (best effort).
    .LINK
        https://blog.j81.nl
    #>

    [CmdletBinding(DefaultParameterSetName = "GetAll")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
    param(
        [Parameter(DontShow)]
        [Object]$NSSession = (Get-NSSession),

        [Parameter(ParameterSetName = 'Count', Mandatory)]
        [Switch]$Count,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll,

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$ViewSummary

    )
    begin {
        Write-Verbose "Invoke-NSGetSslwrapkey: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all sslwrapkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslwrapkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) {
                if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } }
                Write-Verbose "Retrieving total count for sslwrapkey objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslwrapkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving sslwrapkey objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslwrapkey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving sslwrapkey configuration for property ''"

            } else {
                Write-Verbose "Retrieving sslwrapkey configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type sslwrapkey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            $response = $null
        }
        Write-Output $response
    }
    end {
        Write-Verbose "Invoke-NSGetSslwrapkey: Ended"
    }
}

# SIG # Begin signature block
# MIIkmgYJKoZIhvcNAQcCoIIkizCCJIcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDA1ruvNuEkzstn
# lgcEtOd56OSfhcI4mzBJ6EKMUUrx9KCCHl4wggTzMIID26ADAgECAhAsJ03zZBC0
# i/247uUvWN5TMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAkdCMRswGQYDVQQI
# ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoT
# D1NlY3RpZ28gTGltaXRlZDEkMCIGA1UEAxMbU2VjdGlnbyBSU0EgQ29kZSBTaWdu
# aW5nIENBMB4XDTIxMDUwNTAwMDAwMFoXDTI0MDUwNDIzNTk1OVowWzELMAkGA1UE
# BhMCTkwxEjAQBgNVBAcMCVZlbGRob3ZlbjEbMBkGA1UECgwSSm9oYW5uZXMgQmls
# bGVrZW5zMRswGQYDVQQDDBJKb2hhbm5lcyBCaWxsZWtlbnMwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQCsfgRG81keOHalHfCUgxOa1Qy4VNOnGxB8SL8e
# rjP9SfcF13McP7F1HGka5Be495pTZ+duGbaQMNozwg/5Dg9IRJEeBabeSSJJCbZo
# SNpmUu7NNRRfidQxlPC81LxTVHxJ7In0MEfCVm7rWcri28MRCAuafqOfSE+hyb1Z
# /tKyCyQ5RUq3kjs/CF+VfMHsJn6ZT63YqewRkwHuc7UogTTZKjhPJ9prGLTer8UX
# UgvsGRbvhYZXIEuy+bmx/iJ1yRl1kX4nj6gUYzlhemOnlSDD66YOrkLDhXPMXLym
# AN7h0/W5Bo//R5itgvdGBkXkWCKRASnq/9PTcoxW6mwtgU8xAgMBAAGjggGQMIIB
# jDAfBgNVHSMEGDAWgBQO4TqoUzox1Yq+wbutZxoDha00DjAdBgNVHQ4EFgQUZWMy
# gC0i1u2NZ1msk2Mm5nJm5AswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAw
# EwYDVR0lBAwwCgYIKwYBBQUHAwMwEQYJYIZIAYb4QgEBBAQDAgQQMEoGA1UdIARD
# MEEwNQYMKwYBBAGyMQECAQMCMCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8vc2VjdGln
# by5jb20vQ1BTMAgGBmeBDAEEATBDBgNVHR8EPDA6MDigNqA0hjJodHRwOi8vY3Js
# LnNlY3RpZ28uY29tL1NlY3RpZ29SU0FDb2RlU2lnbmluZ0NBLmNybDBzBggrBgEF
# BQcBAQRnMGUwPgYIKwYBBQUHMAKGMmh0dHA6Ly9jcnQuc2VjdGlnby5jb20vU2Vj
# dGlnb1JTQUNvZGVTaWduaW5nQ0EuY3J0MCMGCCsGAQUFBzABhhdodHRwOi8vb2Nz
# cC5zZWN0aWdvLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEARjv9ieRocb1DXRWm3XtY
# jjuSRjlvkoPd9wS6DNfsGlSU42BFd9LCKSyRREZVu8FDq7dN0PhD4bBTT+k6AgrY
# KG6f/8yUponOdxskv850SjN2S2FeVuR20pqActMrpd1+GCylG8mj8RGjdrLQ3QuX
# qYKS68WJ39WWYdVB/8Ftajir5p6sAfwHErLhbJS6WwmYjGI/9SekossvU8mZjZwo
# Gbu+fjZhPc4PhjbEh0ABSsPMfGjQQsg5zLFjg/P+cS6hgYI7qctToo0TexGe32DY
# fFWHrHuBErW2qXEJvzSqM5OtLRD06a4lH5ZkhojhMOX9S8xDs/ArDKgX1j1Xm4Tu
# DjCCBYEwggRpoAMCAQICEDlyRDr5IrdR19NsEN0xNZUwDQYJKoZIhvcNAQEMBQAw
# ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
# A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
# BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0xOTAzMTIwMDAwMDBaFw0y
# ODEyMzEyMzU5NTlaMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKTmV3IEplcnNl
# eTEUMBIGA1UEBxMLSmVyc2V5IENpdHkxHjAcBgNVBAoTFVRoZSBVU0VSVFJVU1Qg
# TmV0d29yazEuMCwGA1UEAxMlVVNFUlRydXN0IFJTQSBDZXJ0aWZpY2F0aW9uIEF1
# dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIASZRc2DsPb
# CLPQrFcNdu3NJ9NMrVCDYeKqIE0JLWQJ3M6Jn8w9qez2z8Hc8dOx1ns3KBErR9o5
# xrw6GbRfpr19naNjQrZ28qk7K5H44m/Q7BYgkAk+4uh0yRi0kdRiZNt/owbxiBhq
# kCI8vP4T8IcUe/bkH47U5FHGEWdGCFHLhhRUP7wz/n5snP8WnRi9UY41pqdmyHJn
# 2yFmsdSbeAPAUDrozPDcvJ5M/q8FljUfV1q3/875PbcstvZU3cjnEjpNrkyKt1ya
# tLcgPcp/IjSufjtoZgFE5wFORlObM2D3lL5TN5BzQ/Myw1Pv26r+dE5px2uMYJPe
# xMcM3+EyrsyTO1F4lWeL7j1W/gzQaQ8bD/MlJmszbfduR/pzQ+V+DqVmsSl8MoRj
# VYnEDcGTVDAZE6zTfTen6106bDVc20HXEtqpSQvf2ICKCZNijrVmzyWIzYS4sT+k
# OQ/ZAp7rEkyVfPNrBaleFoPMuGfi6BOdzFuC00yz7Vv/3uVzrCM7LQC/NVV0CUnY
# SVgaf5I25lGSDvMmfRxNF7zJ7EMm0L9BX0CpRET0medXh55QH1dUqD79dGMvsVBl
# CeZYQi5DGky08CVHWfoEHpPUJkZKUIGy3r54t/xnFeHJV4QeD2PW6WK61l9VLupc
# xigIBCU5uA4rqfJMlxwHPw1S9e3vL4IPAgMBAAGjgfIwge8wHwYDVR0jBBgwFoAU
# oBEKIz6W8Qfs4q8p74Klf9AwpLQwHQYDVR0OBBYEFFN5v1qqK0rPVIDh2JvAnfKy
# A2bLMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MBEGA1UdIAQKMAgw
# BgYEVR0gADBDBgNVHR8EPDA6MDigNqA0hjJodHRwOi8vY3JsLmNvbW9kb2NhLmNv
# bS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDA0BggrBgEFBQcBAQQoMCYwJAYI
# KwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9kb2NhLmNvbTANBgkqhkiG9w0BAQwF
# AAOCAQEAGIdR3HQhPZyK4Ce3M9AuzOzw5steEd4ib5t1jp5y/uTW/qofnJYt7wNK
# fq70jW9yPEM7wD/ruN9cqqnGrvL82O6je0P2hjZ8FODN9Pc//t64tIrwkZb+/UNk
# fv3M0gGhfX34GRnJQisTv1iLuqSiZgR2iJFODIkUzqJNyTKzuugUGrxx8VvwQQuY
# AAoiAxDlDLH5zZI3Ge078eQ6tvlFEyZ1r7uq7z97dzvSxAKRPRkA0xdcOds/exgN
# Rc2ThZYvXd9ZFk8/Ub3VRRg/7UqO6AZhdCMWtQ1QcydER38QXYkqa4UxFMToqWpM
# gLxqeM+4f452cpkMnf7XkQgWoaNflTCCBfUwggPdoAMCAQICEB2iSDBvmyYY0ILg
# ln0z02owDQYJKoZIhvcNAQEMBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpO
# ZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVT
# RVJUUlVTVCBOZXR3b3JrMS4wLAYDVQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmlj
# YXRpb24gQXV0aG9yaXR5MB4XDTE4MTEwMjAwMDAwMFoXDTMwMTIzMTIzNTk1OVow
# fDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
# A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSQwIgYDVQQD
# ExtTZWN0aWdvIFJTQSBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3DQEBAQUA
# A4IBDwAwggEKAoIBAQCGIo0yhXoYn0nwli9jCB4t3HyfFM/jJrYlZilAhlRGdDFi
# xRDtsocnppnLlTDAVvWkdcapDlBipVGREGrgS2Ku/fD4GKyn/+4uMyD6DBmJqGx7
# rQDDYaHcaWVtH24nlteXUYam9CflfGqLlR5bYNV+1xaSnAAvaPeX7Wpyvjg7Y96P
# v25MQV0SIAhZ6DnNj9LWzwa0VwW2TqE+V2sfmLzEYtYbC43HZhtKn52BxHJAteJf
# 7wtF/6POF6YtVbC3sLxUap28jVZTxvC6eVBJLPcDuf4vZTXyIuosB69G2flGHNyM
# fHEo8/6nxhTdVZFuihEN3wYklX0Pp6F8OtqGNWHTAgMBAAGjggFkMIIBYDAfBgNV
# HSMEGDAWgBRTeb9aqitKz1SA4dibwJ3ysgNmyzAdBgNVHQ4EFgQUDuE6qFM6MdWK
# vsG7rWcaA4WtNA4wDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAw
# HQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMIMBEGA1UdIAQKMAgwBgYEVR0g
# ADBQBgNVHR8ESTBHMEWgQ6BBhj9odHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVNF
# UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwdgYIKwYBBQUHAQEE
# ajBoMD8GCCsGAQUFBzAChjNodHRwOi8vY3J0LnVzZXJ0cnVzdC5jb20vVVNFUlRy
# dXN0UlNBQWRkVHJ1c3RDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9vY3NwLnVz
# ZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAE1jUO1HNEphpNveaiqMm/EA
# AB4dYns61zLC9rPgY7P7YQCImhttEAcET7646ol4IusPRuzzRl5ARokS9At3Wpwq
# QTr81vTr5/cVlTPDoYMot94v5JT3hTODLUpASL+awk9KsY8k9LOBN9O3ZLCmI2pZ
# aFJCX/8E6+F0ZXkI9amT3mtxQJmWunjxucjiwwgWsatjWsgVgG10Xkp1fqW4w2y1
# z99KeYdcx0BNYzX2MNPPtQoOCwR/oEuuu6Ol0IQAkz5TXTSlADVpbL6fICUQDRn7
# UJBhvjmPeo5N9p8OHv4HURJmgyYZSJXOSsnBf/M6BZv5b9+If8AjntIeQ3pFMcGc
# TanwWbJZGehqjSkEAnd8S0vNcL46slVaeD68u28DECV3FTSK+TbMQ5Lkuk/xYpMo
# JVcp+1EZx6ElQGqEV8aynbG8HArafGd+fS7pKEwYfsR7MUFxmksp7As9V1DSyt39
# ngVR5UR43QHesXWYDVQk/fBO4+L4g71yuss9Ou7wXheSaG3IYfmm8SoKC6W59J7u
# mDIFhZ7r+YMp08Ysfb06dy6LN0KgaoLtO0qqlBCk4Q34F8W2WnkzGJLjtXX4oemO
# CiUe5B7xn1qHI/+fpFGe+zmAEc3btcSnqIBv5VPU4OOiwtJbGvoyJi1qV3AcPKRY
# LqPzW0sH3DJZ84enGm1YMIIG7DCCBNSgAwIBAgIQMA9vrN1mmHR8qUY2p3gtuTAN
# BgkqhkiG9w0BAQwFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJz
# ZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNU
# IE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBB
# dXRob3JpdHkwHhcNMTkwNTAyMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjB9MQswCQYD
# VQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdT
# YWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdvIExpbWl0ZWQxJTAjBgNVBAMTHFNlY3Rp
# Z28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw
# ggIKAoICAQDIGwGv2Sx+iJl9AZg/IJC9nIAhVJO5z6A+U++zWsB21hoEpc5Hg7Xr
# xMxJNMvzRWW5+adkFiYJ+9UyUnkuyWPCE5u2hj8BBZJmbyGr1XEQeYf0RirNxFrJ
# 29ddSU1yVg/cyeNTmDoqHvzOWEnTv/M5u7mkI0Ks0BXDf56iXNc48RaycNOjxN+z
# xXKsLgp3/A2UUrf8H5VzJD0BKLwPDU+zkQGObp0ndVXRFzs0IXuXAZSvf4DP0REK
# V4TJf1bgvUacgr6Unb+0ILBgfrhN9Q0/29DqhYyKVnHRLZRMyIw80xSinL0m/9NT
# IMdgaZtYClT0Bef9Maz5yIUXx7gpGaQpL0bj3duRX58/Nj4OMGcrRrc1r5a+2kxg
# zKi7nw0U1BjEMJh0giHPYla1IXMSHv2qyghYh3ekFesZVf/QOVQtJu5FGjpvzdeE
# 8NfwKMVPZIMC1Pvi3vG8Aij0bdonigbSlofe6GsO8Ft96XZpkyAcSpcsdxkrk5WY
# nJee647BeFbGRCXfBhKaBi2fA179g6JTZ8qx+o2hZMmIklnLqEbAyfKm/31X2xJ2
# +opBJNQb/HKlFKLUrUMcpEmLQTkUAx4p+hulIq6lw02C0I3aa7fb9xhAV3PwcaP7
# Sn1FNsH3jYL6uckNU4B9+rY5WDLvbxhQiddPnTO9GrWdod6VQXqngwIDAQABo4IB
# WjCCAVYwHwYDVR0jBBgwFoAUU3m/WqorSs9UgOHYm8Cd8rIDZsswHQYDVR0OBBYE
# FBqh+GEZIA/DQXdFKI7RNV8GEgRVMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E
# CDAGAQH/AgEAMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBEGA1UdIAQKMAgwBgYEVR0g
# ADBQBgNVHR8ESTBHMEWgQ6BBhj9odHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVNF
# UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwdgYIKwYBBQUHAQEE
# ajBoMD8GCCsGAQUFBzAChjNodHRwOi8vY3J0LnVzZXJ0cnVzdC5jb20vVVNFUlRy
# dXN0UlNBQWRkVHJ1c3RDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9vY3NwLnVz
# ZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAG1UgaUzXRbhtVOBkXXfA3oy
# Cy0lhBGysNsqfSoF9bw7J/RaoLlJWZApbGHLtVDb4n35nwDvQMOt0+LkVvlYQc/x
# QuUQff+wdB+PxlwJ+TNe6qAcJlhc87QRD9XVw+K81Vh4v0h24URnbY+wQxAPjeT5
# OGK/EwHFhaNMxcyyUzCVpNb0llYIuM1cfwGWvnJSajtCN3wWeDmTk5SbsdyybUFt
# Z83Jb5A9f0VywRsj1sJVhGbks8VmBvbz1kteraMrQoohkv6ob1olcGKBc2NeoLvY
# 3NdK0z2vgwY4Eh0khy3k/ALWPncEvAQ2ted3y5wujSMYuaPCRx3wXdahc1cFaJqn
# yTdlHb7qvNhCg0MFpYumCf/RoZSmTqo9CfUFbLfSZFrYKiLCS53xOV5M3kg9mzSW
# mglfjv33sVKRzj+J9hyhtal1H3G/W0NdZT1QgW6r8NDT/LKzH7aZlib0PHmLXGTM
# ze4nmuWgwAxyh8FuTVrTHurwROYybxzrF06Uw3hlIDsPQaof6aFBnf6xuKBlKjTg
# 3qj5PObBMLvAoGMs/FwWAKjQxH/qEZ0eBsambTJdtDgJK0kHqv3sMNrxpy/Pt/36
# 0KOE2See+wFmd7lWEOEgbsausfm2usg1XTN2jvF8IAwqd661ogKGuinutFoAsYyr
# 4/kKyVRd1LlqdJ69SK6YMIIG9TCCBN2gAwIBAgIQOUwl4XygbSeoZeI72R0i1DAN
# BgkqhkiG9w0BAQwFADB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBN
# YW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdvIExp
# bWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EwHhcN
# MjMwNTAzMDAwMDAwWhcNMzQwODAyMjM1OTU5WjBqMQswCQYDVQQGEwJHQjETMBEG
# A1UECBMKTWFuY2hlc3RlcjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSwwKgYD
# VQQDDCNTZWN0aWdvIFJTQSBUaW1lIFN0YW1waW5nIFNpZ25lciAjNDCCAiIwDQYJ
# KoZIhvcNAQEBBQADggIPADCCAgoCggIBAKSTKFJLzyeHdqQpHJk4wOcO1NEc7GjL
# AWTkis13sHFlgryf/Iu7u5WY+yURjlqICWYRFFiyuiJb5vYy8V0twHqiDuDgVmTt
# oeWBIHIgZEFsx8MI+vN9Xe8hmsJ+1yzDuhGYHvzTIAhCs1+/f4hYMqsws9iMepZK
# GRNcrPznq+kcFi6wsDiVSs+FUKtnAyWhuzjpD2+pWpqRKBM1uR/zPeEkyGuxmegN
# 77tN5T2MVAOR0Pwtz1UzOHoJHAfRIuBjhqe+/dKDcxIUm5pMCUa9NLzhS1B7cuBb
# /Rm7HzxqGXtuuy1EKr48TMysigSTxleGoHM2K4GX+hubfoiH2FJ5if5udzfXu1Cf
# +hglTxPyXnypsSBaKaujQod34PRMAkjdWKVTpqOg7RmWZRUpxe0zMCXmloOBmvZg
# ZpBYB4DNQnWs+7SR0MXdAUBqtqgQ7vaNereeda/TpUsYoQyfV7BeJUeRdM11EtGc
# b+ReDZvsdSbu/tP1ki9ShejaRFEqoswAyodmQ6MbAO+itZadYq0nC/IbSsnDlEI3
# iCCEqIeuw7ojcnv4VO/4ayewhfWnQ4XYKzl021p3AtGk+vXNnD3MH65R0Hts2B0t
# EUJTcXTC5TWqLVIS2SXP8NPQkUMS1zJ9mGzjd0HI/x8kVO9urcY+VXvxXIc6ZPFg
# SwVP77kv7AkTAgMBAAGjggGCMIIBfjAfBgNVHSMEGDAWgBQaofhhGSAPw0F3RSiO
# 0TVfBhIEVTAdBgNVHQ4EFgQUAw8xyJEqk71j89FdTaQ0D9KVARgwDgYDVR0PAQH/
# BAQDAgbAMAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwSgYD
# VR0gBEMwQTA1BgwrBgEEAbIxAQIBAwgwJTAjBggrBgEFBQcCARYXaHR0cHM6Ly9z
# ZWN0aWdvLmNvbS9DUFMwCAYGZ4EMAQQCMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6
# Ly9jcmwuc2VjdGlnby5jb20vU2VjdGlnb1JTQVRpbWVTdGFtcGluZ0NBLmNybDB0
# BggrBgEFBQcBAQRoMGYwPwYIKwYBBQUHMAKGM2h0dHA6Ly9jcnQuc2VjdGlnby5j
# b20vU2VjdGlnb1JTQVRpbWVTdGFtcGluZ0NBLmNydDAjBggrBgEFBQcwAYYXaHR0
# cDovL29jc3Auc2VjdGlnby5jb20wDQYJKoZIhvcNAQEMBQADggIBAEybZVj64HnP
# 7xXDMm3eM5Hrd1ji673LSjx13n6UbcMixwSV32VpYRMM9gye9YkgXsGHxwMkysel
# 8Cbf+PgxZQ3g621RV6aMhFIIRhwqwt7y2opF87739i7Efu347Wi/elZI6WHlmjl3
# vL66kWSIdf9dhRY0J9Ipy//tLdr/vpMM7G2iDczD8W69IZEaIwBSrZfUYngqhHmo
# 1z2sIY9wwyR5OpfxDaOjW1PYqwC6WPs1gE9fKHFsGV7Cg3KQruDG2PKZ++q0kmV8
# B3w1RB2tWBhrYvvebMQKqWzTIUZw3C+NdUwjwkHQepY7w0vdzZImdHZcN6CaJJ5O
# X07Tjw/lE09ZRGVLQ2TPSPhnZ7lNv8wNsTow0KE9SK16ZeTs3+AB8LMqSjmswaT5
# qX010DJAoLEZKhghssh9BXEaSyc2quCYHIN158d+S4RDzUP7kJd2KhKsQMFwW5kK
# QPqAbZRhe8huuchnZyRcUI0BIN4H9wHU+C4RzZ2D5fjKJRxEPSflsIZHKgsbhHZ9
# e2hPjbf3E7TtoC3ucw/ZELqdmSx813UfjxDElOZ+JOWVSoiMJ9aFZh35rmR2kehI
# /shVCu0pwx/eOKbAFPsyPfipg2I2yMO+AIccq/pKQhyJA9z1XHxw2V14Tu6fXiDm
# CWp8KwijSPUV/ARP380hHHrl9Y4a1LlAMYIFkjCCBY4CAQEwgZAwfDELMAkGA1UE
# BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2Fs
# Zm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSQwIgYDVQQDExtTZWN0aWdv
# IFJTQSBDb2RlIFNpZ25pbmcgQ0ECECwnTfNkELSL/bju5S9Y3lMwDQYJYIZIAWUD
# BAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAAoQKAADAZBgkqhkiG9w0BCQMx
# DAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkq
# hkiG9w0BCQQxIgQg21RDYxlwC5QjeMKV6afIIBt4UoGIwggVwQzCliYtftIwDQYJ
# KoZIhvcNAQEBBQAEggEAULrCbTrCmlUXInOFGmQ9Kc7sv1VfD0Q4mMLQDKJGLBWp
# xBl6Ownrp2BC5JtomOTpRxJw1jjYHn2v6RT8GRWAwXEHa1qUSrmd9iFP7OtQINRZ
# 1xKVvfgxhK5QiBKAiG0hhqhvdk+7iP11gv8H5K0aLC673nXehYr8qxpAR4ApUzMM
# 8HmMYBmpTk9FVCCWZQQfnaPdBAJ+BP4JC2MizLBQ1vQbKItpD9Wsur2Z10PiCtpS
# PX6CHWJFannfT38EsjwuJeiZK8Pnqc5zoHP0yYddmGq/7R5DIF5SRJRcPIswy1N0
# MOtoRz4P6niVYIFGG6BljMuZc3RREepmluJGgwwfpaGCA0swggNHBgkqhkiG9w0B
# CQYxggM4MIIDNAIBATCBkTB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRl
# ciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdv
# IExpbWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EC
# EDlMJeF8oG0nqGXiO9kdItQwDQYJYIZIAWUDBAICBQCgeTAYBgkqhkiG9w0BCQMx
# CwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzExMjAyMDQzNDBaMD8GCSqG
# SIb3DQEJBDEyBDDMI1xkNv8KGaZz45zhlBYyG4AA1c8r8TODaBotTwHCBf3GGZ+D
# NYYdjqmTDfk2nFMwDQYJKoZIhvcNAQEBBQAEggIAfyRiatHv+ebl4XiiHJtz+NGh
# iomdyUbytQQ8ThuMUKX3TlF4XSzQnhFGfNTDf795B8SD3yr6QiLaKmy0YHJKWuKD
# WPX5G+TMymw8W8YXR9Vzm8+2ltZNVwEb91ElVJSNe5AsPe4fiJItAbQiUmqMWn/c
# 6RistidMTWuU7cKqYmwDZb+sH97aphGKluzW42LjR9f3sirv0wYBX+M5hCboBkLM
# 1wiGo0PDQd/eFzFSKUPeiGZdP/5JXJEX8yAWaOar4iw8pcyFsb289TyVPLOJR+RP
# bj3HU0I/qKeus4fLcvj7O+8Qjaol4HNjvLBOorg1ZVyJ1C0tyjYbT7LC452wdvFP
# uPhsUyOxnh4wbObIlzINqDYS8huRTqhenmOrZ+v8PETJTgQWm98xs42TIBg7c6f9
# yE6gSD4YpsjY24sa5kBkkDxXQn/kBgfEhrQHE7pPkZJAqjnhQ51bTIjOqWer6/kn
# Jm60sJXqrt79rMrKBoqsNWm/VnHW+hViBA3RK5pZENDIr+9BO9mboO+momna70Wz
# LTmwnCkMzU7HGrZOQuj+SCOptHpxJ+BCIpUseqwRbrJPe7wmeCXPzvW5RP5tRpr0
# /+2JMTVrgYdoeunAuOk+QzvRA5YQzVPZZOayHVGl3jVAvtsroFWEkddkHJTdJPsR
# 68HwhbG23ZCSeU+g7pk=
# SIG # End signature block