Public/ns-functions-config-authentication.ps1

function Invoke-NSAddAuthenticationadfsproxyprofile {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for ADFSProxy Profile resource.
    .PARAMETER Name
        Name for the adfs proxy profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER Username
        This is the name of an account in directory that would be used to authenticate trust request from ADC acting as a proxy.
    .PARAMETER Password
        This is the password of an account in directory that would be used to authenticate trust request from ADC acting as a proxy.
    .PARAMETER Serverurl
        Fully qualified url of the adfs server.
    .PARAMETER Certkeyname
        SSL certificate of the proxy that is registered at adfs server for trust.
    .PARAMETER PassThru
        Return details about the created authenticationadfsproxyprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationadfsproxyprofile -name <string> -username <string> -password <string> -serverurl <string> -certkeyname <string>
        An example how to add authenticationadfsproxyprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationadfsproxyprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationadfsproxyprofile/
        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,

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

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

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationadfsproxyprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                username       = $username
                password       = $password
                serverurl      = $serverurl
                certkeyname    = $certkeyname
            }

            if ( $PSCmdlet.ShouldProcess("authenticationadfsproxyprofile", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationadfsproxyprofile -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-NSGetAuthenticationadfsproxyprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationadfsproxyprofile: Finished"
    }
}

function Invoke-NSDeleteAuthenticationadfsproxyprofile {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for ADFSProxy Profile resource.
    .PARAMETER Name
        Name for the adfs proxy profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationadfsproxyprofile -Name <string>
        An example how to delete authenticationadfsproxyprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationadfsproxyprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationadfsproxyprofile/
        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-NSDeleteAuthenticationadfsproxyprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationadfsproxyprofile -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-NSDeleteAuthenticationadfsproxyprofile: Finished"
    }
}

function Invoke-NSUpdateAuthenticationadfsproxyprofile {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for ADFSProxy Profile resource.
    .PARAMETER Name
        Name for the adfs proxy profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER Username
        This is the name of an account in directory that would be used to authenticate trust request from ADC acting as a proxy.
    .PARAMETER Password
        This is the password of an account in directory that would be used to authenticate trust request from ADC acting as a proxy.
    .PARAMETER Serverurl
        Fully qualified url of the adfs server.
    .PARAMETER Certkeyname
        SSL certificate of the proxy that is registered at adfs server for trust.
    .PARAMETER PassThru
        Return details about the created authenticationadfsproxyprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationadfsproxyprofile -name <string>
        An example how to update authenticationadfsproxyprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationadfsproxyprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationadfsproxyprofile/
        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,

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

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

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationadfsproxyprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('username') ) { $payload.Add('username', $username) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('certkeyname') ) { $payload.Add('certkeyname', $certkeyname) }
            if ( $PSCmdlet.ShouldProcess("authenticationadfsproxyprofile", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationadfsproxyprofile -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-NSGetAuthenticationadfsproxyprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationadfsproxyprofile: Finished"
    }
}

function Invoke-NSGetAuthenticationadfsproxyprofile {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for ADFSProxy Profile resource.
    .PARAMETER Name
        Name for the adfs proxy profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER GetAll
        Retrieve all authenticationadfsproxyprofile object(s).
    .PARAMETER Count
        If specified, the count of the authenticationadfsproxyprofile 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-NSGetAuthenticationadfsproxyprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationadfsproxyprofile -GetAll
        Get all authenticationadfsproxyprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationadfsproxyprofile -Count
        Get the number of authenticationadfsproxyprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationadfsproxyprofile -name <string>
        Get authenticationadfsproxyprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationadfsproxyprofile -Filter @{ 'name'='<value>' }
        Get authenticationadfsproxyprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationadfsproxyprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationadfsproxyprofile/
        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-NSGetAuthenticationadfsproxyprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationadfsproxyprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationadfsproxyprofile -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 authenticationadfsproxyprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationadfsproxyprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationadfsproxyprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationadfsproxyprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationadfsproxyprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationadfsproxyprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationadfsproxyprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationadfsproxyprofile -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-NSGetAuthenticationadfsproxyprofile: Ended"
    }
}

function Invoke-NSUnsetAuthenticationauthnprofile {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication profile resource.
    .PARAMETER Name
        Name for the authentication profile.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Authenticationdomain
        Domain for which TM cookie must to be set. If unspecified, cookie will be set for FQDN.
    .PARAMETER Authenticationlevel
        Authentication weight or level of the vserver to which this will bound. This is used to order TM vservers based on the protection required. A session that is created by authenticating against TM vserver at given level cannot be used to access TM vserver at a higher level.
         
        Maximum value = 255
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationauthnprofile -name <string>
        An example how to unset authenticationauthnprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationauthnprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile
        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]$Name,

        [Boolean]$authenticationdomain,

        [Boolean]$authenticationlevel 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationauthnprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('authenticationlevel') ) { $payload.Add('authenticationlevel', $authenticationlevel) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationauthnprofile -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-NSUnsetAuthenticationauthnprofile: Finished"
    }
}

function Invoke-NSAddAuthenticationauthnprofile {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication profile resource.
    .PARAMETER Name
        Name for the authentication profile.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Authnvsname
        Name of the authentication vserver at which authentication should be done.
    .PARAMETER Authenticationhost
        Hostname of the authentication vserver to which user must be redirected for authentication.
    .PARAMETER Authenticationdomain
        Domain for which TM cookie must to be set. If unspecified, cookie will be set for FQDN.
    .PARAMETER Authenticationlevel
        Authentication weight or level of the vserver to which this will bound. This is used to order TM vservers based on the protection required. A session that is created by authenticating against TM vserver at given level cannot be used to access TM vserver at a higher level.
         
        Maximum value = 255
    .PARAMETER PassThru
        Return details about the created authenticationauthnprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationauthnprofile -name <string> -authnvsname <string>
        An example how to add authenticationauthnprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationauthnprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile/
        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]$Name,

        [Parameter(Mandatory)]
        [ValidateLength(1, 128)]
        [string]$Authnvsname,

        [ValidateLength(1, 256)]
        [string]$Authenticationhost,

        [ValidateLength(1, 256)]
        [string]$Authenticationdomain,

        [double]$Authenticationlevel,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationauthnprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                authnvsname    = $authnvsname
            }
            if ( $PSBoundParameters.ContainsKey('authenticationhost') ) { $payload.Add('authenticationhost', $authenticationhost) }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('authenticationlevel') ) { $payload.Add('authenticationlevel', $authenticationlevel) }
            if ( $PSCmdlet.ShouldProcess("authenticationauthnprofile", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationauthnprofile -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-NSGetAuthenticationauthnprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationauthnprofile: Finished"
    }
}

function Invoke-NSDeleteAuthenticationauthnprofile {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication profile resource.
    .PARAMETER Name
        Name for the authentication profile.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationauthnprofile -Name <string>
        An example how to delete authenticationauthnprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationauthnprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile/
        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-NSDeleteAuthenticationauthnprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationauthnprofile -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-NSDeleteAuthenticationauthnprofile: Finished"
    }
}

function Invoke-NSUpdateAuthenticationauthnprofile {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication profile resource.
    .PARAMETER Name
        Name for the authentication profile.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Authnvsname
        Name of the authentication vserver at which authentication should be done.
    .PARAMETER Authenticationhost
        Hostname of the authentication vserver to which user must be redirected for authentication.
    .PARAMETER Authenticationdomain
        Domain for which TM cookie must to be set. If unspecified, cookie will be set for FQDN.
    .PARAMETER Authenticationlevel
        Authentication weight or level of the vserver to which this will bound. This is used to order TM vservers based on the protection required. A session that is created by authenticating against TM vserver at given level cannot be used to access TM vserver at a higher level.
         
        Maximum value = 255
    .PARAMETER PassThru
        Return details about the created authenticationauthnprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationauthnprofile -name <string>
        An example how to update authenticationauthnprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationauthnprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile/
        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]$Name,

        [ValidateLength(1, 128)]
        [string]$Authnvsname,

        [ValidateLength(1, 256)]
        [string]$Authenticationhost,

        [ValidateLength(1, 256)]
        [string]$Authenticationdomain,

        [double]$Authenticationlevel,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationauthnprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authnvsname') ) { $payload.Add('authnvsname', $authnvsname) }
            if ( $PSBoundParameters.ContainsKey('authenticationhost') ) { $payload.Add('authenticationhost', $authenticationhost) }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('authenticationlevel') ) { $payload.Add('authenticationlevel', $authenticationlevel) }
            if ( $PSCmdlet.ShouldProcess("authenticationauthnprofile", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationauthnprofile -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-NSGetAuthenticationauthnprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationauthnprofile: Finished"
    }
}

function Invoke-NSGetAuthenticationauthnprofile {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Authentication profile resource.
    .PARAMETER Name
        Name for the authentication profile.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER GetAll
        Retrieve all authenticationauthnprofile object(s).
    .PARAMETER Count
        If specified, the count of the authenticationauthnprofile 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-NSGetAuthenticationauthnprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationauthnprofile -GetAll
        Get all authenticationauthnprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationauthnprofile -Count
        Get the number of authenticationauthnprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationauthnprofile -name <string>
        Get authenticationauthnprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationauthnprofile -Filter @{ 'name'='<value>' }
        Get authenticationauthnprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationauthnprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationauthnprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationauthnprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationauthnprofile -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 authenticationauthnprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationauthnprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationauthnprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationauthnprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationauthnprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationauthnprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationauthnprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationauthnprofile -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-NSGetAuthenticationauthnprofile: Ended"
    }
}

function Invoke-NSAddAuthenticationazurekeyvault {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Azure Key Vault entity resource.
    .PARAMETER Name
        Name for the new Azure Key Vault 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 an action is created.
    .PARAMETER Vaultname
        Name of the Azure vault account as configured in azure portal.
    .PARAMETER Clientid
        Unique identity of the relying party requesting for authentication.
    .PARAMETER Clientsecret
        Unique secret string to authorize relying party at authorization server.
    .PARAMETER Servicekeyname
        Friendly name of the Key to be used to compute signature.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify transactions.
         
        Possible values = RS256
    .PARAMETER Tokenendpoint
        URL endpoint on relying party to which the OAuth token is to be sent.
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Refreshinterval
        Interval at which access token in obtained.
    .PARAMETER Tenantid
        TenantID of the application. This is usually specific to providers such as Microsoft and usually refers to the deployment identifier.
    .PARAMETER Authentication
        If authentication is disabled, otp checks are not performed after azure vault keys are obtained. This is useful to distinguish whether user has registered devices. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationazurekeyvault item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationazurekeyvault -name <string> -vaultname <string> -clientid <string> -clientsecret <string> -servicekeyname <string>
        An example how to add authenticationazurekeyvault config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationazurekeyvault
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault/
        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)]
        [ValidateLength(1, 63)]
        [string]$Vaultname,

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

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

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

        [ValidateSet('RS256')]
        [string]$Signaturealg = 'RS256',

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

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

        [string]$Defaultauthenticationgroup,

        [double]$Refreshinterval = '50',

        [string]$Tenantid,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationazurekeyvault: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                vaultname      = $vaultname
                clientid       = $clientid
                clientsecret   = $clientsecret
                servicekeyname = $servicekeyname
            }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('tokenendpoint') ) { $payload.Add('tokenendpoint', $tokenendpoint) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('tenantid') ) { $payload.Add('tenantid', $tenantid) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("authenticationazurekeyvault", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationazurekeyvault -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-NSGetAuthenticationazurekeyvault -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationazurekeyvault: Finished"
    }
}

function Invoke-NSDeleteAuthenticationazurekeyvault {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Azure Key Vault entity resource.
    .PARAMETER Name
        Name for the new Azure Key Vault 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationazurekeyvault -Name <string>
        An example how to delete authenticationazurekeyvault config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationazurekeyvault
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault/
        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-NSDeleteAuthenticationazurekeyvault: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationazurekeyvault -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-NSDeleteAuthenticationazurekeyvault: Finished"
    }
}

function Invoke-NSUpdateAuthenticationazurekeyvault {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Azure Key Vault entity resource.
    .PARAMETER Name
        Name for the new Azure Key Vault 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 an action is created.
    .PARAMETER Vaultname
        Name of the Azure vault account as configured in azure portal.
    .PARAMETER Clientid
        Unique identity of the relying party requesting for authentication.
    .PARAMETER Clientsecret
        Unique secret string to authorize relying party at authorization server.
    .PARAMETER Servicekeyname
        Friendly name of the Key to be used to compute signature.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify transactions.
         
        Possible values = RS256
    .PARAMETER Tokenendpoint
        URL endpoint on relying party to which the OAuth token is to be sent.
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Refreshinterval
        Interval at which access token in obtained.
    .PARAMETER Tenantid
        TenantID of the application. This is usually specific to providers such as Microsoft and usually refers to the deployment identifier.
    .PARAMETER Authentication
        If authentication is disabled, otp checks are not performed after azure vault keys are obtained. This is useful to distinguish whether user has registered devices. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationazurekeyvault item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationazurekeyvault -name <string>
        An example how to update authenticationazurekeyvault config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationazurekeyvault
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault/
        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,

        [ValidateLength(1, 63)]
        [string]$Vaultname,

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

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

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

        [ValidateSet('RS256')]
        [string]$Signaturealg,

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

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

        [string]$Defaultauthenticationgroup,

        [double]$Refreshinterval,

        [string]$Tenantid,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationazurekeyvault: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('vaultname') ) { $payload.Add('vaultname', $vaultname) }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('servicekeyname') ) { $payload.Add('servicekeyname', $servicekeyname) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('tokenendpoint') ) { $payload.Add('tokenendpoint', $tokenendpoint) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('tenantid') ) { $payload.Add('tenantid', $tenantid) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("authenticationazurekeyvault", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationazurekeyvault -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-NSGetAuthenticationazurekeyvault -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationazurekeyvault: Finished"
    }
}

function Invoke-NSUnsetAuthenticationazurekeyvault {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Azure Key Vault entity resource.
    .PARAMETER Name
        Name for the new Azure Key Vault 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 an action is created.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify transactions.
         
        Possible values = RS256
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Refreshinterval
        Interval at which access token in obtained.
    .PARAMETER Authentication
        If authentication is disabled, otp checks are not performed after azure vault keys are obtained. This is useful to distinguish whether user has registered devices. .
         
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationazurekeyvault -name <string>
        An example how to unset authenticationazurekeyvault config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationazurekeyvault
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault
        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]$signaturealg,

        [Boolean]$pushservice,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$refreshinterval,

        [Boolean]$authentication 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationazurekeyvault: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationazurekeyvault -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-NSUnsetAuthenticationazurekeyvault: Finished"
    }
}

function Invoke-NSGetAuthenticationazurekeyvault {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Azure Key Vault entity resource.
    .PARAMETER Name
        Name for the new Azure Key Vault 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationazurekeyvault object(s).
    .PARAMETER Count
        If specified, the count of the authenticationazurekeyvault 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-NSGetAuthenticationazurekeyvault
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationazurekeyvault -GetAll
        Get all authenticationazurekeyvault data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationazurekeyvault -Count
        Get the number of authenticationazurekeyvault objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationazurekeyvault -name <string>
        Get authenticationazurekeyvault object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationazurekeyvault -Filter @{ 'name'='<value>' }
        Get authenticationazurekeyvault data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationazurekeyvault
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault/
        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-NSGetAuthenticationazurekeyvault: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationazurekeyvault objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationazurekeyvault -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 authenticationazurekeyvault objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationazurekeyvault -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationazurekeyvault objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationazurekeyvault -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationazurekeyvault configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationazurekeyvault -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationazurekeyvault configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationazurekeyvault -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-NSGetAuthenticationazurekeyvault: Ended"
    }
}

function Invoke-NSAddAuthenticationcaptchaaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Captcha Action resource.
    .PARAMETER Name
        Name for the new captcha 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Serverurl
        This is the endpoint at which captcha response is validated.
    .PARAMETER Secretkey
        Secret of gateway as established at the captcha source.
    .PARAMETER Sitekey
        Sitekey to identify gateway fqdn while loading captcha.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .PARAMETER PassThru
        Return details about the created authenticationcaptchaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationcaptchaaction -name <string> -secretkey <string> -sitekey <string>
        An example how to add authenticationcaptchaaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationcaptchaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction/
        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]$Serverurl,

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

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

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationcaptchaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                secretkey      = $secretkey
                sitekey        = $sitekey
            }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationcaptchaaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationcaptchaaction -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-NSGetAuthenticationcaptchaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationcaptchaaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationcaptchaaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Captcha Action resource.
    .PARAMETER Name
        Name for the new captcha 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationcaptchaaction -Name <string>
        An example how to delete authenticationcaptchaaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationcaptchaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction/
        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-NSDeleteAuthenticationcaptchaaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationcaptchaaction -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-NSDeleteAuthenticationcaptchaaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationcaptchaaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Captcha Action resource.
    .PARAMETER Name
        Name for the new captcha 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Serverurl
        This is the endpoint at which captcha response is validated.
    .PARAMETER Secretkey
        Secret of gateway as established at the captcha source.
    .PARAMETER Sitekey
        Sitekey to identify gateway fqdn while loading captcha.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .PARAMETER PassThru
        Return details about the created authenticationcaptchaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationcaptchaaction -name <string>
        An example how to update authenticationcaptchaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationcaptchaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction/
        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]$Serverurl,

        [string]$Secretkey,

        [string]$Sitekey,

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationcaptchaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('secretkey') ) { $payload.Add('secretkey', $secretkey) }
            if ( $PSBoundParameters.ContainsKey('sitekey') ) { $payload.Add('sitekey', $sitekey) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationcaptchaaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationcaptchaaction -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-NSGetAuthenticationcaptchaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationcaptchaaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationcaptchaaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Captcha Action resource.
    .PARAMETER Name
        Name for the new captcha 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Serverurl
        This is the endpoint at which captcha response is validated.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationcaptchaaction -name <string>
        An example how to unset authenticationcaptchaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationcaptchaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction
        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]$serverurl,

        [Boolean]$defaultauthenticationgroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationcaptchaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationcaptchaaction -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-NSUnsetAuthenticationcaptchaaction: Finished"
    }
}

function Invoke-NSGetAuthenticationcaptchaaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Captcha Action resource.
    .PARAMETER Name
        Name for the new captcha 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER GetAll
        Retrieve all authenticationcaptchaaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcaptchaaction 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-NSGetAuthenticationcaptchaaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcaptchaaction -GetAll
        Get all authenticationcaptchaaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcaptchaaction -Count
        Get the number of authenticationcaptchaaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcaptchaaction -name <string>
        Get authenticationcaptchaaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcaptchaaction -Filter @{ 'name'='<value>' }
        Get authenticationcaptchaaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcaptchaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction/
        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-NSGetAuthenticationcaptchaaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationcaptchaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcaptchaaction -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 authenticationcaptchaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcaptchaaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcaptchaaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcaptchaaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcaptchaaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcaptchaaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcaptchaaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcaptchaaction -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-NSGetAuthenticationcaptchaaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationcertaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT action resource.
    .PARAMETER Name
        Name for the client cert authentication server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after certifcate action is created.
    .PARAMETER Twofactor
        Enables or disables two-factor authentication.
        Two factor authentication is client cert authentication followed by password authentication.
         
        Possible values = ON, OFF
    .PARAMETER Usernamefield
        Client-cert field from which the username is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Groupnamefield
        Client-cert field from which the group is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationcertaction -name <string>
        An example how to unset authenticationcertaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationcertaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction
        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]$Name,

        [Boolean]$twofactor,

        [Boolean]$usernamefield,

        [Boolean]$groupnamefield,

        [Boolean]$defaultauthenticationgroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationcertaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('twofactor') ) { $payload.Add('twofactor', $twofactor) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationcertaction -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-NSUnsetAuthenticationcertaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationcertaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT action resource.
    .PARAMETER Name
        Name for the client cert authentication server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after certifcate action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationcertaction -Name <string>
        An example how to delete authenticationcertaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationcertaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction/
        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-NSDeleteAuthenticationcertaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationcertaction -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-NSDeleteAuthenticationcertaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationcertaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT action resource.
    .PARAMETER Name
        Name for the client cert authentication server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after certifcate action is created.
    .PARAMETER Twofactor
        Enables or disables two-factor authentication.
        Two factor authentication is client cert authentication followed by password authentication.
         
        Possible values = ON, OFF
    .PARAMETER Usernamefield
        Client-cert field from which the username is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Groupnamefield
        Client-cert field from which the group is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationcertaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationcertaction -name <string>
        An example how to update authenticationcertaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationcertaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction/
        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]$Name,

        [ValidateSet('ON', 'OFF')]
        [string]$Twofactor,

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

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

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationcertaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('twofactor') ) { $payload.Add('twofactor', $twofactor) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationcertaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationcertaction -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-NSGetAuthenticationcertaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationcertaction: Finished"
    }
}

function Invoke-NSAddAuthenticationcertaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT action resource.
    .PARAMETER Name
        Name for the client cert authentication server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after certifcate action is created.
    .PARAMETER Twofactor
        Enables or disables two-factor authentication.
        Two factor authentication is client cert authentication followed by password authentication.
         
        Possible values = ON, OFF
    .PARAMETER Usernamefield
        Client-cert field from which the username is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Groupnamefield
        Client-cert field from which the group is extracted. Must be set to either ""Subject"" and ""Issuer"" (include both sets of double quotation marks).
        Format: &lt;field&gt;:&lt;subfield&gt;.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationcertaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationcertaction -name <string>
        An example how to add authenticationcertaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationcertaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction/
        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]$Name,

        [ValidateSet('ON', 'OFF')]
        [string]$Twofactor = 'OFF',

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

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

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationcertaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('twofactor') ) { $payload.Add('twofactor', $twofactor) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationcertaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationcertaction -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-NSGetAuthenticationcertaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationcertaction: Finished"
    }
}

function Invoke-NSGetAuthenticationcertaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for CERT action resource.
    .PARAMETER Name
        Name for the client cert authentication server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after certifcate action is created.
    .PARAMETER GetAll
        Retrieve all authenticationcertaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertaction 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-NSGetAuthenticationcertaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertaction -GetAll
        Get all authenticationcertaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertaction -Count
        Get the number of authenticationcertaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertaction -name <string>
        Get authenticationcertaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertaction -Filter @{ 'name'='<value>' }
        Get authenticationcertaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationcertaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationcertaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertaction -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 authenticationcertaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertaction -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-NSGetAuthenticationcertaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationcertpolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT policy resource.
    .PARAMETER Name
        Name for the client certificate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after cert authentication policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the authentication server.
    .PARAMETER Reqaction
        Name of the client cert authentication action to be performed if the policy matches.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationcertpolicy -name <string>
        An example how to unset authenticationcertpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationcertpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy
        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]$Name,

        [Boolean]$rule,

        [Boolean]$reqaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationcertpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationcertpolicy -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-NSUnsetAuthenticationcertpolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationcertpolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT policy resource.
    .PARAMETER Name
        Name for the client certificate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after cert authentication policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the authentication server.
    .PARAMETER Reqaction
        Name of the client cert authentication action to be performed if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationcertpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationcertpolicy -name <string> -rule <string>
        An example how to add authenticationcertpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationcertpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationcertpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
            }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationcertpolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationcertpolicy -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-NSGetAuthenticationcertpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationcertpolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationcertpolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT policy resource.
    .PARAMETER Name
        Name for the client certificate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after cert authentication policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationcertpolicy -Name <string>
        An example how to delete authenticationcertpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationcertpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy/
        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-NSDeleteAuthenticationcertpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationcertpolicy -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-NSDeleteAuthenticationcertpolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationcertpolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for CERT policy resource.
    .PARAMETER Name
        Name for the client certificate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after cert authentication policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the authentication server.
    .PARAMETER Reqaction
        Name of the client cert authentication action to be performed if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationcertpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationcertpolicy -name <string>
        An example how to update authenticationcertpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationcertpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationcertpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationcertpolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationcertpolicy -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-NSGetAuthenticationcertpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationcertpolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationcertpolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for CERT policy resource.
    .PARAMETER Name
        Name for the client certificate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after cert authentication policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationcertpolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertpolicy 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-NSGetAuthenticationcertpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicy -GetAll
        Get all authenticationcertpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicy -Count
        Get the number of authenticationcertpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicy -name <string>
        Get authenticationcertpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicy -Filter @{ 'name'='<value>' }
        Get authenticationcertpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationcertpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationcertpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy -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 authenticationcertpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy -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-NSGetAuthenticationcertpolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationcertpolicy.
    .PARAMETER Name
        Name of the client cert authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationcertpolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertpolicy_authenticationvserver_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-NSGetAuthenticationcertpolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding -GetAll
        Get all authenticationcertpolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding -Count
        Get the number of authenticationcertpolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding -name <string>
        Get authenticationcertpolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationcertpolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertpolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_authenticationvserver_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-NSGetAuthenticationcertpolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationcertpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_authenticationvserver_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 authenticationcertpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertpolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_authenticationvserver_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-NSGetAuthenticationcertpolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationcertpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationcertpolicy.
    .PARAMETER Name
        Name of the client cert authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationcertpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertpolicy_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-NSGetAuthenticationcertpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyBinding -GetAll
        Get all authenticationcertpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyBinding -name <string>
        Get authenticationcertpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationcertpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_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-NSGetAuthenticationcertpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationcertpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_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 authenticationcertpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_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-NSGetAuthenticationcertpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationcertpolicy.
    .PARAMETER Name
        Name of the client cert authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationcertpolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertpolicy_vpnglobal_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-NSGetAuthenticationcertpolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding -GetAll
        Get all authenticationcertpolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding -Count
        Get the number of authenticationcertpolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding -name <string>
        Get authenticationcertpolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationcertpolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertpolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnglobal_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-NSGetAuthenticationcertpolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationcertpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnglobal_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 authenticationcertpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnglobal_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-NSGetAuthenticationcertpolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationcertpolicy.
    .PARAMETER Name
        Name of the client cert authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationcertpolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcertpolicy_vpnvserver_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-NSGetAuthenticationcertpolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding -GetAll
        Get all authenticationcertpolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding -Count
        Get the number of authenticationcertpolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding -name <string>
        Get authenticationcertpolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationcertpolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcertpolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnvserver_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-NSGetAuthenticationcertpolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationcertpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnvserver_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 authenticationcertpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcertpolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcertpolicy_vpnvserver_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-NSGetAuthenticationcertpolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationcitrixauthaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Citrix Authentication action resource.
    .PARAMETER Name
        Name for the new Citrix Authentication 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Authenticationtype
        Type of the Citrix Authentication implementation. Default implementation uses Citrix Cloud Connector.
         
        Possible values = CITRIXCONNECTOR, ATHENA
    .PARAMETER Authentication
        Authentication needs to be disabled for searching user object without performing authentication.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationcitrixauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationcitrixauthaction -name <string>
        An example how to add authenticationcitrixauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationcitrixauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction/
        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('CITRIXCONNECTOR', 'ATHENA')]
        [string]$Authenticationtype = 'CITRIXCONNECTOR',

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationcitrixauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationtype') ) { $payload.Add('authenticationtype', $authenticationtype) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("authenticationcitrixauthaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationcitrixauthaction -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-NSGetAuthenticationcitrixauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationcitrixauthaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationcitrixauthaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Citrix Authentication action resource.
    .PARAMETER Name
        Name for the new Citrix Authentication 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationcitrixauthaction -Name <string>
        An example how to delete authenticationcitrixauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationcitrixauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction/
        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-NSDeleteAuthenticationcitrixauthaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationcitrixauthaction -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-NSDeleteAuthenticationcitrixauthaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationcitrixauthaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Citrix Authentication action resource.
    .PARAMETER Name
        Name for the new Citrix Authentication 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Authenticationtype
        Type of the Citrix Authentication implementation. Default implementation uses Citrix Cloud Connector.
         
        Possible values = CITRIXCONNECTOR, ATHENA
    .PARAMETER Authentication
        Authentication needs to be disabled for searching user object without performing authentication.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationcitrixauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationcitrixauthaction -name <string>
        An example how to update authenticationcitrixauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationcitrixauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction/
        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('CITRIXCONNECTOR', 'ATHENA')]
        [string]$Authenticationtype,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationcitrixauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationtype') ) { $payload.Add('authenticationtype', $authenticationtype) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("authenticationcitrixauthaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationcitrixauthaction -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-NSGetAuthenticationcitrixauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationcitrixauthaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationcitrixauthaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Citrix Authentication action resource.
    .PARAMETER Name
        Name for the new Citrix Authentication 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER Authenticationtype
        Type of the Citrix Authentication implementation. Default implementation uses Citrix Cloud Connector.
         
        Possible values = CITRIXCONNECTOR, ATHENA
    .PARAMETER Authentication
        Authentication needs to be disabled for searching user object without performing authentication.
         
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationcitrixauthaction -name <string>
        An example how to unset authenticationcitrixauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationcitrixauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction
        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]$authenticationtype,

        [Boolean]$authentication 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationcitrixauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationtype') ) { $payload.Add('authenticationtype', $authenticationtype) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationcitrixauthaction -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-NSUnsetAuthenticationcitrixauthaction: Finished"
    }
}

function Invoke-NSGetAuthenticationcitrixauthaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Citrix Authentication action resource.
    .PARAMETER Name
        Name for the new Citrix Authentication 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 an action is created.
         
        The following requirement applies only to the NetScaler CLI:
        If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my action" or 'my action').
    .PARAMETER GetAll
        Retrieve all authenticationcitrixauthaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationcitrixauthaction 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-NSGetAuthenticationcitrixauthaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcitrixauthaction -GetAll
        Get all authenticationcitrixauthaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcitrixauthaction -Count
        Get the number of authenticationcitrixauthaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcitrixauthaction -name <string>
        Get authenticationcitrixauthaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationcitrixauthaction -Filter @{ 'name'='<value>' }
        Get authenticationcitrixauthaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationcitrixauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction/
        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-NSGetAuthenticationcitrixauthaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationcitrixauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcitrixauthaction -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 authenticationcitrixauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcitrixauthaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationcitrixauthaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcitrixauthaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationcitrixauthaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcitrixauthaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationcitrixauthaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationcitrixauthaction -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-NSGetAuthenticationcitrixauthaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationdfaaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication action resource.
    .PARAMETER Name
        Name for the DFA action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the DFA action is added.
    .PARAMETER Clientid
        If configured, this string is sent to the DFA server as the X-Citrix-Exchange header value.
    .PARAMETER Serverurl
        DFA Server URL.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationdfaaction -name <string>
        An example how to unset authenticationdfaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationdfaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction
        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]$Name,

        [Boolean]$clientid,

        [Boolean]$serverurl,

        [Boolean]$defaultauthenticationgroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationdfaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationdfaaction -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-NSUnsetAuthenticationdfaaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationdfaaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication action resource.
    .PARAMETER Name
        Name for the DFA action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the DFA action is added.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationdfaaction -Name <string>
        An example how to delete authenticationdfaaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationdfaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction/
        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-NSDeleteAuthenticationdfaaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationdfaaction -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-NSDeleteAuthenticationdfaaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationdfaaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication action resource.
    .PARAMETER Name
        Name for the DFA action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the DFA action is added.
    .PARAMETER Clientid
        If configured, this string is sent to the DFA server as the X-Citrix-Exchange header value.
    .PARAMETER Serverurl
        DFA Server URL.
    .PARAMETER Passphrase
        Key shared between the DFA server and the Citrix ADC.
        Required to allow the Citrix ADC to communicate with the DFA server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationdfaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationdfaaction -name <string>
        An example how to update authenticationdfaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationdfaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction/
        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]$Name,

        [string]$Clientid,

        [string]$Serverurl,

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

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationdfaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('passphrase') ) { $payload.Add('passphrase', $passphrase) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationdfaaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationdfaaction -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-NSGetAuthenticationdfaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationdfaaction: Finished"
    }
}

function Invoke-NSAddAuthenticationdfaaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication action resource.
    .PARAMETER Name
        Name for the DFA action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the DFA action is added.
    .PARAMETER Clientid
        If configured, this string is sent to the DFA server as the X-Citrix-Exchange header value.
    .PARAMETER Serverurl
        DFA Server URL.
    .PARAMETER Passphrase
        Key shared between the DFA server and the Citrix ADC.
        Required to allow the Citrix ADC to communicate with the DFA server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationdfaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationdfaaction -name <string> -clientid <string> -serverurl <string> -passphrase <string>
        An example how to add authenticationdfaaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationdfaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction/
        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]$Name,

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

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

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

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationdfaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                clientid       = $clientid
                serverurl      = $serverurl
                passphrase     = $passphrase
            }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationdfaaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationdfaaction -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-NSGetAuthenticationdfaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationdfaaction: Finished"
    }
}

function Invoke-NSGetAuthenticationdfaaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Dfa authentication action resource.
    .PARAMETER Name
        Name for the DFA action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the DFA action is added.
    .PARAMETER GetAll
        Retrieve all authenticationdfaaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationdfaaction 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-NSGetAuthenticationdfaaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfaaction -GetAll
        Get all authenticationdfaaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfaaction -Count
        Get the number of authenticationdfaaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfaaction -name <string>
        Get authenticationdfaaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfaaction -Filter @{ 'name'='<value>' }
        Get authenticationdfaaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationdfaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationdfaaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationdfaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfaaction -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 authenticationdfaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfaaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationdfaaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfaaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationdfaaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfaaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationdfaaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfaaction -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-NSGetAuthenticationdfaaction: Ended"
    }
}

function Invoke-NSAddAuthenticationdfapolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication policy resource.
    .PARAMETER Name
        Name for the DFA policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after DFA policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the Web server.
    .PARAMETER Action
        Name of the DFA action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationdfapolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationdfapolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationdfapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationdfapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationdfapolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }

            if ( $PSCmdlet.ShouldProcess("authenticationdfapolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationdfapolicy -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-NSGetAuthenticationdfapolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationdfapolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationdfapolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication policy resource.
    .PARAMETER Name
        Name for the DFA policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after DFA policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationdfapolicy -Name <string>
        An example how to delete authenticationdfapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationdfapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy/
        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-NSDeleteAuthenticationdfapolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationdfapolicy -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-NSDeleteAuthenticationdfapolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationdfapolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Dfa authentication policy resource.
    .PARAMETER Name
        Name for the DFA policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after DFA policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the Web server.
    .PARAMETER Action
        Name of the DFA action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationdfapolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationdfapolicy -name <string>
        An example how to update authenticationdfapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationdfapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationdfapolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) }
            if ( $PSCmdlet.ShouldProcess("authenticationdfapolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationdfapolicy -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-NSGetAuthenticationdfapolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationdfapolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationdfapolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Dfa authentication policy resource.
    .PARAMETER Name
        Name for the DFA policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after DFA policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationdfapolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationdfapolicy 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-NSGetAuthenticationdfapolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicy -GetAll
        Get all authenticationdfapolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicy -Count
        Get the number of authenticationdfapolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicy -name <string>
        Get authenticationdfapolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicy -Filter @{ 'name'='<value>' }
        Get authenticationdfapolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationdfapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationdfapolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationdfapolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy -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 authenticationdfapolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationdfapolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationdfapolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationdfapolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy -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-NSGetAuthenticationdfapolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationdfapolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationdfapolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationdfapolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationdfapolicy_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-NSGetAuthenticationdfapolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyBinding -GetAll
        Get all authenticationdfapolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyBinding -name <string>
        Get authenticationdfapolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationdfapolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationdfapolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_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-NSGetAuthenticationdfapolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationdfapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_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 authenticationdfapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationdfapolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationdfapolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationdfapolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_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-NSGetAuthenticationdfapolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationdfapolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationdfapolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationdfapolicy_vpnvserver_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-NSGetAuthenticationdfapolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding -GetAll
        Get all authenticationdfapolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding -Count
        Get the number of authenticationdfapolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding -name <string>
        Get authenticationdfapolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationdfapolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationdfapolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_vpnvserver_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-NSGetAuthenticationdfapolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationdfapolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_vpnvserver_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 authenticationdfapolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationdfapolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationdfapolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationdfapolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationdfapolicy_vpnvserver_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-NSGetAuthenticationdfapolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationemailaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Email entity resource.
    .PARAMETER Name
        Name for the new email 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 an action is created.
    .PARAMETER Username
        Username/Clientid/EmailID to be used to authenticate to the server.
    .PARAMETER Password
        Password/Clientsecret to use when authenticating to the server.
    .PARAMETER Serverurl
        Address of the server that delivers the message. It is fully qualified fqdn such as http(s):// or smtp(s):// for http and smtp protocols respectively. For SMTP, the port number is mandatory like smtps://smtp.example.com:25.
    .PARAMETER Content
        Content to be delivered to the user. "$code" string within the content will be replaced with the actual one-time-code to be sent.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Timeout
        Time after which the code expires.
    .PARAMETER Type
        Type of the email action. Default type is SMTP.
         
        Possible values = SMTP, ATHENA
    .PARAMETER Emailaddress
        An optional expression that yields user's email. When not configured, user's default mail address would be used. When configured, result of this expression is used as destination email address.
    .PARAMETER PassThru
        Return details about the created authenticationemailaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationemailaction -name <string> -username <string> -password <string> -serverurl <string>
        An example how to add authenticationemailaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationemailaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Username,

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

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

        [string]$Content,

        [string]$Defaultauthenticationgroup,

        [double]$Timeout = '180',

        [ValidateSet('SMTP', 'ATHENA')]
        [string]$Type = 'SMTP',

        [string]$Emailaddress,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationemailaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                username       = $username
                password       = $password
                serverurl      = $serverurl
            }
            if ( $PSBoundParameters.ContainsKey('content') ) { $payload.Add('content', $content) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('timeout') ) { $payload.Add('timeout', $timeout) }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSBoundParameters.ContainsKey('emailaddress') ) { $payload.Add('emailaddress', $emailaddress) }
            if ( $PSCmdlet.ShouldProcess("authenticationemailaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationemailaction -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-NSGetAuthenticationemailaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationemailaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationemailaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Email entity resource.
    .PARAMETER Name
        Name for the new email 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationemailaction -Name <string>
        An example how to delete authenticationemailaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationemailaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction/
        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-NSDeleteAuthenticationemailaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationemailaction -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-NSDeleteAuthenticationemailaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationemailaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Email entity resource.
    .PARAMETER Name
        Name for the new email 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 an action is created.
    .PARAMETER Username
        Username/Clientid/EmailID to be used to authenticate to the server.
    .PARAMETER Password
        Password/Clientsecret to use when authenticating to the server.
    .PARAMETER Serverurl
        Address of the server that delivers the message. It is fully qualified fqdn such as http(s):// or smtp(s):// for http and smtp protocols respectively. For SMTP, the port number is mandatory like smtps://smtp.example.com:25.
    .PARAMETER Content
        Content to be delivered to the user. "$code" string within the content will be replaced with the actual one-time-code to be sent.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Timeout
        Time after which the code expires.
    .PARAMETER Type
        Type of the email action. Default type is SMTP.
         
        Possible values = SMTP, ATHENA
    .PARAMETER Emailaddress
        An optional expression that yields user's email. When not configured, user's default mail address would be used. When configured, result of this expression is used as destination email address.
    .PARAMETER PassThru
        Return details about the created authenticationemailaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationemailaction -name <string>
        An example how to update authenticationemailaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationemailaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction/
        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,

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

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

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

        [string]$Content,

        [string]$Defaultauthenticationgroup,

        [double]$Timeout,

        [ValidateSet('SMTP', 'ATHENA')]
        [string]$Type,

        [string]$Emailaddress,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationemailaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('username') ) { $payload.Add('username', $username) }
            if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('content') ) { $payload.Add('content', $content) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('timeout') ) { $payload.Add('timeout', $timeout) }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSBoundParameters.ContainsKey('emailaddress') ) { $payload.Add('emailaddress', $emailaddress) }
            if ( $PSCmdlet.ShouldProcess("authenticationemailaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationemailaction -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-NSGetAuthenticationemailaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationemailaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationemailaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Email entity resource.
    .PARAMETER Name
        Name for the new email 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 an action is created.
    .PARAMETER Content
        Content to be delivered to the user. "$code" string within the content will be replaced with the actual one-time-code to be sent.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current IdP policy. It can be used in policies to identify relying party trust.
    .PARAMETER Timeout
        Time after which the code expires.
    .PARAMETER Type
        Type of the email action. Default type is SMTP.
         
        Possible values = SMTP, ATHENA
    .PARAMETER Emailaddress
        An optional expression that yields user's email. When not configured, user's default mail address would be used. When configured, result of this expression is used as destination email address.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationemailaction -name <string>
        An example how to unset authenticationemailaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationemailaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction
        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]$content,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$timeout,

        [Boolean]$type,

        [Boolean]$emailaddress 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationemailaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('content') ) { $payload.Add('content', $content) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('timeout') ) { $payload.Add('timeout', $timeout) }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSBoundParameters.ContainsKey('emailaddress') ) { $payload.Add('emailaddress', $emailaddress) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationemailaction -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-NSUnsetAuthenticationemailaction: Finished"
    }
}

function Invoke-NSGetAuthenticationemailaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Email entity resource.
    .PARAMETER Name
        Name for the new email 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationemailaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationemailaction 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-NSGetAuthenticationemailaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationemailaction -GetAll
        Get all authenticationemailaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationemailaction -Count
        Get the number of authenticationemailaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationemailaction -name <string>
        Get authenticationemailaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationemailaction -Filter @{ 'name'='<value>' }
        Get authenticationemailaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationemailaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction/
        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-NSGetAuthenticationemailaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationemailaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationemailaction -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 authenticationemailaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationemailaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationemailaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationemailaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationemailaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationemailaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationemailaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationemailaction -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-NSGetAuthenticationemailaction: Ended"
    }
}

function Invoke-NSAddAuthenticationepaaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for epa action resource.
    .PARAMETER Name
        Name for the epa action. Must begin with a
        letter, number, or the underscore character (_), and must consist
        only of letters, numbers, and the hyphen (-), period (.) pound
        (#), space ( ), at (@), equals (=), colon (:), and underscore
        characters. Cannot be changed after epa action is created.
    .PARAMETER Csecexpr
        it holds the ClientSecurityExpression to be sent to the client.
    .PARAMETER Killprocess
        String specifying the name of a process to be terminated by the endpoint analysis (EPA) tool. Multiple processes to be delimited by comma.
    .PARAMETER Deletefiles
        String specifying the path(s) and name(s) of the files to be deleted by the endpoint analysis (EPA) tool. Multiple files to be delimited by comma.
    .PARAMETER Defaultepagroup
        This is the default group that is chosen when the EPA check succeeds.
    .PARAMETER Quarantinegroup
        This is the quarantine group that is chosen when the EPA check fails
        if configured.
    .PARAMETER PassThru
        Return details about the created authenticationepaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationepaaction -name <string> -csecexpr <string>
        An example how to add authenticationepaaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationepaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction/
        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]$Name,

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

        [string]$Killprocess,

        [string]$Deletefiles,

        [string]$Defaultepagroup,

        [string]$Quarantinegroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationepaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                csecexpr       = $csecexpr
            }
            if ( $PSBoundParameters.ContainsKey('killprocess') ) { $payload.Add('killprocess', $killprocess) }
            if ( $PSBoundParameters.ContainsKey('deletefiles') ) { $payload.Add('deletefiles', $deletefiles) }
            if ( $PSBoundParameters.ContainsKey('defaultepagroup') ) { $payload.Add('defaultepagroup', $defaultepagroup) }
            if ( $PSBoundParameters.ContainsKey('quarantinegroup') ) { $payload.Add('quarantinegroup', $quarantinegroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationepaaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationepaaction -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-NSGetAuthenticationepaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationepaaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationepaaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for epa action resource.
    .PARAMETER Name
        Name for the epa action. Must begin with a
        letter, number, or the underscore character (_), and must consist
        only of letters, numbers, and the hyphen (-), period (.) pound
        (#), space ( ), at (@), equals (=), colon (:), and underscore
        characters. Cannot be changed after epa action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationepaaction -Name <string>
        An example how to delete authenticationepaaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationepaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction/
        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-NSDeleteAuthenticationepaaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationepaaction -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-NSDeleteAuthenticationepaaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationepaaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for epa action resource.
    .PARAMETER Name
        Name for the epa action. Must begin with a
        letter, number, or the underscore character (_), and must consist
        only of letters, numbers, and the hyphen (-), period (.) pound
        (#), space ( ), at (@), equals (=), colon (:), and underscore
        characters. Cannot be changed after epa action is created.
    .PARAMETER Csecexpr
        it holds the ClientSecurityExpression to be sent to the client.
    .PARAMETER Killprocess
        String specifying the name of a process to be terminated by the endpoint analysis (EPA) tool. Multiple processes to be delimited by comma.
    .PARAMETER Deletefiles
        String specifying the path(s) and name(s) of the files to be deleted by the endpoint analysis (EPA) tool. Multiple files to be delimited by comma.
    .PARAMETER Defaultepagroup
        This is the default group that is chosen when the EPA check succeeds.
    .PARAMETER Quarantinegroup
        This is the quarantine group that is chosen when the EPA check fails
        if configured.
    .PARAMETER PassThru
        Return details about the created authenticationepaaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationepaaction -name <string>
        An example how to update authenticationepaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationepaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction/
        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]$Name,

        [string]$Csecexpr,

        [string]$Killprocess,

        [string]$Deletefiles,

        [string]$Defaultepagroup,

        [string]$Quarantinegroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationepaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('csecexpr') ) { $payload.Add('csecexpr', $csecexpr) }
            if ( $PSBoundParameters.ContainsKey('killprocess') ) { $payload.Add('killprocess', $killprocess) }
            if ( $PSBoundParameters.ContainsKey('deletefiles') ) { $payload.Add('deletefiles', $deletefiles) }
            if ( $PSBoundParameters.ContainsKey('defaultepagroup') ) { $payload.Add('defaultepagroup', $defaultepagroup) }
            if ( $PSBoundParameters.ContainsKey('quarantinegroup') ) { $payload.Add('quarantinegroup', $quarantinegroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationepaaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationepaaction -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-NSGetAuthenticationepaaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationepaaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationepaaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for epa action resource.
    .PARAMETER Name
        Name for the epa action. Must begin with a
        letter, number, or the underscore character (_), and must consist
        only of letters, numbers, and the hyphen (-), period (.) pound
        (#), space ( ), at (@), equals (=), colon (:), and underscore
        characters. Cannot be changed after epa action is created.
    .PARAMETER Killprocess
        String specifying the name of a process to be terminated by the endpoint analysis (EPA) tool. Multiple processes to be delimited by comma.
    .PARAMETER Deletefiles
        String specifying the path(s) and name(s) of the files to be deleted by the endpoint analysis (EPA) tool. Multiple files to be delimited by comma.
    .PARAMETER Defaultepagroup
        This is the default group that is chosen when the EPA check succeeds.
    .PARAMETER Quarantinegroup
        This is the quarantine group that is chosen when the EPA check fails
        if configured.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationepaaction -name <string>
        An example how to unset authenticationepaaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationepaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction
        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]$Name,

        [Boolean]$killprocess,

        [Boolean]$deletefiles,

        [Boolean]$defaultepagroup,

        [Boolean]$quarantinegroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationepaaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('killprocess') ) { $payload.Add('killprocess', $killprocess) }
            if ( $PSBoundParameters.ContainsKey('deletefiles') ) { $payload.Add('deletefiles', $deletefiles) }
            if ( $PSBoundParameters.ContainsKey('defaultepagroup') ) { $payload.Add('defaultepagroup', $defaultepagroup) }
            if ( $PSBoundParameters.ContainsKey('quarantinegroup') ) { $payload.Add('quarantinegroup', $quarantinegroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationepaaction -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-NSUnsetAuthenticationepaaction: Finished"
    }
}

function Invoke-NSGetAuthenticationepaaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for epa action resource.
    .PARAMETER Name
        Name for the epa action. Must begin with a
        letter, number, or the underscore character (_), and must consist
        only of letters, numbers, and the hyphen (-), period (.) pound
        (#), space ( ), at (@), equals (=), colon (:), and underscore
        characters. Cannot be changed after epa action is created.
    .PARAMETER GetAll
        Retrieve all authenticationepaaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationepaaction 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-NSGetAuthenticationepaaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationepaaction -GetAll
        Get all authenticationepaaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationepaaction -Count
        Get the number of authenticationepaaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationepaaction -name <string>
        Get authenticationepaaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationepaaction -Filter @{ 'name'='<value>' }
        Get authenticationepaaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationepaaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationepaaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationepaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationepaaction -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 authenticationepaaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationepaaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationepaaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationepaaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationepaaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationepaaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationepaaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationepaaction -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-NSGetAuthenticationepaaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationldapaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP action resource.
    .PARAMETER Name
        Name for the new LDAP action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the LDAP action is added.
    .PARAMETER Serverport
        Port on which the LDAP server accepts connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Ldapbase
        Base (node) from which to start LDAP searches.
        If the LDAP server is running locally, the default value of base is dc=netscaler, dc=com.
    .PARAMETER Ldapbinddn
        Full distinguished name (DN) that is used to bind to the LDAP server.
        Default: cn=Manager,dc=netscaler,dc=com.
    .PARAMETER Ldapbinddnpassword
        Password used to bind to the LDAP server.
    .PARAMETER Ldaploginname
        LDAP login name attribute.
        The Citrix ADC uses the LDAP login name to query external LDAP servers or Active Directories.
    .PARAMETER Searchfilter
        String to be combined with the default LDAP user search string to form the search value. For example, if the search filter "vpnallowed=true" is combined with the LDAP login name "samaccount" and the user-supplied username is "bob", the result is the LDAP search string ""&amp;(vpnallowed=true)(samaccount=bob)"" (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Groupattrname
        LDAP group attribute name.
        Used for group extraction on the LDAP server.
    .PARAMETER Subattributename
        LDAP group sub-attribute name.
        Used for group extraction from the LDAP server.
    .PARAMETER Sectype
        Type of security used for communications between the Citrix ADC and the LDAP server. For the PLAINTEXT setting, no encryption is required.
         
        Possible values = PLAINTEXT, TLS, SSL
    .PARAMETER Svrtype
        The type of LDAP server.
         
        Possible values = AD, NDS
    .PARAMETER Ssonameattribute
        LDAP single signon (SSO) attribute.
        The Citrix ADC uses the SSO name attribute to query external LDAP servers or Active Directories for an alternate username.
    .PARAMETER Authentication
        Perform LDAP authentication.
        If authentication is disabled, any LDAP authentication attempt returns authentication success if the user is found.
        CAUTION! Authentication should be disabled only for authorization group extraction or where other (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Requireuser
        Require a successful user search for authentication.
        CAUTION! This field should be set to NO only if usersearch not required [Both username validation as well as password validation skipped] and (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = YES, NO
    .PARAMETER Passwdchange
        Allow password change requests.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Validateservercert
        When to validate LDAP server certs.
         
        Possible values = YES, NO
    .PARAMETER Ldaphostname
        Hostname for the LDAP server. If -validateServerCert is ON then this must be the host name on the certificate from the LDAP server.
        A hostname mismatch will cause a connection failure.
    .PARAMETER Nestedgroupextraction
        Allow nested group extraction, in which the Citrix ADC queries external LDAP servers to determine whether a group is part of another group.
         
        Possible values = ON, OFF
    .PARAMETER Maxnestinglevel
        If nested group extraction is ON, specifies the number of levels up to which group extraction is performed.
    .PARAMETER Groupnameidentifier
        Name that uniquely identifies a group in LDAP or Active Directory.
    .PARAMETER Groupsearchattribute
        LDAP group search attribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchsubattribute
        LDAP group search subattribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchfilter
        String to be combined with the default LDAP group search string to form the search value. For example, the group search filter ""vpnallowed=true"" when combined with the group identifier ""samaccount"" and the group name ""g1"" yields the LDAP search string ""(&amp;(vpnallowed=true)(samaccount=g1)"". If nestedGroupExtraction is ENABLED, the filter is applied on the first level group search as well, otherwise first level groups (of which user is a direct member of) will be fetched without applying this filter. (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Followreferrals
        Setting this option to ON enables following LDAP referrals received from the LDAP server.
         
        Possible values = ON, OFF
    .PARAMETER Maxldapreferrals
        Specifies the maximum number of nested referrals to follow.
    .PARAMETER Referraldnslookup
        Specifies the DNS Record lookup Type for the referrals.
         
        Possible values = A-REC, SRV-REC, MSSRV-REC
    .PARAMETER Mssrvrecordlocation
        MSSRV Specific parameter. Used to locate the DNS node to which the SRV record pertains in the domainname. The domainname is appended to it to form the srv record.
        Example : For "dc._msdcs", the srv record formed is _ldap._tcp.dc._msdcs.&lt;domainname&gt;.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the ldap response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the ldap response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the ldap response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the ldap response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the ldap response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the ldap response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the ldap response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the ldap response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the ldap response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the ldap response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the ldap response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the ldap response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the ldap response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the ldap response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the ldap response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the ldap response.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from ldap server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Otpsecret
        OneTimePassword(OTP) Secret key attribute on AD. This attribute is used to store and retrieve secret key used for OTP check.
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Email
        The Citrix ADC uses the email attribute to query the Active Directory for the email id of a user.
    .PARAMETER Kbattribute
        KnowledgeBasedAuthentication(KBA) attribute on AD. This attribute is used to store and retrieve preconfigured Question and Answer knowledge base used for KBA authentication.
    .PARAMETER Alternateemailattr
        The NetScaler appliance uses the alternateive email attribute to query the Active Directory for the alternative email id of a user.
    .PARAMETER Cloudattributes
        The Citrix ADC uses the cloud attributes to extract additional attributes from LDAP servers required for Citrix Cloud operations.
         
        Possible values = ENABLED, DISABLED
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationldapaction -name <string>
        An example how to unset authenticationldapaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationldapaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction
        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]$Name,

        [Boolean]$serverport,

        [Boolean]$authtimeout,

        [Boolean]$ldapbase,

        [Boolean]$ldapbinddn,

        [Boolean]$ldapbinddnpassword,

        [Boolean]$ldaploginname,

        [Boolean]$searchfilter,

        [Boolean]$groupattrname,

        [Boolean]$subattributename,

        [Boolean]$sectype,

        [Boolean]$svrtype,

        [Boolean]$ssonameattribute,

        [Boolean]$authentication,

        [Boolean]$requireuser,

        [Boolean]$passwdchange,

        [Boolean]$validateservercert,

        [Boolean]$ldaphostname,

        [Boolean]$nestedgroupextraction,

        [Boolean]$maxnestinglevel,

        [Boolean]$groupnameidentifier,

        [Boolean]$groupsearchattribute,

        [Boolean]$groupsearchsubattribute,

        [Boolean]$groupsearchfilter,

        [Boolean]$followreferrals,

        [Boolean]$maxldapreferrals,

        [Boolean]$referraldnslookup,

        [Boolean]$mssrvrecordlocation,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$attribute1,

        [Boolean]$attribute2,

        [Boolean]$attribute3,

        [Boolean]$attribute4,

        [Boolean]$attribute5,

        [Boolean]$attribute6,

        [Boolean]$attribute7,

        [Boolean]$attribute8,

        [Boolean]$attribute9,

        [Boolean]$attribute10,

        [Boolean]$attribute11,

        [Boolean]$attribute12,

        [Boolean]$attribute13,

        [Boolean]$attribute14,

        [Boolean]$attribute15,

        [Boolean]$attribute16,

        [Boolean]$attributes,

        [Boolean]$otpsecret,

        [Boolean]$pushservice,

        [Boolean]$email,

        [Boolean]$kbattribute,

        [Boolean]$alternateemailattr,

        [Boolean]$cloudattributes 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationldapaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('ldapbase') ) { $payload.Add('ldapbase', $ldapbase) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddn') ) { $payload.Add('ldapbinddn', $ldapbinddn) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddnpassword') ) { $payload.Add('ldapbinddnpassword', $ldapbinddnpassword) }
            if ( $PSBoundParameters.ContainsKey('ldaploginname') ) { $payload.Add('ldaploginname', $ldaploginname) }
            if ( $PSBoundParameters.ContainsKey('searchfilter') ) { $payload.Add('searchfilter', $searchfilter) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('subattributename') ) { $payload.Add('subattributename', $subattributename) }
            if ( $PSBoundParameters.ContainsKey('sectype') ) { $payload.Add('sectype', $sectype) }
            if ( $PSBoundParameters.ContainsKey('svrtype') ) { $payload.Add('svrtype', $svrtype) }
            if ( $PSBoundParameters.ContainsKey('ssonameattribute') ) { $payload.Add('ssonameattribute', $ssonameattribute) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('requireuser') ) { $payload.Add('requireuser', $requireuser) }
            if ( $PSBoundParameters.ContainsKey('passwdchange') ) { $payload.Add('passwdchange', $passwdchange) }
            if ( $PSBoundParameters.ContainsKey('validateservercert') ) { $payload.Add('validateservercert', $validateservercert) }
            if ( $PSBoundParameters.ContainsKey('ldaphostname') ) { $payload.Add('ldaphostname', $ldaphostname) }
            if ( $PSBoundParameters.ContainsKey('nestedgroupextraction') ) { $payload.Add('nestedgroupextraction', $nestedgroupextraction) }
            if ( $PSBoundParameters.ContainsKey('maxnestinglevel') ) { $payload.Add('maxnestinglevel', $maxnestinglevel) }
            if ( $PSBoundParameters.ContainsKey('groupnameidentifier') ) { $payload.Add('groupnameidentifier', $groupnameidentifier) }
            if ( $PSBoundParameters.ContainsKey('groupsearchattribute') ) { $payload.Add('groupsearchattribute', $groupsearchattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchsubattribute') ) { $payload.Add('groupsearchsubattribute', $groupsearchsubattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchfilter') ) { $payload.Add('groupsearchfilter', $groupsearchfilter) }
            if ( $PSBoundParameters.ContainsKey('followreferrals') ) { $payload.Add('followreferrals', $followreferrals) }
            if ( $PSBoundParameters.ContainsKey('maxldapreferrals') ) { $payload.Add('maxldapreferrals', $maxldapreferrals) }
            if ( $PSBoundParameters.ContainsKey('referraldnslookup') ) { $payload.Add('referraldnslookup', $referraldnslookup) }
            if ( $PSBoundParameters.ContainsKey('mssrvrecordlocation') ) { $payload.Add('mssrvrecordlocation', $mssrvrecordlocation) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('otpsecret') ) { $payload.Add('otpsecret', $otpsecret) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('email') ) { $payload.Add('email', $email) }
            if ( $PSBoundParameters.ContainsKey('kbattribute') ) { $payload.Add('kbattribute', $kbattribute) }
            if ( $PSBoundParameters.ContainsKey('alternateemailattr') ) { $payload.Add('alternateemailattr', $alternateemailattr) }
            if ( $PSBoundParameters.ContainsKey('cloudattributes') ) { $payload.Add('cloudattributes', $cloudattributes) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationldapaction -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-NSUnsetAuthenticationldapaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationldapaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP action resource.
    .PARAMETER Name
        Name for the new LDAP action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the LDAP action is added.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationldapaction -Name <string>
        An example how to delete authenticationldapaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationldapaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction/
        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-NSDeleteAuthenticationldapaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationldapaction -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-NSDeleteAuthenticationldapaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationldapaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP action resource.
    .PARAMETER Name
        Name for the new LDAP action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the LDAP action is added.
    .PARAMETER Serverip
        IP address assigned to the LDAP server.
    .PARAMETER Servername
        LDAP server name as a FQDN. Mutually exclusive with LDAP IP address.
    .PARAMETER Serverport
        Port on which the LDAP server accepts connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Ldapbase
        Base (node) from which to start LDAP searches.
        If the LDAP server is running locally, the default value of base is dc=netscaler, dc=com.
    .PARAMETER Ldapbinddn
        Full distinguished name (DN) that is used to bind to the LDAP server.
        Default: cn=Manager,dc=netscaler,dc=com.
    .PARAMETER Ldapbinddnpassword
        Password used to bind to the LDAP server.
    .PARAMETER Ldaploginname
        LDAP login name attribute.
        The Citrix ADC uses the LDAP login name to query external LDAP servers or Active Directories.
    .PARAMETER Searchfilter
        String to be combined with the default LDAP user search string to form the search value. For example, if the search filter "vpnallowed=true" is combined with the LDAP login name "samaccount" and the user-supplied username is "bob", the result is the LDAP search string ""&amp;(vpnallowed=true)(samaccount=bob)"" (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Groupattrname
        LDAP group attribute name.
        Used for group extraction on the LDAP server.
    .PARAMETER Subattributename
        LDAP group sub-attribute name.
        Used for group extraction from the LDAP server.
    .PARAMETER Sectype
        Type of security used for communications between the Citrix ADC and the LDAP server. For the PLAINTEXT setting, no encryption is required.
         
        Possible values = PLAINTEXT, TLS, SSL
    .PARAMETER Svrtype
        The type of LDAP server.
         
        Possible values = AD, NDS
    .PARAMETER Ssonameattribute
        LDAP single signon (SSO) attribute.
        The Citrix ADC uses the SSO name attribute to query external LDAP servers or Active Directories for an alternate username.
    .PARAMETER Authentication
        Perform LDAP authentication.
        If authentication is disabled, any LDAP authentication attempt returns authentication success if the user is found.
        CAUTION! Authentication should be disabled only for authorization group extraction or where other (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Requireuser
        Require a successful user search for authentication.
        CAUTION! This field should be set to NO only if usersearch not required [Both username validation as well as password validation skipped] and (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = YES, NO
    .PARAMETER Passwdchange
        Allow password change requests.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Validateservercert
        When to validate LDAP server certs.
         
        Possible values = YES, NO
    .PARAMETER Ldaphostname
        Hostname for the LDAP server. If -validateServerCert is ON then this must be the host name on the certificate from the LDAP server.
        A hostname mismatch will cause a connection failure.
    .PARAMETER Nestedgroupextraction
        Allow nested group extraction, in which the Citrix ADC queries external LDAP servers to determine whether a group is part of another group.
         
        Possible values = ON, OFF
    .PARAMETER Maxnestinglevel
        If nested group extraction is ON, specifies the number of levels up to which group extraction is performed.
    .PARAMETER Groupnameidentifier
        Name that uniquely identifies a group in LDAP or Active Directory.
    .PARAMETER Groupsearchattribute
        LDAP group search attribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchsubattribute
        LDAP group search subattribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchfilter
        String to be combined with the default LDAP group search string to form the search value. For example, the group search filter ""vpnallowed=true"" when combined with the group identifier ""samaccount"" and the group name ""g1"" yields the LDAP search string ""(&amp;(vpnallowed=true)(samaccount=g1)"". If nestedGroupExtraction is ENABLED, the filter is applied on the first level group search as well, otherwise first level groups (of which user is a direct member of) will be fetched without applying this filter. (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Followreferrals
        Setting this option to ON enables following LDAP referrals received from the LDAP server.
         
        Possible values = ON, OFF
    .PARAMETER Maxldapreferrals
        Specifies the maximum number of nested referrals to follow.
    .PARAMETER Referraldnslookup
        Specifies the DNS Record lookup Type for the referrals.
         
        Possible values = A-REC, SRV-REC, MSSRV-REC
    .PARAMETER Mssrvrecordlocation
        MSSRV Specific parameter. Used to locate the DNS node to which the SRV record pertains in the domainname. The domainname is appended to it to form the srv record.
        Example : For "dc._msdcs", the srv record formed is _ldap._tcp.dc._msdcs.&lt;domainname&gt;.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the ldap response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the ldap response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the ldap response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the ldap response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the ldap response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the ldap response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the ldap response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the ldap response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the ldap response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the ldap response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the ldap response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the ldap response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the ldap response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the ldap response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the ldap response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the ldap response.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from ldap server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Otpsecret
        OneTimePassword(OTP) Secret key attribute on AD. This attribute is used to store and retrieve secret key used for OTP check.
    .PARAMETER Sshpublickey
        SSH PublicKey is attribute on AD. This attribute is used to retrieve ssh PublicKey for RBA authentication.
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Email
        The Citrix ADC uses the email attribute to query the Active Directory for the email id of a user.
    .PARAMETER Kbattribute
        KnowledgeBasedAuthentication(KBA) attribute on AD. This attribute is used to store and retrieve preconfigured Question and Answer knowledge base used for KBA authentication.
    .PARAMETER Alternateemailattr
        The NetScaler appliance uses the alternateive email attribute to query the Active Directory for the alternative email id of a user.
    .PARAMETER Cloudattributes
        The Citrix ADC uses the cloud attributes to extract additional attributes from LDAP servers required for Citrix Cloud operations.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationldapaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationldapaction -name <string>
        An example how to update authenticationldapaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationldapaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction/
        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]$Name,

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

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

        [int]$Serverport,

        [double]$Authtimeout,

        [string]$Ldapbase,

        [string]$Ldapbinddn,

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

        [string]$Ldaploginname,

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

        [string]$Groupattrname,

        [string]$Subattributename,

        [ValidateSet('PLAINTEXT', 'TLS', 'SSL')]
        [string]$Sectype,

        [ValidateSet('AD', 'NDS')]
        [string]$Svrtype,

        [string]$Ssonameattribute,

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

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

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

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

        [string]$Ldaphostname,

        [ValidateSet('ON', 'OFF')]
        [string]$Nestedgroupextraction,

        [double]$Maxnestinglevel,

        [string]$Groupnameidentifier,

        [string]$Groupsearchattribute,

        [string]$Groupsearchsubattribute,

        [string]$Groupsearchfilter,

        [ValidateSet('ON', 'OFF')]
        [string]$Followreferrals,

        [double]$Maxldapreferrals,

        [ValidateSet('A-REC', 'SRV-REC', 'MSSRV-REC')]
        [string]$Referraldnslookup,

        [string]$Mssrvrecordlocation,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

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

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

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

        [string]$Email,

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

        [string]$Alternateemailattr,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationldapaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('ldapbase') ) { $payload.Add('ldapbase', $ldapbase) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddn') ) { $payload.Add('ldapbinddn', $ldapbinddn) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddnpassword') ) { $payload.Add('ldapbinddnpassword', $ldapbinddnpassword) }
            if ( $PSBoundParameters.ContainsKey('ldaploginname') ) { $payload.Add('ldaploginname', $ldaploginname) }
            if ( $PSBoundParameters.ContainsKey('searchfilter') ) { $payload.Add('searchfilter', $searchfilter) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('subattributename') ) { $payload.Add('subattributename', $subattributename) }
            if ( $PSBoundParameters.ContainsKey('sectype') ) { $payload.Add('sectype', $sectype) }
            if ( $PSBoundParameters.ContainsKey('svrtype') ) { $payload.Add('svrtype', $svrtype) }
            if ( $PSBoundParameters.ContainsKey('ssonameattribute') ) { $payload.Add('ssonameattribute', $ssonameattribute) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('requireuser') ) { $payload.Add('requireuser', $requireuser) }
            if ( $PSBoundParameters.ContainsKey('passwdchange') ) { $payload.Add('passwdchange', $passwdchange) }
            if ( $PSBoundParameters.ContainsKey('validateservercert') ) { $payload.Add('validateservercert', $validateservercert) }
            if ( $PSBoundParameters.ContainsKey('ldaphostname') ) { $payload.Add('ldaphostname', $ldaphostname) }
            if ( $PSBoundParameters.ContainsKey('nestedgroupextraction') ) { $payload.Add('nestedgroupextraction', $nestedgroupextraction) }
            if ( $PSBoundParameters.ContainsKey('maxnestinglevel') ) { $payload.Add('maxnestinglevel', $maxnestinglevel) }
            if ( $PSBoundParameters.ContainsKey('groupnameidentifier') ) { $payload.Add('groupnameidentifier', $groupnameidentifier) }
            if ( $PSBoundParameters.ContainsKey('groupsearchattribute') ) { $payload.Add('groupsearchattribute', $groupsearchattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchsubattribute') ) { $payload.Add('groupsearchsubattribute', $groupsearchsubattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchfilter') ) { $payload.Add('groupsearchfilter', $groupsearchfilter) }
            if ( $PSBoundParameters.ContainsKey('followreferrals') ) { $payload.Add('followreferrals', $followreferrals) }
            if ( $PSBoundParameters.ContainsKey('maxldapreferrals') ) { $payload.Add('maxldapreferrals', $maxldapreferrals) }
            if ( $PSBoundParameters.ContainsKey('referraldnslookup') ) { $payload.Add('referraldnslookup', $referraldnslookup) }
            if ( $PSBoundParameters.ContainsKey('mssrvrecordlocation') ) { $payload.Add('mssrvrecordlocation', $mssrvrecordlocation) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('otpsecret') ) { $payload.Add('otpsecret', $otpsecret) }
            if ( $PSBoundParameters.ContainsKey('sshpublickey') ) { $payload.Add('sshpublickey', $sshpublickey) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('email') ) { $payload.Add('email', $email) }
            if ( $PSBoundParameters.ContainsKey('kbattribute') ) { $payload.Add('kbattribute', $kbattribute) }
            if ( $PSBoundParameters.ContainsKey('alternateemailattr') ) { $payload.Add('alternateemailattr', $alternateemailattr) }
            if ( $PSBoundParameters.ContainsKey('cloudattributes') ) { $payload.Add('cloudattributes', $cloudattributes) }
            if ( $PSCmdlet.ShouldProcess("authenticationldapaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationldapaction -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-NSGetAuthenticationldapaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationldapaction: Finished"
    }
}

function Invoke-NSAddAuthenticationldapaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP action resource.
    .PARAMETER Name
        Name for the new LDAP action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the LDAP action is added.
    .PARAMETER Serverip
        IP address assigned to the LDAP server.
    .PARAMETER Servername
        LDAP server name as a FQDN. Mutually exclusive with LDAP IP address.
    .PARAMETER Serverport
        Port on which the LDAP server accepts connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Ldapbase
        Base (node) from which to start LDAP searches.
        If the LDAP server is running locally, the default value of base is dc=netscaler, dc=com.
    .PARAMETER Ldapbinddn
        Full distinguished name (DN) that is used to bind to the LDAP server.
        Default: cn=Manager,dc=netscaler,dc=com.
    .PARAMETER Ldapbinddnpassword
        Password used to bind to the LDAP server.
    .PARAMETER Ldaploginname
        LDAP login name attribute.
        The Citrix ADC uses the LDAP login name to query external LDAP servers or Active Directories.
    .PARAMETER Searchfilter
        String to be combined with the default LDAP user search string to form the search value. For example, if the search filter "vpnallowed=true" is combined with the LDAP login name "samaccount" and the user-supplied username is "bob", the result is the LDAP search string ""&amp;(vpnallowed=true)(samaccount=bob)"" (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Groupattrname
        LDAP group attribute name.
        Used for group extraction on the LDAP server.
    .PARAMETER Subattributename
        LDAP group sub-attribute name.
        Used for group extraction from the LDAP server.
    .PARAMETER Sectype
        Type of security used for communications between the Citrix ADC and the LDAP server. For the PLAINTEXT setting, no encryption is required.
         
        Possible values = PLAINTEXT, TLS, SSL
    .PARAMETER Svrtype
        The type of LDAP server.
         
        Possible values = AD, NDS
    .PARAMETER Ssonameattribute
        LDAP single signon (SSO) attribute.
        The Citrix ADC uses the SSO name attribute to query external LDAP servers or Active Directories for an alternate username.
    .PARAMETER Authentication
        Perform LDAP authentication.
        If authentication is disabled, any LDAP authentication attempt returns authentication success if the user is found.
        CAUTION! Authentication should be disabled only for authorization group extraction or where other (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Requireuser
        Require a successful user search for authentication.
        CAUTION! This field should be set to NO only if usersearch not required [Both username validation as well as password validation skipped] and (non-LDAP) authentication methods are in use and either bound to a primary list or flagged as secondary.
         
        Possible values = YES, NO
    .PARAMETER Passwdchange
        Allow password change requests.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Nestedgroupextraction
        Allow nested group extraction, in which the Citrix ADC queries external LDAP servers to determine whether a group is part of another group.
         
        Possible values = ON, OFF
    .PARAMETER Maxnestinglevel
        If nested group extraction is ON, specifies the number of levels up to which group extraction is performed.
    .PARAMETER Followreferrals
        Setting this option to ON enables following LDAP referrals received from the LDAP server.
         
        Possible values = ON, OFF
    .PARAMETER Maxldapreferrals
        Specifies the maximum number of nested referrals to follow.
    .PARAMETER Referraldnslookup
        Specifies the DNS Record lookup Type for the referrals.
         
        Possible values = A-REC, SRV-REC, MSSRV-REC
    .PARAMETER Mssrvrecordlocation
        MSSRV Specific parameter. Used to locate the DNS node to which the SRV record pertains in the domainname. The domainname is appended to it to form the srv record.
        Example : For "dc._msdcs", the srv record formed is _ldap._tcp.dc._msdcs.&lt;domainname&gt;.
    .PARAMETER Validateservercert
        When to validate LDAP server certs.
         
        Possible values = YES, NO
    .PARAMETER Ldaphostname
        Hostname for the LDAP server. If -validateServerCert is ON then this must be the host name on the certificate from the LDAP server.
        A hostname mismatch will cause a connection failure.
    .PARAMETER Groupnameidentifier
        Name that uniquely identifies a group in LDAP or Active Directory.
    .PARAMETER Groupsearchattribute
        LDAP group search attribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchsubattribute
        LDAP group search subattribute.
        Used to determine to which groups a group belongs.
    .PARAMETER Groupsearchfilter
        String to be combined with the default LDAP group search string to form the search value. For example, the group search filter ""vpnallowed=true"" when combined with the group identifier ""samaccount"" and the group name ""g1"" yields the LDAP search string ""(&amp;(vpnallowed=true)(samaccount=g1)"". If nestedGroupExtraction is ENABLED, the filter is applied on the first level group search as well, otherwise first level groups (of which user is a direct member of) will be fetched without applying this filter. (Be sure to enclose the search string in two sets of double quotation marks; both sets are needed.).
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the ldap response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the ldap response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the ldap response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the ldap response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the ldap response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the ldap response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the ldap response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the ldap response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the ldap response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the ldap response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the ldap response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the ldap response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the ldap response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the ldap response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the ldap response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the ldap response.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from ldap server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Sshpublickey
        SSH PublicKey is attribute on AD. This attribute is used to retrieve ssh PublicKey for RBA authentication.
    .PARAMETER Pushservice
        Name of the service used to send push notifications.
    .PARAMETER Otpsecret
        OneTimePassword(OTP) Secret key attribute on AD. This attribute is used to store and retrieve secret key used for OTP check.
    .PARAMETER Email
        The Citrix ADC uses the email attribute to query the Active Directory for the email id of a user.
    .PARAMETER Kbattribute
        KnowledgeBasedAuthentication(KBA) attribute on AD. This attribute is used to store and retrieve preconfigured Question and Answer knowledge base used for KBA authentication.
    .PARAMETER Alternateemailattr
        The NetScaler appliance uses the alternateive email attribute to query the Active Directory for the alternative email id of a user.
    .PARAMETER Cloudattributes
        The Citrix ADC uses the cloud attributes to extract additional attributes from LDAP servers required for Citrix Cloud operations.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER PassThru
        Return details about the created authenticationldapaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationldapaction -name <string>
        An example how to add authenticationldapaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationldapaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction/
        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]$Name,

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

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

        [int]$Serverport = '389',

        [double]$Authtimeout = '3',

        [string]$Ldapbase,

        [string]$Ldapbinddn,

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

        [string]$Ldaploginname,

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

        [string]$Groupattrname,

        [string]$Subattributename,

        [ValidateSet('PLAINTEXT', 'TLS', 'SSL')]
        [string]$Sectype = 'PLAINTEXT',

        [ValidateSet('AD', 'NDS')]
        [string]$Svrtype = 'AAA_LDAP_SERVER_TYPE_DEFAULT',

        [string]$Ssonameattribute,

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

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

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

        [ValidateSet('ON', 'OFF')]
        [string]$Nestedgroupextraction = 'OFF',

        [double]$Maxnestinglevel = '2',

        [ValidateSet('ON', 'OFF')]
        [string]$Followreferrals = 'OFF',

        [double]$Maxldapreferrals = '1',

        [ValidateSet('A-REC', 'SRV-REC', 'MSSRV-REC')]
        [string]$Referraldnslookup = 'A-REC',

        [string]$Mssrvrecordlocation,

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

        [string]$Ldaphostname,

        [string]$Groupnameidentifier,

        [string]$Groupsearchattribute,

        [string]$Groupsearchsubattribute,

        [string]$Groupsearchfilter,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

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

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

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

        [string]$Email = 'mail',

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

        [string]$Alternateemailattr,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationldapaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('ldapbase') ) { $payload.Add('ldapbase', $ldapbase) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddn') ) { $payload.Add('ldapbinddn', $ldapbinddn) }
            if ( $PSBoundParameters.ContainsKey('ldapbinddnpassword') ) { $payload.Add('ldapbinddnpassword', $ldapbinddnpassword) }
            if ( $PSBoundParameters.ContainsKey('ldaploginname') ) { $payload.Add('ldaploginname', $ldaploginname) }
            if ( $PSBoundParameters.ContainsKey('searchfilter') ) { $payload.Add('searchfilter', $searchfilter) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('subattributename') ) { $payload.Add('subattributename', $subattributename) }
            if ( $PSBoundParameters.ContainsKey('sectype') ) { $payload.Add('sectype', $sectype) }
            if ( $PSBoundParameters.ContainsKey('svrtype') ) { $payload.Add('svrtype', $svrtype) }
            if ( $PSBoundParameters.ContainsKey('ssonameattribute') ) { $payload.Add('ssonameattribute', $ssonameattribute) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('requireuser') ) { $payload.Add('requireuser', $requireuser) }
            if ( $PSBoundParameters.ContainsKey('passwdchange') ) { $payload.Add('passwdchange', $passwdchange) }
            if ( $PSBoundParameters.ContainsKey('nestedgroupextraction') ) { $payload.Add('nestedgroupextraction', $nestedgroupextraction) }
            if ( $PSBoundParameters.ContainsKey('maxnestinglevel') ) { $payload.Add('maxnestinglevel', $maxnestinglevel) }
            if ( $PSBoundParameters.ContainsKey('followreferrals') ) { $payload.Add('followreferrals', $followreferrals) }
            if ( $PSBoundParameters.ContainsKey('maxldapreferrals') ) { $payload.Add('maxldapreferrals', $maxldapreferrals) }
            if ( $PSBoundParameters.ContainsKey('referraldnslookup') ) { $payload.Add('referraldnslookup', $referraldnslookup) }
            if ( $PSBoundParameters.ContainsKey('mssrvrecordlocation') ) { $payload.Add('mssrvrecordlocation', $mssrvrecordlocation) }
            if ( $PSBoundParameters.ContainsKey('validateservercert') ) { $payload.Add('validateservercert', $validateservercert) }
            if ( $PSBoundParameters.ContainsKey('ldaphostname') ) { $payload.Add('ldaphostname', $ldaphostname) }
            if ( $PSBoundParameters.ContainsKey('groupnameidentifier') ) { $payload.Add('groupnameidentifier', $groupnameidentifier) }
            if ( $PSBoundParameters.ContainsKey('groupsearchattribute') ) { $payload.Add('groupsearchattribute', $groupsearchattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchsubattribute') ) { $payload.Add('groupsearchsubattribute', $groupsearchsubattribute) }
            if ( $PSBoundParameters.ContainsKey('groupsearchfilter') ) { $payload.Add('groupsearchfilter', $groupsearchfilter) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('sshpublickey') ) { $payload.Add('sshpublickey', $sshpublickey) }
            if ( $PSBoundParameters.ContainsKey('pushservice') ) { $payload.Add('pushservice', $pushservice) }
            if ( $PSBoundParameters.ContainsKey('otpsecret') ) { $payload.Add('otpsecret', $otpsecret) }
            if ( $PSBoundParameters.ContainsKey('email') ) { $payload.Add('email', $email) }
            if ( $PSBoundParameters.ContainsKey('kbattribute') ) { $payload.Add('kbattribute', $kbattribute) }
            if ( $PSBoundParameters.ContainsKey('alternateemailattr') ) { $payload.Add('alternateemailattr', $alternateemailattr) }
            if ( $PSBoundParameters.ContainsKey('cloudattributes') ) { $payload.Add('cloudattributes', $cloudattributes) }
            if ( $PSCmdlet.ShouldProcess("authenticationldapaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationldapaction -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-NSGetAuthenticationldapaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationldapaction: Finished"
    }
}

function Invoke-NSGetAuthenticationldapaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for LDAP action resource.
    .PARAMETER Name
        Name for the new LDAP action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the LDAP action is added.
    .PARAMETER GetAll
        Retrieve all authenticationldapaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldapaction 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-NSGetAuthenticationldapaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldapaction -GetAll
        Get all authenticationldapaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldapaction -Count
        Get the number of authenticationldapaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldapaction -name <string>
        Get authenticationldapaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldapaction -Filter @{ 'name'='<value>' }
        Get authenticationldapaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldapaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationldapaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationldapaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldapaction -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 authenticationldapaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldapaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldapaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldapaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldapaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldapaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldapaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldapaction -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-NSGetAuthenticationldapaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationldappolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP policy resource.
    .PARAMETER Name
        Name for the LDAP policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the LDAP server.
    .PARAMETER Reqaction
        Name of the LDAP action to perform if the policy matches.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationldappolicy -name <string>
        An example how to unset authenticationldappolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationldappolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy
        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]$Name,

        [Boolean]$rule,

        [Boolean]$reqaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationldappolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationldappolicy -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-NSUnsetAuthenticationldappolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationldappolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP policy resource.
    .PARAMETER Name
        Name for the LDAP policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the LDAP server.
    .PARAMETER Reqaction
        Name of the LDAP action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationldappolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationldappolicy -name <string> -rule <string>
        An example how to add authenticationldappolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationldappolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationldappolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
            }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationldappolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationldappolicy -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-NSGetAuthenticationldappolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationldappolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationldappolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP policy resource.
    .PARAMETER Name
        Name for the LDAP policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationldappolicy -Name <string>
        An example how to delete authenticationldappolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationldappolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy/
        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-NSDeleteAuthenticationldappolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationldappolicy -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-NSDeleteAuthenticationldappolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationldappolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LDAP policy resource.
    .PARAMETER Name
        Name for the LDAP policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the LDAP server.
    .PARAMETER Reqaction
        Name of the LDAP action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationldappolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationldappolicy -name <string>
        An example how to update authenticationldappolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationldappolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationldappolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationldappolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationldappolicy -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-NSGetAuthenticationldappolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationldappolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationldappolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for LDAP policy resource.
    .PARAMETER Name
        Name for the LDAP policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy 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-NSGetAuthenticationldappolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicy -GetAll
        Get all authenticationldappolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicy -Count
        Get the number of authenticationldappolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicy -name <string>
        Get authenticationldappolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicy -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationldappolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationldappolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy -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 authenticationldappolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy -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-NSGetAuthenticationldappolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationldappolicy.
    .PARAMETER Name
        Name of the LDAP policy.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy_authenticationvserver_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-NSGetAuthenticationldappolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding -GetAll
        Get all authenticationldappolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding -Count
        Get the number of authenticationldappolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding -name <string>
        Get authenticationldappolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_authenticationvserver_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-NSGetAuthenticationldappolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationldappolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_authenticationvserver_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 authenticationldappolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_authenticationvserver_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-NSGetAuthenticationldappolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationldappolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationldappolicy.
    .PARAMETER Name
        Name of the LDAP policy.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy_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-NSGetAuthenticationldappolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyBinding -GetAll
        Get all authenticationldappolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyBinding -name <string>
        Get authenticationldappolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_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-NSGetAuthenticationldappolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationldappolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_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 authenticationldappolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_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-NSGetAuthenticationldappolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationldappolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationldappolicy.
    .PARAMETER Name
        Name of the LDAP policy.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy_systemglobal_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-NSGetAuthenticationldappolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicySystemglobalBinding -GetAll
        Get all authenticationldappolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicySystemglobalBinding -Count
        Get the number of authenticationldappolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicySystemglobalBinding -name <string>
        Get authenticationldappolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_systemglobal_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-NSGetAuthenticationldappolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationldappolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_systemglobal_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 authenticationldappolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_systemglobal_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-NSGetAuthenticationldappolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationldappolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationldappolicy.
    .PARAMETER Name
        Name of the LDAP policy.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy_vpnglobal_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-NSGetAuthenticationldappolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnglobalBinding -GetAll
        Get all authenticationldappolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnglobalBinding -Count
        Get the number of authenticationldappolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnglobalBinding -name <string>
        Get authenticationldappolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnglobal_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-NSGetAuthenticationldappolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationldappolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnglobal_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 authenticationldappolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnglobal_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-NSGetAuthenticationldappolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationldappolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationldappolicy.
    .PARAMETER Name
        Name of the LDAP policy.
    .PARAMETER GetAll
        Retrieve all authenticationldappolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationldappolicy_vpnvserver_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-NSGetAuthenticationldappolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnvserverBinding -GetAll
        Get all authenticationldappolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnvserverBinding -Count
        Get the number of authenticationldappolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnvserverBinding -name <string>
        Get authenticationldappolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationldappolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationldappolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationldappolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnvserver_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-NSGetAuthenticationldappolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationldappolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnvserver_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 authenticationldappolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationldappolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationldappolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationldappolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationldappolicy_vpnvserver_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-NSGetAuthenticationldappolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSDeleteAuthenticationlocalpolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LOCAL policy resource.
    .PARAMETER Name
        Name for the local authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after local policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationlocalpolicy -Name <string>
        An example how to delete authenticationlocalpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationlocalpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy/
        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-NSDeleteAuthenticationlocalpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationlocalpolicy -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-NSDeleteAuthenticationlocalpolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationlocalpolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LOCAL policy resource.
    .PARAMETER Name
        Name for the local authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after local policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to perform the authentication.
    .PARAMETER PassThru
        Return details about the created authenticationlocalpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationlocalpolicy -name <string>
        An example how to update authenticationlocalpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationlocalpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy/
        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]$Rule,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationlocalpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSCmdlet.ShouldProcess("authenticationlocalpolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationlocalpolicy -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-NSGetAuthenticationlocalpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationlocalpolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationlocalpolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for LOCAL policy resource.
    .PARAMETER Name
        Name for the local authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after local policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to perform the authentication.
    .PARAMETER PassThru
        Return details about the created authenticationlocalpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationlocalpolicy -name <string> -rule <string>
        An example how to add authenticationlocalpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationlocalpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy/
        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,

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

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

            if ( $PSCmdlet.ShouldProcess("authenticationlocalpolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationlocalpolicy -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-NSGetAuthenticationlocalpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationlocalpolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationlocalpolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for LOCAL policy resource.
    .PARAMETER Name
        Name for the local authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after local policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy 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-NSGetAuthenticationlocalpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicy -GetAll
        Get all authenticationlocalpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicy -Count
        Get the number of authenticationlocalpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicy -name <string>
        Get authenticationlocalpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicy -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy/
        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]$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-NSGetAuthenticationlocalpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationlocalpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy -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 authenticationlocalpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy -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-NSGetAuthenticationlocalpolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationlocalpolicy.
    .PARAMETER Name
        Name of the local authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy_authenticationvserver_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-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding -GetAll
        Get all authenticationlocalpolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding -Count
        Get the number of authenticationlocalpolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding -name <string>
        Get authenticationlocalpolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_authenticationvserver_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]$Name,

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

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationlocalpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_authenticationvserver_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 authenticationlocalpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_authenticationvserver_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-NSGetAuthenticationlocalpolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationlocalpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationlocalpolicy.
    .PARAMETER Name
        Name of the local authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy_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-NSGetAuthenticationlocalpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyBinding -GetAll
        Get all authenticationlocalpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyBinding -name <string>
        Get authenticationlocalpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_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]$Name,
            
        [hashtable]$Filter = @{ },

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationlocalpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationlocalpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_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 authenticationlocalpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_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-NSGetAuthenticationlocalpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationlocalpolicy.
    .PARAMETER Name
        Name of the local authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy_systemglobal_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-NSGetAuthenticationlocalpolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding -GetAll
        Get all authenticationlocalpolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding -Count
        Get the number of authenticationlocalpolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding -name <string>
        Get authenticationlocalpolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_systemglobal_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]$Name,

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

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationlocalpolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationlocalpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_systemglobal_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 authenticationlocalpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_systemglobal_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-NSGetAuthenticationlocalpolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationlocalpolicy.
    .PARAMETER Name
        Name of the local authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy_vpnglobal_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-NSGetAuthenticationlocalpolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding -GetAll
        Get all authenticationlocalpolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding -Count
        Get the number of authenticationlocalpolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding -name <string>
        Get authenticationlocalpolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnglobal_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]$Name,

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

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationlocalpolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationlocalpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnglobal_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 authenticationlocalpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnglobal_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-NSGetAuthenticationlocalpolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationlocalpolicy.
    .PARAMETER Name
        Name of the local authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationlocalpolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationlocalpolicy_vpnvserver_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-NSGetAuthenticationlocalpolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding -GetAll
        Get all authenticationlocalpolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding -Count
        Get the number of authenticationlocalpolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding -name <string>
        Get authenticationlocalpolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationlocalpolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnvserver_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]$Name,

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

        [Parameter(ParameterSetName = 'GetAll')]
        [Switch]$GetAll
    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationlocalpolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationlocalpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnvserver_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 authenticationlocalpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationlocalpolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationlocalpolicy_vpnvserver_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-NSGetAuthenticationlocalpolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationloginschema {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the new login schema. Login schema defines the way login form is rendered. It provides a way to customize the fields that are shown to the user. 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 an action is created.
    .PARAMETER Authenticationschema
        Name of the file for reading authentication schema to be sent for Login Page UI. This file should contain xml definition of elements as per Citrix Forms Authentication Protocol to be able to render login form. If administrator does not want to prompt users for additional credentials but continue with previously obtained credentials, then "noschema" can be given as argument. Please note that this applies only to loginSchemas that are used with user-defined factors, and not the vserver factor.
    .PARAMETER Userexpression
        Expression for username extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Passwdexpression
        Expression for password extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Usercredentialindex
        The index at which user entered username should be stored in session.
         
        Maximum value = 16
    .PARAMETER Passwordcredentialindex
        The index at which user entered password should be stored in session.
         
        Maximum value = 16
    .PARAMETER Authenticationstrength
        Weight of the current authentication.
         
        Maximum value = 65535
    .PARAMETER Ssocredentials
        This option indicates whether current factor credentials are the default SSO (SingleSignOn) credentials.
         
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created authenticationloginschema item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationloginschema -name <string> -authenticationschema <string>
        An example how to add authenticationloginschema config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationloginschema
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Authenticationschema,

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

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

        [double]$Usercredentialindex,

        [double]$Passwordcredentialindex,

        [double]$Authenticationstrength,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationloginschema: Starting"
    }
    process {
        try {
            $payload = @{ name       = $name
                authenticationschema = $authenticationschema
            }
            if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) }
            if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) }
            if ( $PSBoundParameters.ContainsKey('usercredentialindex') ) { $payload.Add('usercredentialindex', $usercredentialindex) }
            if ( $PSBoundParameters.ContainsKey('passwordcredentialindex') ) { $payload.Add('passwordcredentialindex', $passwordcredentialindex) }
            if ( $PSBoundParameters.ContainsKey('authenticationstrength') ) { $payload.Add('authenticationstrength', $authenticationstrength) }
            if ( $PSBoundParameters.ContainsKey('ssocredentials') ) { $payload.Add('ssocredentials', $ssocredentials) }
            if ( $PSCmdlet.ShouldProcess("authenticationloginschema", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationloginschema -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-NSGetAuthenticationloginschema -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationloginschema: Finished"
    }
}

function Invoke-NSDeleteAuthenticationloginschema {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the new login schema. Login schema defines the way login form is rendered. It provides a way to customize the fields that are shown to the user. 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationloginschema -Name <string>
        An example how to delete authenticationloginschema config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationloginschema
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema/
        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-NSDeleteAuthenticationloginschema: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationloginschema -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-NSDeleteAuthenticationloginschema: Finished"
    }
}

function Invoke-NSUpdateAuthenticationloginschema {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the new login schema. Login schema defines the way login form is rendered. It provides a way to customize the fields that are shown to the user. 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 an action is created.
    .PARAMETER Authenticationschema
        Name of the file for reading authentication schema to be sent for Login Page UI. This file should contain xml definition of elements as per Citrix Forms Authentication Protocol to be able to render login form. If administrator does not want to prompt users for additional credentials but continue with previously obtained credentials, then "noschema" can be given as argument. Please note that this applies only to loginSchemas that are used with user-defined factors, and not the vserver factor.
    .PARAMETER Userexpression
        Expression for username extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Passwdexpression
        Expression for password extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Usercredentialindex
        The index at which user entered username should be stored in session.
         
        Maximum value = 16
    .PARAMETER Passwordcredentialindex
        The index at which user entered password should be stored in session.
         
        Maximum value = 16
    .PARAMETER Authenticationstrength
        Weight of the current authentication.
         
        Maximum value = 65535
    .PARAMETER Ssocredentials
        This option indicates whether current factor credentials are the default SSO (SingleSignOn) credentials.
         
        Possible values = YES, NO
    .PARAMETER PassThru
        Return details about the created authenticationloginschema item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationloginschema -name <string>
        An example how to update authenticationloginschema config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationloginschema
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema/
        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,

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

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

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

        [double]$Usercredentialindex,

        [double]$Passwordcredentialindex,

        [double]$Authenticationstrength,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationloginschema: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationschema') ) { $payload.Add('authenticationschema', $authenticationschema) }
            if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) }
            if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) }
            if ( $PSBoundParameters.ContainsKey('usercredentialindex') ) { $payload.Add('usercredentialindex', $usercredentialindex) }
            if ( $PSBoundParameters.ContainsKey('passwordcredentialindex') ) { $payload.Add('passwordcredentialindex', $passwordcredentialindex) }
            if ( $PSBoundParameters.ContainsKey('authenticationstrength') ) { $payload.Add('authenticationstrength', $authenticationstrength) }
            if ( $PSBoundParameters.ContainsKey('ssocredentials') ) { $payload.Add('ssocredentials', $ssocredentials) }
            if ( $PSCmdlet.ShouldProcess("authenticationloginschema", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationloginschema -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-NSGetAuthenticationloginschema -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationloginschema: Finished"
    }
}

function Invoke-NSUnsetAuthenticationloginschema {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the new login schema. Login schema defines the way login form is rendered. It provides a way to customize the fields that are shown to the user. 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 an action is created.
    .PARAMETER Userexpression
        Expression for username extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Passwdexpression
        Expression for password extraction during login. This can be any relevant advanced policy expression.
    .PARAMETER Usercredentialindex
        The index at which user entered username should be stored in session.
         
        Maximum value = 16
    .PARAMETER Passwordcredentialindex
        The index at which user entered password should be stored in session.
         
        Maximum value = 16
    .PARAMETER Authenticationstrength
        Weight of the current authentication.
         
        Maximum value = 65535
    .PARAMETER Ssocredentials
        This option indicates whether current factor credentials are the default SSO (SingleSignOn) credentials.
         
        Possible values = YES, NO
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationloginschema -name <string>
        An example how to unset authenticationloginschema config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationloginschema
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema
        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]$userexpression,

        [Boolean]$passwdexpression,

        [Boolean]$usercredentialindex,

        [Boolean]$passwordcredentialindex,

        [Boolean]$authenticationstrength,

        [Boolean]$ssocredentials 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationloginschema: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) }
            if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) }
            if ( $PSBoundParameters.ContainsKey('usercredentialindex') ) { $payload.Add('usercredentialindex', $usercredentialindex) }
            if ( $PSBoundParameters.ContainsKey('passwordcredentialindex') ) { $payload.Add('passwordcredentialindex', $passwordcredentialindex) }
            if ( $PSBoundParameters.ContainsKey('authenticationstrength') ) { $payload.Add('authenticationstrength', $authenticationstrength) }
            if ( $PSBoundParameters.ContainsKey('ssocredentials') ) { $payload.Add('ssocredentials', $ssocredentials) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationloginschema -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-NSUnsetAuthenticationloginschema: Finished"
    }
}

function Invoke-NSGetAuthenticationloginschema {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the new login schema. Login schema defines the way login form is rendered. It provides a way to customize the fields that are shown to the user. 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationloginschema object(s).
    .PARAMETER Count
        If specified, the count of the authenticationloginschema 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-NSGetAuthenticationloginschema
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschema -GetAll
        Get all authenticationloginschema data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschema -Count
        Get the number of authenticationloginschema objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschema -name <string>
        Get authenticationloginschema object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschema -Filter @{ 'name'='<value>' }
        Get authenticationloginschema data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationloginschema
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema/
        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-NSGetAuthenticationloginschema: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationloginschema objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschema -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 authenticationloginschema objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschema -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationloginschema objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschema -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationloginschema configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschema -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationloginschema configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschema -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-NSGetAuthenticationloginschema: Ended"
    }
}

function Invoke-NSAddAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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 which is evaluated to choose a profile for authentication.
         
        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 profile to apply to requests or connections that match this policy.
        * NOOP - Do not take any specific action when this policy evaluates to true. This is useful to implicitly go to a different policy set.
        * RESET - Reset the client connection by closing it. The client program, such as a browser, will handle this and may inform the user. The client may then resend the request if desired.
        * DROP - Drop the request without sending a response to the user.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationloginschemapolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationloginschemapolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationloginschemapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Rule,

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationloginschemapolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationloginschemapolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationloginschemapolicy -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-NSGetAuthenticationloginschemapolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationloginschemapolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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-NSDeleteAuthenticationloginschemapolicy -Name <string>
        An example how to delete authenticationloginschemapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy/
        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-NSDeleteAuthenticationloginschemapolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationloginschemapolicy -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-NSDeleteAuthenticationloginschemapolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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 which is evaluated to choose a profile for authentication.
         
        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 profile to apply to requests or connections that match this policy.
        * NOOP - Do not take any specific action when this policy evaluates to true. This is useful to implicitly go to a different policy set.
        * RESET - Reset the client connection by closing it. The client program, such as a browser, will handle this and may inform the user. The client may then resend the request if desired.
        * DROP - Drop the request without sending a response to the user.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationloginschemapolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationloginschemapolicy -name <string>
        An example how to update authenticationloginschemapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy/
        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,

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

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationloginschemapolicy: 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 ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationloginschemapolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationloginschemapolicy -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-NSGetAuthenticationloginschemapolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationloginschemapolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationloginschemapolicy -name <string>
        An example how to unset authenticationloginschemapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy
        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,

        [Boolean]$logaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationloginschemapolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationloginschemapolicy -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-NSUnsetAuthenticationloginschemapolicy: Finished"
    }
}

function Invoke-NSRenameAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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 Newname
        New name for the LoginSchema policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER PassThru
        Return details about the created authenticationloginschemapolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationloginschemapolicy -name <string> -newname <string>
        An example how to rename authenticationloginschemapolicy config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Newname,

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

            if ( $PSCmdlet.ShouldProcess("authenticationloginschemapolicy", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationloginschemapolicy -Action rename -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-NSGetAuthenticationloginschemapolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationloginschemapolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationloginschemapolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for 0 resource.
    .PARAMETER Name
        Name for the LoginSchema policy. This is used for selecting parameters for user logon. 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 authenticationloginschemapolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationloginschemapolicy 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-NSGetAuthenticationloginschemapolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicy -GetAll
        Get all authenticationloginschemapolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicy -Count
        Get the number of authenticationloginschemapolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicy -name <string>
        Get authenticationloginschemapolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicy -Filter @{ 'name'='<value>' }
        Get authenticationloginschemapolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationloginschemapolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy/
        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-NSGetAuthenticationloginschemapolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationloginschemapolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy -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 authenticationloginschemapolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationloginschemapolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy -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-NSGetAuthenticationloginschemapolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationloginschemapolicy.
    .PARAMETER Name
        Name of the LoginSchema policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationloginschemapolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationloginschemapolicy_authenticationvserver_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-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding -GetAll
        Get all authenticationloginschemapolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding -Count
        Get the number of authenticationloginschemapolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding -name <string>
        Get authenticationloginschemapolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationloginschemapolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_authenticationvserver_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-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationloginschemapolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_authenticationvserver_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 authenticationloginschemapolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationloginschemapolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_authenticationvserver_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-NSGetAuthenticationloginschemapolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationloginschemapolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationloginschemapolicy.
    .PARAMETER Name
        Name of the LoginSchema policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationloginschemapolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationloginschemapolicy_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-NSGetAuthenticationloginschemapolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyBinding -GetAll
        Get all authenticationloginschemapolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyBinding -name <string>
        Get authenticationloginschemapolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationloginschemapolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationloginschemapolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_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-NSGetAuthenticationloginschemapolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationloginschemapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_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 authenticationloginschemapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationloginschemapolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_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-NSGetAuthenticationloginschemapolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationloginschemapolicy.
    .PARAMETER Name
        Name of the LoginSchema policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationloginschemapolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationloginschemapolicy_vpnvserver_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-NSGetAuthenticationloginschemapolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding -GetAll
        Get all authenticationloginschemapolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding -Count
        Get the number of authenticationloginschemapolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding -name <string>
        Get authenticationloginschemapolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationloginschemapolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationloginschemapolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_vpnvserver_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-NSGetAuthenticationloginschemapolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationloginschemapolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_vpnvserver_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 authenticationloginschemapolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationloginschemapolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationloginschemapolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationloginschemapolicy_vpnvserver_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-NSGetAuthenticationloginschemapolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSUnsetAuthenticationnegotiateaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate action resource.
    .PARAMETER Name
        Name for the AD KDC server profile (negotiate action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KDC server profile is created.
    .PARAMETER Domain
        Domain name of the service principal that represnts Citrix ADC.
    .PARAMETER Domainuser
        User name of the account that is mapped with Citrix ADC principal. This can be given along with domain and password when keytab file is not available. If username is given along with keytab file, then that keytab file will be searched for this user's credentials.
    .PARAMETER Domainuserpasswd
        Password of the account that is mapped to the Citrix ADC principal.
    .PARAMETER Ou
        Active Directory organizational units (OU) attribute.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Ntlmpath
        The path to the site that is enabled for NTLM authentication, including FQDN of the server. This is used when clients fallback to NTLM.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationnegotiateaction -name <string>
        An example how to unset authenticationnegotiateaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationnegotiateaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction
        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]$Name,

        [Boolean]$domain,

        [Boolean]$domainuser,

        [Boolean]$domainuserpasswd,

        [Boolean]$ou,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$ntlmpath 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationnegotiateaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('domainuser') ) { $payload.Add('domainuser', $domainuser) }
            if ( $PSBoundParameters.ContainsKey('domainuserpasswd') ) { $payload.Add('domainuserpasswd', $domainuserpasswd) }
            if ( $PSBoundParameters.ContainsKey('ou') ) { $payload.Add('ou', $ou) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('ntlmpath') ) { $payload.Add('ntlmpath', $ntlmpath) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationnegotiateaction -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-NSUnsetAuthenticationnegotiateaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationnegotiateaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate action resource.
    .PARAMETER Name
        Name for the AD KDC server profile (negotiate action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KDC server profile is created.
    .PARAMETER Domain
        Domain name of the service principal that represnts Citrix ADC.
    .PARAMETER Domainuser
        User name of the account that is mapped with Citrix ADC principal. This can be given along with domain and password when keytab file is not available. If username is given along with keytab file, then that keytab file will be searched for this user's credentials.
    .PARAMETER Domainuserpasswd
        Password of the account that is mapped to the Citrix ADC principal.
    .PARAMETER Ou
        Active Directory organizational units (OU) attribute.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Keytab
        The path to the keytab file that is used to decrypt kerberos tickets presented to Citrix ADC. If keytab is not available, domain/username/password can be specified in the negotiate action configuration.
    .PARAMETER Ntlmpath
        The path to the site that is enabled for NTLM authentication, including FQDN of the server. This is used when clients fallback to NTLM.
    .PARAMETER PassThru
        Return details about the created authenticationnegotiateaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationnegotiateaction -name <string>
        An example how to update authenticationnegotiateaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationnegotiateaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction/
        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]$Name,

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

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

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

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

        [string]$Defaultauthenticationgroup,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationnegotiateaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('domainuser') ) { $payload.Add('domainuser', $domainuser) }
            if ( $PSBoundParameters.ContainsKey('domainuserpasswd') ) { $payload.Add('domainuserpasswd', $domainuserpasswd) }
            if ( $PSBoundParameters.ContainsKey('ou') ) { $payload.Add('ou', $ou) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('keytab') ) { $payload.Add('keytab', $keytab) }
            if ( $PSBoundParameters.ContainsKey('ntlmpath') ) { $payload.Add('ntlmpath', $ntlmpath) }
            if ( $PSCmdlet.ShouldProcess("authenticationnegotiateaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationnegotiateaction -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-NSGetAuthenticationnegotiateaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationnegotiateaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationnegotiateaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate action resource.
    .PARAMETER Name
        Name for the AD KDC server profile (negotiate action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KDC server profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationnegotiateaction -Name <string>
        An example how to delete authenticationnegotiateaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationnegotiateaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction/
        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-NSDeleteAuthenticationnegotiateaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationnegotiateaction -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-NSDeleteAuthenticationnegotiateaction: Finished"
    }
}

function Invoke-NSAddAuthenticationnegotiateaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate action resource.
    .PARAMETER Name
        Name for the AD KDC server profile (negotiate action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KDC server profile is created.
    .PARAMETER Domain
        Domain name of the service principal that represnts Citrix ADC.
    .PARAMETER Domainuser
        User name of the account that is mapped with Citrix ADC principal. This can be given along with domain and password when keytab file is not available. If username is given along with keytab file, then that keytab file will be searched for this user's credentials.
    .PARAMETER Domainuserpasswd
        Password of the account that is mapped to the Citrix ADC principal.
    .PARAMETER Ou
        Active Directory organizational units (OU) attribute.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Keytab
        The path to the keytab file that is used to decrypt kerberos tickets presented to Citrix ADC. If keytab is not available, domain/username/password can be specified in the negotiate action configuration.
    .PARAMETER Ntlmpath
        The path to the site that is enabled for NTLM authentication, including FQDN of the server. This is used when clients fallback to NTLM.
    .PARAMETER PassThru
        Return details about the created authenticationnegotiateaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationnegotiateaction -name <string>
        An example how to add authenticationnegotiateaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationnegotiateaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction/
        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]$Name,

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

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

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

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

        [string]$Defaultauthenticationgroup,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationnegotiateaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('domainuser') ) { $payload.Add('domainuser', $domainuser) }
            if ( $PSBoundParameters.ContainsKey('domainuserpasswd') ) { $payload.Add('domainuserpasswd', $domainuserpasswd) }
            if ( $PSBoundParameters.ContainsKey('ou') ) { $payload.Add('ou', $ou) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('keytab') ) { $payload.Add('keytab', $keytab) }
            if ( $PSBoundParameters.ContainsKey('ntlmpath') ) { $payload.Add('ntlmpath', $ntlmpath) }
            if ( $PSCmdlet.ShouldProcess("authenticationnegotiateaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationnegotiateaction -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-NSGetAuthenticationnegotiateaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationnegotiateaction: Finished"
    }
}

function Invoke-NSGetAuthenticationnegotiateaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Negotiate action resource.
    .PARAMETER Name
        Name for the AD KDC server profile (negotiate action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KDC server profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiateaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiateaction 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-NSGetAuthenticationnegotiateaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiateaction -GetAll
        Get all authenticationnegotiateaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiateaction -Count
        Get the number of authenticationnegotiateaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiateaction -name <string>
        Get authenticationnegotiateaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiateaction -Filter @{ 'name'='<value>' }
        Get authenticationnegotiateaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiateaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationnegotiateaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationnegotiateaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiateaction -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 authenticationnegotiateaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiateaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiateaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiateaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiateaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiateaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiateaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiateaction -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-NSGetAuthenticationnegotiateaction: Ended"
    }
}

function Invoke-NSUpdateAuthenticationnegotiatepolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate Policy resource.
    .PARAMETER Name
        Name for the negotiate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KCD (negotiate) policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the AD KCD server.
    .PARAMETER Reqaction
        Name of the negotiate action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationnegotiatepolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationnegotiatepolicy -name <string>
        An example how to update authenticationnegotiatepolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationnegotiatepolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationnegotiatepolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationnegotiatepolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationnegotiatepolicy -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-NSGetAuthenticationnegotiatepolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationnegotiatepolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationnegotiatepolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate Policy resource.
    .PARAMETER Name
        Name for the negotiate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KCD (negotiate) policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the AD KCD server.
    .PARAMETER Reqaction
        Name of the negotiate action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationnegotiatepolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationnegotiatepolicy -name <string> -rule <string> -reqaction <string>
        An example how to add authenticationnegotiatepolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationnegotiatepolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationnegotiatepolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                reqaction      = $reqaction
            }

            if ( $PSCmdlet.ShouldProcess("authenticationnegotiatepolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationnegotiatepolicy -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-NSGetAuthenticationnegotiatepolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationnegotiatepolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationnegotiatepolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Negotiate Policy resource.
    .PARAMETER Name
        Name for the negotiate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KCD (negotiate) policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationnegotiatepolicy -Name <string>
        An example how to delete authenticationnegotiatepolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationnegotiatepolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy/
        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-NSDeleteAuthenticationnegotiatepolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationnegotiatepolicy -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-NSDeleteAuthenticationnegotiatepolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationnegotiatepolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Negotiate Policy resource.
    .PARAMETER Name
        Name for the negotiate authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AD KCD (negotiate) policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiatepolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiatepolicy 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-NSGetAuthenticationnegotiatepolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicy -GetAll
        Get all authenticationnegotiatepolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicy -Count
        Get the number of authenticationnegotiatepolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicy -name <string>
        Get authenticationnegotiatepolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicy -Filter @{ 'name'='<value>' }
        Get authenticationnegotiatepolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiatepolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationnegotiatepolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationnegotiatepolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy -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 authenticationnegotiatepolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiatepolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy -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-NSGetAuthenticationnegotiatepolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationnegotiatepolicy.
    .PARAMETER Name
        Name of the negotiate policy.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiatepolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiatepolicy_authenticationvserver_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-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding -GetAll
        Get all authenticationnegotiatepolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding -Count
        Get the number of authenticationnegotiatepolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding -name <string>
        Get authenticationnegotiatepolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationnegotiatepolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_authenticationvserver_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-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationnegotiatepolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_authenticationvserver_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 authenticationnegotiatepolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_authenticationvserver_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-NSGetAuthenticationnegotiatepolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationnegotiatepolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationnegotiatepolicy.
    .PARAMETER Name
        Name of the negotiate policy.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiatepolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiatepolicy_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-NSGetAuthenticationnegotiatepolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyBinding -GetAll
        Get all authenticationnegotiatepolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyBinding -name <string>
        Get authenticationnegotiatepolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationnegotiatepolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiatepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_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-NSGetAuthenticationnegotiatepolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationnegotiatepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_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 authenticationnegotiatepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_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-NSGetAuthenticationnegotiatepolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationnegotiatepolicy.
    .PARAMETER Name
        Name of the negotiate policy.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiatepolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiatepolicy_vpnglobal_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-NSGetAuthenticationnegotiatepolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding -GetAll
        Get all authenticationnegotiatepolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding -Count
        Get the number of authenticationnegotiatepolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding -name <string>
        Get authenticationnegotiatepolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationnegotiatepolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiatepolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnglobal_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-NSGetAuthenticationnegotiatepolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationnegotiatepolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnglobal_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 authenticationnegotiatepolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnglobal_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-NSGetAuthenticationnegotiatepolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationnegotiatepolicy.
    .PARAMETER Name
        Name of the negotiate policy.
    .PARAMETER GetAll
        Retrieve all authenticationnegotiatepolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnegotiatepolicy_vpnvserver_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-NSGetAuthenticationnegotiatepolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding -GetAll
        Get all authenticationnegotiatepolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding -Count
        Get the number of authenticationnegotiatepolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding -name <string>
        Get authenticationnegotiatepolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationnegotiatepolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnegotiatepolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnvserver_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-NSGetAuthenticationnegotiatepolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationnegotiatepolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnvserver_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 authenticationnegotiatepolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnegotiatepolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnegotiatepolicy_vpnvserver_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-NSGetAuthenticationnegotiatepolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationnoauthaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for no authentication action resource.
    .PARAMETER Name
        Name for the new no-authentication 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 an action is created.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .PARAMETER PassThru
        Return details about the created authenticationnoauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationnoauthaction -name <string>
        An example how to add authenticationnoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationnoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction/
        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]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationnoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationnoauthaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationnoauthaction -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-NSGetAuthenticationnoauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationnoauthaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationnoauthaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for no authentication action resource.
    .PARAMETER Name
        Name for the new no-authentication 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationnoauthaction -Name <string>
        An example how to delete authenticationnoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationnoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction/
        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-NSDeleteAuthenticationnoauthaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationnoauthaction -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-NSDeleteAuthenticationnoauthaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationnoauthaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for no authentication action resource.
    .PARAMETER Name
        Name for the new no-authentication 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 an action is created.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .PARAMETER PassThru
        Return details about the created authenticationnoauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationnoauthaction -name <string>
        An example how to update authenticationnoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationnoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction/
        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]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationnoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationnoauthaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationnoauthaction -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-NSGetAuthenticationnoauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationnoauthaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationnoauthaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for no authentication action resource.
    .PARAMETER Name
        Name for the new no-authentication 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 an action is created.
    .PARAMETER Defaultauthenticationgroup
        This is the group that is added to user sessions that match current policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationnoauthaction -name <string>
        An example how to unset authenticationnoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationnoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction
        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]$defaultauthenticationgroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationnoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationnoauthaction -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-NSUnsetAuthenticationnoauthaction: Finished"
    }
}

function Invoke-NSGetAuthenticationnoauthaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for no authentication action resource.
    .PARAMETER Name
        Name for the new no-authentication 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationnoauthaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationnoauthaction 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-NSGetAuthenticationnoauthaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnoauthaction -GetAll
        Get all authenticationnoauthaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnoauthaction -Count
        Get the number of authenticationnoauthaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnoauthaction -name <string>
        Get authenticationnoauthaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationnoauthaction -Filter @{ 'name'='<value>' }
        Get authenticationnoauthaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationnoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction/
        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-NSGetAuthenticationnoauthaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationnoauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnoauthaction -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 authenticationnoauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnoauthaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationnoauthaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnoauthaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationnoauthaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnoauthaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationnoauthaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationnoauthaction -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-NSGetAuthenticationnoauthaction: Ended"
    }
}

function Invoke-NSAddAuthenticationoauthaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth authentication action resource.
    .PARAMETER Name
        Name for the OAuth Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Oauthtype
        Type of the OAuth implementation. Default value is generic implementation that is applicable for most deployments.
         
        Possible values = GENERIC, INTUNE, ATHENA
    .PARAMETER Authorizationendpoint
        Authorization endpoint/url to which unauthenticated user will be redirected. Citrix ADC redirects user to this endpoint by adding query parameters including clientid. If this parameter not specified then as default value we take Token Endpoint/URL value. Please note that Authorization Endpoint or Token Endpoint is mandatory for oauthAction.
    .PARAMETER Tokenendpoint
        URL to which OAuth token will be posted to verify its authenticity. User obtains this token from Authorization server upon successful authentication. Citrix ADC will validate presented token by posting it to the URL configured.
    .PARAMETER Idtokendecryptendpoint
        URL to which obtained idtoken will be posted to get a decrypted user identity. Encrypted idtoken will be obtained by posting OAuth token to token endpoint. In order to decrypt idtoken, Citrix ADC posts request to the URL configured.
    .PARAMETER Clientid
        Unique identity of the client/user who is getting authenticated. Authorization server infers client configuration using this ID.
    .PARAMETER Clientsecret
        Secret string established by user and authorization server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute1.
    .PARAMETER Attribute2
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute2.
    .PARAMETER Attribute3
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute3.
    .PARAMETER Attribute4
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute4.
    .PARAMETER Attribute5
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute5.
    .PARAMETER Attribute6
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute6.
    .PARAMETER Attribute7
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute7.
    .PARAMETER Attribute8
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute8.
    .PARAMETER Attribute9
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute9.
    .PARAMETER Attribute10
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute10.
    .PARAMETER Attribute11
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute11.
    .PARAMETER Attribute12
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute12.
    .PARAMETER Attribute13
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute13.
    .PARAMETER Attribute14
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute14.
    .PARAMETER Attribute15
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute15.
    .PARAMETER Attribute16
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute16.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 1023 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Tenantid
        TenantID of the application. This is usually specific to providers such as Microsoft and usually refers to the deployment identifier.
    .PARAMETER Graphendpoint
        URL of the Graph API service to learn Enterprise Mobility Services (EMS) endpoints.
    .PARAMETER Refreshinterval
        Interval at which services are monitored for necessary configuration.
    .PARAMETER Certendpoint
        URL of the endpoint that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Audience
        Audience for which token sent by Authorization server is applicable. This is typically entity name or url that represents the recipient.
    .PARAMETER Usernamefield
        Attribute in the token from which username should be extracted.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC allows on an incoming token. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Issuer
        Identity of the server whose tokens are to be accepted.
    .PARAMETER Userinfourl
        URL to which OAuth access token will be posted to obtain user information.
    .PARAMETER Certfilepath
        Path to the file that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Granttype
        Grant type support. value can be code or password.
         
        Possible values = CODE, PASSWORD
    .PARAMETER Authentication
        If authentication is disabled, password is not sent in the request. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Introspecturl
        URL to which access token would be posted for validation.
    .PARAMETER Allowedalgorithms
        Multivalued option to specify allowed token verification algorithms. .
         
        Possible values = HS256, RS256, RS512
    .PARAMETER Pkce
        Option to enable/disable PKCE flow during authentication. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Tokenendpointauthmethod
        Option to select the variant of token authentication method. This method is used while exchanging code with IdP. .
         
        Possible values = client_secret_post, client_secret_jwt, private_key_jwt, client_secret_basic
    .PARAMETER Metadataurl
        Well-known configuration endpoint of the Authorization Server. Citrix ADC fetches server details from this endpoint. .
    .PARAMETER Resourceuri
        Resource URL for Oauth configuration.
    .PARAMETER PassThru
        Return details about the created authenticationoauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationoauthaction -name <string>
        An example how to add authenticationoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction/
        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]$Name,

        [ValidateSet('GENERIC', 'INTUNE', 'ATHENA')]
        [string]$Oauthtype = 'GENERIC',

        [string]$Authorizationendpoint,

        [string]$Tokenendpoint,

        [string]$Idtokendecryptendpoint,

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

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

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [string]$Tenantid,

        [string]$Graphendpoint,

        [double]$Refreshinterval = '1440',

        [string]$Certendpoint,

        [string]$Audience,

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

        [double]$Skewtime = '5',

        [string]$Issuer,

        [string]$Userinfourl,

        [string]$Certfilepath,

        [ValidateSet('CODE', 'PASSWORD')]
        [string]$Granttype = 'CODE',

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

        [string]$Introspecturl,

        [ValidateSet('HS256', 'RS256', 'RS512')]
        [string[]]$Allowedalgorithms = 'OAUTH_ALG_ALL',

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

        [ValidateSet('client_secret_post', 'client_secret_jwt', 'private_key_jwt', 'client_secret_basic')]
        [string]$Tokenendpointauthmethod = 'client_secret_post',

        [string]$Metadataurl,

        [string]$Resourceuri,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('oauthtype') ) { $payload.Add('oauthtype', $oauthtype) }
            if ( $PSBoundParameters.ContainsKey('authorizationendpoint') ) { $payload.Add('authorizationendpoint', $authorizationendpoint) }
            if ( $PSBoundParameters.ContainsKey('tokenendpoint') ) { $payload.Add('tokenendpoint', $tokenendpoint) }
            if ( $PSBoundParameters.ContainsKey('idtokendecryptendpoint') ) { $payload.Add('idtokendecryptendpoint', $idtokendecryptendpoint) }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('tenantid') ) { $payload.Add('tenantid', $tenantid) }
            if ( $PSBoundParameters.ContainsKey('graphendpoint') ) { $payload.Add('graphendpoint', $graphendpoint) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('certendpoint') ) { $payload.Add('certendpoint', $certendpoint) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('userinfourl') ) { $payload.Add('userinfourl', $userinfourl) }
            if ( $PSBoundParameters.ContainsKey('certfilepath') ) { $payload.Add('certfilepath', $certfilepath) }
            if ( $PSBoundParameters.ContainsKey('granttype') ) { $payload.Add('granttype', $granttype) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('introspecturl') ) { $payload.Add('introspecturl', $introspecturl) }
            if ( $PSBoundParameters.ContainsKey('allowedalgorithms') ) { $payload.Add('allowedalgorithms', $allowedalgorithms) }
            if ( $PSBoundParameters.ContainsKey('pkce') ) { $payload.Add('pkce', $pkce) }
            if ( $PSBoundParameters.ContainsKey('tokenendpointauthmethod') ) { $payload.Add('tokenendpointauthmethod', $tokenendpointauthmethod) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('resourceuri') ) { $payload.Add('resourceuri', $resourceuri) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationoauthaction -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-NSGetAuthenticationoauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationoauthaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationoauthaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth authentication action resource.
    .PARAMETER Name
        Name for the OAuth Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationoauthaction -Name <string>
        An example how to delete authenticationoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction/
        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-NSDeleteAuthenticationoauthaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationoauthaction -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-NSDeleteAuthenticationoauthaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationoauthaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth authentication action resource.
    .PARAMETER Name
        Name for the OAuth Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Oauthtype
        Type of the OAuth implementation. Default value is generic implementation that is applicable for most deployments.
         
        Possible values = GENERIC, INTUNE, ATHENA
    .PARAMETER Authorizationendpoint
        Authorization endpoint/url to which unauthenticated user will be redirected. Citrix ADC redirects user to this endpoint by adding query parameters including clientid. If this parameter not specified then as default value we take Token Endpoint/URL value. Please note that Authorization Endpoint or Token Endpoint is mandatory for oauthAction.
    .PARAMETER Tokenendpoint
        URL to which OAuth token will be posted to verify its authenticity. User obtains this token from Authorization server upon successful authentication. Citrix ADC will validate presented token by posting it to the URL configured.
    .PARAMETER Idtokendecryptendpoint
        URL to which obtained idtoken will be posted to get a decrypted user identity. Encrypted idtoken will be obtained by posting OAuth token to token endpoint. In order to decrypt idtoken, Citrix ADC posts request to the URL configured.
    .PARAMETER Clientid
        Unique identity of the client/user who is getting authenticated. Authorization server infers client configuration using this ID.
    .PARAMETER Clientsecret
        Secret string established by user and authorization server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute1.
    .PARAMETER Attribute2
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute2.
    .PARAMETER Attribute3
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute3.
    .PARAMETER Attribute4
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute4.
    .PARAMETER Attribute5
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute5.
    .PARAMETER Attribute6
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute6.
    .PARAMETER Attribute7
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute7.
    .PARAMETER Attribute8
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute8.
    .PARAMETER Attribute9
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute9.
    .PARAMETER Attribute10
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute10.
    .PARAMETER Attribute11
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute11.
    .PARAMETER Attribute12
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute12.
    .PARAMETER Attribute13
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute13.
    .PARAMETER Attribute14
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute14.
    .PARAMETER Attribute15
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute15.
    .PARAMETER Attribute16
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute16.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 1023 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Tenantid
        TenantID of the application. This is usually specific to providers such as Microsoft and usually refers to the deployment identifier.
    .PARAMETER Graphendpoint
        URL of the Graph API service to learn Enterprise Mobility Services (EMS) endpoints.
    .PARAMETER Refreshinterval
        Interval at which services are monitored for necessary configuration.
    .PARAMETER Certendpoint
        URL of the endpoint that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Audience
        Audience for which token sent by Authorization server is applicable. This is typically entity name or url that represents the recipient.
    .PARAMETER Usernamefield
        Attribute in the token from which username should be extracted.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC allows on an incoming token. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Issuer
        Identity of the server whose tokens are to be accepted.
    .PARAMETER Userinfourl
        URL to which OAuth access token will be posted to obtain user information.
    .PARAMETER Certfilepath
        Path to the file that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Granttype
        Grant type support. value can be code or password.
         
        Possible values = CODE, PASSWORD
    .PARAMETER Authentication
        If authentication is disabled, password is not sent in the request. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Introspecturl
        URL to which access token would be posted for validation.
    .PARAMETER Allowedalgorithms
        Multivalued option to specify allowed token verification algorithms. .
         
        Possible values = HS256, RS256, RS512
    .PARAMETER Pkce
        Option to enable/disable PKCE flow during authentication. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Tokenendpointauthmethod
        Option to select the variant of token authentication method. This method is used while exchanging code with IdP. .
         
        Possible values = client_secret_post, client_secret_jwt, private_key_jwt, client_secret_basic
    .PARAMETER Metadataurl
        Well-known configuration endpoint of the Authorization Server. Citrix ADC fetches server details from this endpoint. .
    .PARAMETER Resourceuri
        Resource URL for Oauth configuration.
    .PARAMETER PassThru
        Return details about the created authenticationoauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationoauthaction -name <string>
        An example how to update authenticationoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction/
        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]$Name,

        [ValidateSet('GENERIC', 'INTUNE', 'ATHENA')]
        [string]$Oauthtype,

        [string]$Authorizationendpoint,

        [string]$Tokenendpoint,

        [string]$Idtokendecryptendpoint,

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

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

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [string]$Tenantid,

        [string]$Graphendpoint,

        [double]$Refreshinterval,

        [string]$Certendpoint,

        [string]$Audience,

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

        [double]$Skewtime,

        [string]$Issuer,

        [string]$Userinfourl,

        [string]$Certfilepath,

        [ValidateSet('CODE', 'PASSWORD')]
        [string]$Granttype,

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

        [string]$Introspecturl,

        [ValidateSet('HS256', 'RS256', 'RS512')]
        [string[]]$Allowedalgorithms,

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

        [ValidateSet('client_secret_post', 'client_secret_jwt', 'private_key_jwt', 'client_secret_basic')]
        [string]$Tokenendpointauthmethod,

        [string]$Metadataurl,

        [string]$Resourceuri,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('oauthtype') ) { $payload.Add('oauthtype', $oauthtype) }
            if ( $PSBoundParameters.ContainsKey('authorizationendpoint') ) { $payload.Add('authorizationendpoint', $authorizationendpoint) }
            if ( $PSBoundParameters.ContainsKey('tokenendpoint') ) { $payload.Add('tokenendpoint', $tokenendpoint) }
            if ( $PSBoundParameters.ContainsKey('idtokendecryptendpoint') ) { $payload.Add('idtokendecryptendpoint', $idtokendecryptendpoint) }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('tenantid') ) { $payload.Add('tenantid', $tenantid) }
            if ( $PSBoundParameters.ContainsKey('graphendpoint') ) { $payload.Add('graphendpoint', $graphendpoint) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('certendpoint') ) { $payload.Add('certendpoint', $certendpoint) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('userinfourl') ) { $payload.Add('userinfourl', $userinfourl) }
            if ( $PSBoundParameters.ContainsKey('certfilepath') ) { $payload.Add('certfilepath', $certfilepath) }
            if ( $PSBoundParameters.ContainsKey('granttype') ) { $payload.Add('granttype', $granttype) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('introspecturl') ) { $payload.Add('introspecturl', $introspecturl) }
            if ( $PSBoundParameters.ContainsKey('allowedalgorithms') ) { $payload.Add('allowedalgorithms', $allowedalgorithms) }
            if ( $PSBoundParameters.ContainsKey('pkce') ) { $payload.Add('pkce', $pkce) }
            if ( $PSBoundParameters.ContainsKey('tokenendpointauthmethod') ) { $payload.Add('tokenendpointauthmethod', $tokenendpointauthmethod) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('resourceuri') ) { $payload.Add('resourceuri', $resourceuri) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationoauthaction -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-NSGetAuthenticationoauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationoauthaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth authentication action resource.
    .PARAMETER Name
        Name for the OAuth Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Oauthtype
        Type of the OAuth implementation. Default value is generic implementation that is applicable for most deployments.
         
        Possible values = GENERIC, INTUNE, ATHENA
    .PARAMETER Idtokendecryptendpoint
        URL to which obtained idtoken will be posted to get a decrypted user identity. Encrypted idtoken will be obtained by posting OAuth token to token endpoint. In order to decrypt idtoken, Citrix ADC posts request to the URL configured.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute1.
    .PARAMETER Attribute2
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute2.
    .PARAMETER Attribute3
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute3.
    .PARAMETER Attribute4
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute4.
    .PARAMETER Attribute5
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute5.
    .PARAMETER Attribute6
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute6.
    .PARAMETER Attribute7
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute7.
    .PARAMETER Attribute8
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute8.
    .PARAMETER Attribute9
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute9.
    .PARAMETER Attribute10
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute10.
    .PARAMETER Attribute11
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute11.
    .PARAMETER Attribute12
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute12.
    .PARAMETER Attribute13
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute13.
    .PARAMETER Attribute14
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute14.
    .PARAMETER Attribute15
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute15.
    .PARAMETER Attribute16
        Name of the attribute to be extracted from OAuth Token and to be stored in the attribute16.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 1023 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Graphendpoint
        URL of the Graph API service to learn Enterprise Mobility Services (EMS) endpoints.
    .PARAMETER Refreshinterval
        Interval at which services are monitored for necessary configuration.
    .PARAMETER Certendpoint
        URL of the endpoint that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Audience
        Audience for which token sent by Authorization server is applicable. This is typically entity name or url that represents the recipient.
    .PARAMETER Usernamefield
        Attribute in the token from which username should be extracted.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC allows on an incoming token. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Issuer
        Identity of the server whose tokens are to be accepted.
    .PARAMETER Userinfourl
        URL to which OAuth access token will be posted to obtain user information.
    .PARAMETER Certfilepath
        Path to the file that contains JWKs (Json Web Key) for JWT (Json Web Token) verification.
    .PARAMETER Authentication
        If authentication is disabled, password is not sent in the request. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Introspecturl
        URL to which access token would be posted for validation.
    .PARAMETER Allowedalgorithms
        Multivalued option to specify allowed token verification algorithms. .
         
        Possible values = HS256, RS256, RS512
    .PARAMETER Pkce
        Option to enable/disable PKCE flow during authentication. .
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Tokenendpointauthmethod
        Option to select the variant of token authentication method. This method is used while exchanging code with IdP. .
         
        Possible values = client_secret_post, client_secret_jwt, private_key_jwt, client_secret_basic
    .PARAMETER Metadataurl
        Well-known configuration endpoint of the Authorization Server. Citrix ADC fetches server details from this endpoint. .
    .PARAMETER Resourceuri
        Resource URL for Oauth configuration.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationoauthaction -name <string>
        An example how to unset authenticationoauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction
        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]$Name,

        [Boolean]$oauthtype,

        [Boolean]$idtokendecryptendpoint,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$attribute1,

        [Boolean]$attribute2,

        [Boolean]$attribute3,

        [Boolean]$attribute4,

        [Boolean]$attribute5,

        [Boolean]$attribute6,

        [Boolean]$attribute7,

        [Boolean]$attribute8,

        [Boolean]$attribute9,

        [Boolean]$attribute10,

        [Boolean]$attribute11,

        [Boolean]$attribute12,

        [Boolean]$attribute13,

        [Boolean]$attribute14,

        [Boolean]$attribute15,

        [Boolean]$attribute16,

        [Boolean]$attributes,

        [Boolean]$graphendpoint,

        [Boolean]$refreshinterval,

        [Boolean]$certendpoint,

        [Boolean]$audience,

        [Boolean]$usernamefield,

        [Boolean]$skewtime,

        [Boolean]$issuer,

        [Boolean]$userinfourl,

        [Boolean]$certfilepath,

        [Boolean]$authentication,

        [Boolean]$introspecturl,

        [Boolean]$allowedalgorithms,

        [Boolean]$pkce,

        [Boolean]$tokenendpointauthmethod,

        [Boolean]$metadataurl,

        [Boolean]$resourceuri 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationoauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('oauthtype') ) { $payload.Add('oauthtype', $oauthtype) }
            if ( $PSBoundParameters.ContainsKey('idtokendecryptendpoint') ) { $payload.Add('idtokendecryptendpoint', $idtokendecryptendpoint) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('graphendpoint') ) { $payload.Add('graphendpoint', $graphendpoint) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('certendpoint') ) { $payload.Add('certendpoint', $certendpoint) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('usernamefield') ) { $payload.Add('usernamefield', $usernamefield) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('userinfourl') ) { $payload.Add('userinfourl', $userinfourl) }
            if ( $PSBoundParameters.ContainsKey('certfilepath') ) { $payload.Add('certfilepath', $certfilepath) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('introspecturl') ) { $payload.Add('introspecturl', $introspecturl) }
            if ( $PSBoundParameters.ContainsKey('allowedalgorithms') ) { $payload.Add('allowedalgorithms', $allowedalgorithms) }
            if ( $PSBoundParameters.ContainsKey('pkce') ) { $payload.Add('pkce', $pkce) }
            if ( $PSBoundParameters.ContainsKey('tokenendpointauthmethod') ) { $payload.Add('tokenendpointauthmethod', $tokenendpointauthmethod) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('resourceuri') ) { $payload.Add('resourceuri', $resourceuri) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationoauthaction -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-NSUnsetAuthenticationoauthaction: Finished"
    }
}

function Invoke-NSGetAuthenticationoauthaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for OAuth authentication action resource.
    .PARAMETER Name
        Name for the OAuth Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationoauthaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthaction 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-NSGetAuthenticationoauthaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthaction -GetAll
        Get all authenticationoauthaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthaction -Count
        Get the number of authenticationoauthaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthaction -name <string>
        Get authenticationoauthaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthaction -Filter @{ 'name'='<value>' }
        Get authenticationoauthaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationoauthaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationoauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthaction -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 authenticationoauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthaction -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-NSGetAuthenticationoauthaction: Ended"
    }
}

function Invoke-NSAddAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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 Rule
        Expression that the policy uses to determine whether to respond to the specified request.
    .PARAMETER Action
        Name of the profile to apply to requests or connections that match this policy.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only DROP/RESET actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationoauthidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationoauthidppolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationoauthidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Rule,

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationoauthidppolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthidppolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationoauthidppolicy -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-NSGetAuthenticationoauthidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationoauthidppolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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-NSDeleteAuthenticationoauthidppolicy -Name <string>
        An example how to delete authenticationoauthidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy/
        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-NSDeleteAuthenticationoauthidppolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationoauthidppolicy -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-NSDeleteAuthenticationoauthidppolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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 Rule
        Expression that the policy uses to determine whether to respond to the specified request.
    .PARAMETER Action
        Name of the profile to apply to requests or connections that match this policy.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only DROP/RESET actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationoauthidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationoauthidppolicy -name <string>
        An example how to update authenticationoauthidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy/
        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,

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

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthidppolicy: 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 ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthidppolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationoauthidppolicy -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-NSGetAuthenticationoauthidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthidppolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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 Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only DROP/RESET actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationoauthidppolicy -name <string>
        An example how to unset authenticationoauthidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy
        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,

        [Boolean]$logaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationoauthidppolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationoauthidppolicy -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-NSUnsetAuthenticationoauthidppolicy: Finished"
    }
}

function Invoke-NSRenameAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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 Newname
        New name for the OAuth IdentityProvider policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER PassThru
        Return details about the created authenticationoauthidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationoauthidppolicy -name <string> -newname <string>
        An example how to rename authenticationoauthidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Newname,

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

            if ( $PSCmdlet.ShouldProcess("authenticationoauthidppolicy", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationoauthidppolicy -Action rename -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-NSGetAuthenticationoauthidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationoauthidppolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationoauthidppolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for AAA OAuth IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the OAuth Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as OAuth Identity Provider. 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 authenticationoauthidppolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthidppolicy 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-NSGetAuthenticationoauthidppolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicy -GetAll
        Get all authenticationoauthidppolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicy -Count
        Get the number of authenticationoauthidppolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicy -name <string>
        Get authenticationoauthidppolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicy -Filter @{ 'name'='<value>' }
        Get authenticationoauthidppolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy/
        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-NSGetAuthenticationoauthidppolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationoauthidppolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy -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 authenticationoauthidppolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthidppolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy -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-NSGetAuthenticationoauthidppolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationoauthidppolicy.
    .PARAMETER Name
        Name of the OAuth IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationoauthidppolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthidppolicy_authenticationvserver_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-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding -GetAll
        Get all authenticationoauthidppolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding -Count
        Get the number of authenticationoauthidppolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding -name <string>
        Get authenticationoauthidppolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationoauthidppolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_authenticationvserver_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-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationoauthidppolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_authenticationvserver_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 authenticationoauthidppolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthidppolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_authenticationvserver_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-NSGetAuthenticationoauthidppolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationoauthidppolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationoauthidppolicy.
    .PARAMETER Name
        Name of the OAuth IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationoauthidppolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthidppolicy_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-NSGetAuthenticationoauthidppolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyBinding -GetAll
        Get all authenticationoauthidppolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyBinding -name <string>
        Get authenticationoauthidppolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationoauthidppolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_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-NSGetAuthenticationoauthidppolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationoauthidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_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 authenticationoauthidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthidppolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_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-NSGetAuthenticationoauthidppolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationoauthidppolicy.
    .PARAMETER Name
        Name of the OAuth IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationoauthidppolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthidppolicy_vpnvserver_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-NSGetAuthenticationoauthidppolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding -GetAll
        Get all authenticationoauthidppolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding -Count
        Get the number of authenticationoauthidppolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding -name <string>
        Get authenticationoauthidppolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationoauthidppolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthidppolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_vpnvserver_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-NSGetAuthenticationoauthidppolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationoauthidppolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_vpnvserver_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 authenticationoauthidppolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthidppolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthidppolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidppolicy_vpnvserver_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-NSGetAuthenticationoauthidppolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationoauthidpprofile {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth Identity Provider (IdP) profile resource.
    .PARAMETER Name
        Name for the new OAuth Identity Provider (IdP) single sign-on 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 an action is created.
    .PARAMETER Clientid
        Unique identity of the relying party requesting for authentication.
    .PARAMETER Clientsecret
        Unique secret string to authorize relying party at authorization server.
    .PARAMETER Redirecturl
        URL endpoint on relying party to which the OAuth token is to be sent.
    .PARAMETER Issuer
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Configservice
        Name of the entity that is used to obtain configuration for the current authentication request. It is used only in Citrix Cloud.
    .PARAMETER Audience
        Audience for which token is being sent by Citrix ADC IdP. This is typically entity name or url that represents the recipient.
    .PARAMETER Skewtime
        This option specifies the duration for which the token sent by Citrix ADC IdP is valid. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Relyingpartymetadataurl
        This is the endpoint at which Citrix ADC IdP can get details about Relying Party (RP) being configured. Metadata response should include endpoints for jwks_uri for RP public key(s).
    .PARAMETER Refreshinterval
        Interval at which Relying Party metadata is refreshed.
    .PARAMETER Encrypttoken
        Option to encrypt token when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data. This is applicable only if signature if offloaded to cloud.
    .PARAMETER Signaturealg
        Algorithm to be used to sign OpenID tokens.
         
        Possible values = RS256, RS512
    .PARAMETER Attributes
        Name-Value pairs of attributes to be inserted in idtoken. Configuration format is name=value_expr@@@name2=value2_expr@@@.
        '@@@' is used as delimiter between Name-Value pairs. name is a literal string whose value is 127 characters and does not contain '=' character.
        Value is advanced policy expression terminated by @@@ delimiter. Last value need not contain the delimiter.
    .PARAMETER Sendpassword
        Option to send encrypted password in idtoken.
         
        Possible values = ON, OFF
    .PARAMETER PassThru
        Return details about the created authenticationoauthidpprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationoauthidpprofile -name <string>
        An example how to add authenticationoauthidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationoauthidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile/
        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,

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

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

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

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

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

        [string]$Audience,

        [double]$Skewtime = '5',

        [string]$Defaultauthenticationgroup,

        [string]$Relyingpartymetadataurl,

        [double]$Refreshinterval = '50',

        [ValidateSet('ON', 'OFF')]
        [string]$Encrypttoken = 'OFF',

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

        [ValidateSet('RS256', 'RS512')]
        [string]$Signaturealg = 'RS256',

        [string]$Attributes,

        [ValidateSet('ON', 'OFF')]
        [string]$Sendpassword = 'OFF',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationoauthidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('redirecturl') ) { $payload.Add('redirecturl', $redirecturl) }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('configservice') ) { $payload.Add('configservice', $configservice) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('relyingpartymetadataurl') ) { $payload.Add('relyingpartymetadataurl', $relyingpartymetadataurl) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('encrypttoken') ) { $payload.Add('encrypttoken', $encrypttoken) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthidpprofile", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationoauthidpprofile -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-NSGetAuthenticationoauthidpprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationoauthidpprofile: Finished"
    }
}

function Invoke-NSDeleteAuthenticationoauthidpprofile {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth Identity Provider (IdP) profile resource.
    .PARAMETER Name
        Name for the new OAuth Identity Provider (IdP) single sign-on 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationoauthidpprofile -Name <string>
        An example how to delete authenticationoauthidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationoauthidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile/
        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-NSDeleteAuthenticationoauthidpprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationoauthidpprofile -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-NSDeleteAuthenticationoauthidpprofile: Finished"
    }
}

function Invoke-NSUpdateAuthenticationoauthidpprofile {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth Identity Provider (IdP) profile resource.
    .PARAMETER Name
        Name for the new OAuth Identity Provider (IdP) single sign-on 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 an action is created.
    .PARAMETER Clientid
        Unique identity of the relying party requesting for authentication.
    .PARAMETER Clientsecret
        Unique secret string to authorize relying party at authorization server.
    .PARAMETER Redirecturl
        URL endpoint on relying party to which the OAuth token is to be sent.
    .PARAMETER Issuer
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Configservice
        Name of the entity that is used to obtain configuration for the current authentication request. It is used only in Citrix Cloud.
    .PARAMETER Audience
        Audience for which token is being sent by Citrix ADC IdP. This is typically entity name or url that represents the recipient.
    .PARAMETER Skewtime
        This option specifies the duration for which the token sent by Citrix ADC IdP is valid. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Relyingpartymetadataurl
        This is the endpoint at which Citrix ADC IdP can get details about Relying Party (RP) being configured. Metadata response should include endpoints for jwks_uri for RP public key(s).
    .PARAMETER Refreshinterval
        Interval at which Relying Party metadata is refreshed.
    .PARAMETER Encrypttoken
        Option to encrypt token when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data. This is applicable only if signature if offloaded to cloud.
    .PARAMETER Signaturealg
        Algorithm to be used to sign OpenID tokens.
         
        Possible values = RS256, RS512
    .PARAMETER Attributes
        Name-Value pairs of attributes to be inserted in idtoken. Configuration format is name=value_expr@@@name2=value2_expr@@@.
        '@@@' is used as delimiter between Name-Value pairs. name is a literal string whose value is 127 characters and does not contain '=' character.
        Value is advanced policy expression terminated by @@@ delimiter. Last value need not contain the delimiter.
    .PARAMETER Sendpassword
        Option to send encrypted password in idtoken.
         
        Possible values = ON, OFF
    .PARAMETER PassThru
        Return details about the created authenticationoauthidpprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationoauthidpprofile -name <string>
        An example how to update authenticationoauthidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationoauthidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile/
        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,

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

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

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

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

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

        [string]$Audience,

        [double]$Skewtime,

        [string]$Defaultauthenticationgroup,

        [string]$Relyingpartymetadataurl,

        [double]$Refreshinterval,

        [ValidateSet('ON', 'OFF')]
        [string]$Encrypttoken,

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

        [ValidateSet('RS256', 'RS512')]
        [string]$Signaturealg,

        [string]$Attributes,

        [ValidateSet('ON', 'OFF')]
        [string]$Sendpassword,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('redirecturl') ) { $payload.Add('redirecturl', $redirecturl) }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('configservice') ) { $payload.Add('configservice', $configservice) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('relyingpartymetadataurl') ) { $payload.Add('relyingpartymetadataurl', $relyingpartymetadataurl) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('encrypttoken') ) { $payload.Add('encrypttoken', $encrypttoken) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSCmdlet.ShouldProcess("authenticationoauthidpprofile", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationoauthidpprofile -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-NSGetAuthenticationoauthidpprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationoauthidpprofile: Finished"
    }
}

function Invoke-NSUnsetAuthenticationoauthidpprofile {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for OAuth Identity Provider (IdP) profile resource.
    .PARAMETER Name
        Name for the new OAuth Identity Provider (IdP) single sign-on 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 an action is created.
    .PARAMETER Issuer
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Configservice
        Name of the entity that is used to obtain configuration for the current authentication request. It is used only in Citrix Cloud.
    .PARAMETER Audience
        Audience for which token is being sent by Citrix ADC IdP. This is typically entity name or url that represents the recipient.
    .PARAMETER Skewtime
        This option specifies the duration for which the token sent by Citrix ADC IdP is valid. For example, if skewTime is 10, then token would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Relyingpartymetadataurl
        This is the endpoint at which Citrix ADC IdP can get details about Relying Party (RP) being configured. Metadata response should include endpoints for jwks_uri for RP public key(s).
    .PARAMETER Refreshinterval
        Interval at which Relying Party metadata is refreshed.
    .PARAMETER Encrypttoken
        Option to encrypt token when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data. This is applicable only if signature if offloaded to cloud.
    .PARAMETER Signaturealg
        Algorithm to be used to sign OpenID tokens.
         
        Possible values = RS256, RS512
    .PARAMETER Attributes
        Name-Value pairs of attributes to be inserted in idtoken. Configuration format is name=value_expr@@@name2=value2_expr@@@.
        '@@@' is used as delimiter between Name-Value pairs. name is a literal string whose value is 127 characters and does not contain '=' character.
        Value is advanced policy expression terminated by @@@ delimiter. Last value need not contain the delimiter.
    .PARAMETER Sendpassword
        Option to send encrypted password in idtoken.
         
        Possible values = ON, OFF
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationoauthidpprofile -name <string>
        An example how to unset authenticationoauthidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationoauthidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile
        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]$issuer,

        [Boolean]$configservice,

        [Boolean]$audience,

        [Boolean]$skewtime,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$relyingpartymetadataurl,

        [Boolean]$refreshinterval,

        [Boolean]$encrypttoken,

        [Boolean]$signatureservice,

        [Boolean]$signaturealg,

        [Boolean]$attributes,

        [Boolean]$sendpassword 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationoauthidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('issuer') ) { $payload.Add('issuer', $issuer) }
            if ( $PSBoundParameters.ContainsKey('configservice') ) { $payload.Add('configservice', $configservice) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('relyingpartymetadataurl') ) { $payload.Add('relyingpartymetadataurl', $relyingpartymetadataurl) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSBoundParameters.ContainsKey('encrypttoken') ) { $payload.Add('encrypttoken', $encrypttoken) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationoauthidpprofile -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-NSUnsetAuthenticationoauthidpprofile: Finished"
    }
}

function Invoke-NSGetAuthenticationoauthidpprofile {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for OAuth Identity Provider (IdP) profile resource.
    .PARAMETER Name
        Name for the new OAuth Identity Provider (IdP) single sign-on 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationoauthidpprofile object(s).
    .PARAMETER Count
        If specified, the count of the authenticationoauthidpprofile 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-NSGetAuthenticationoauthidpprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidpprofile -GetAll
        Get all authenticationoauthidpprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidpprofile -Count
        Get the number of authenticationoauthidpprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidpprofile -name <string>
        Get authenticationoauthidpprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationoauthidpprofile -Filter @{ 'name'='<value>' }
        Get authenticationoauthidpprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationoauthidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile/
        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-NSGetAuthenticationoauthidpprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationoauthidpprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidpprofile -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 authenticationoauthidpprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationoauthidpprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidpprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationoauthidpprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidpprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationoauthidpprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationoauthidpprofile -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-NSGetAuthenticationoauthidpprofile: Ended"
    }
}

function Invoke-NSDeleteAuthenticationpolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationpolicy -Name <string>
        An example how to delete authenticationpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy/
        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-NSDeleteAuthenticationpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationpolicy -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-NSDeleteAuthenticationpolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationpolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the AUTHENTICATION server.
    .PARAMETER Action
        Name of the authentication action to be performed if the policy matches.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationpolicy -name <string>
        An example how to update authenticationpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy/
        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]$Name,

        [string]$Rule,

        [string]$Action,

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationpolicy: 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 ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationpolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationpolicy -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-NSGetAuthenticationpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationpolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationpolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the AUTHENTICATION server.
    .PARAMETER Action
        Name of the authentication action to be performed if the policy matches.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationpolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy/
        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]$Name,

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

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationpolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationpolicy -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-NSGetAuthenticationpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationpolicy: Finished"
    }
}

function Invoke-NSRenameAuthenticationpolicy {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .PARAMETER Newname
        New name for the authentication policy. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER PassThru
        Return details about the created authenticationpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationpolicy -name <string> -newname <string>
        An example how to rename authenticationpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy/
        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]$Name,

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

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

            if ( $PSCmdlet.ShouldProcess("authenticationpolicy", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationpolicy -Action rename -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-NSGetAuthenticationpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationpolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationpolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationpolicy -name <string>
        An example how to unset authenticationpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy
        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]$Name,

        [Boolean]$undefaction,

        [Boolean]$comment,

        [Boolean]$logaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationpolicy -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-NSUnsetAuthenticationpolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationpolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Authentication Policy resource.
    .PARAMETER Name
        Name for the advance AUTHENTICATION policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after AUTHENTICATION policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationpolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicy 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-NSGetAuthenticationpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicy -GetAll
        Get all authenticationpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicy -Count
        Get the number of authenticationpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicy -name <string>
        Get authenticationpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicy -Filter @{ 'name'='<value>' }
        Get authenticationpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy -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 authenticationpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy -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-NSGetAuthenticationpolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationpolicylabel that can be bound to authenticationpolicy.
    .PARAMETER Name
        Name of the advance authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationpolicy_authenticationpolicylabel_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicy_authenticationpolicylabel_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-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding -GetAll
        Get all authenticationpolicy_authenticationpolicylabel_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding -Count
        Get the number of authenticationpolicy_authenticationpolicylabel_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding -name <string>
        Get authenticationpolicy_authenticationpolicylabel_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicy_authenticationpolicylabel_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationpolicylabel_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-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicy_authenticationpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationpolicylabel_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 authenticationpolicy_authenticationpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicy_authenticationpolicylabel_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationpolicylabel_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicy_authenticationpolicylabel_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationpolicylabel_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicy_authenticationpolicylabel_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationpolicylabel_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-NSGetAuthenticationpolicyAuthenticationpolicylabelBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationpolicy.
    .PARAMETER Name
        Name of the advance authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationpolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicy_authenticationvserver_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-NSGetAuthenticationpolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding -GetAll
        Get all authenticationpolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding -Count
        Get the number of authenticationpolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding -name <string>
        Get authenticationpolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationvserver_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-NSGetAuthenticationpolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationvserver_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 authenticationpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_authenticationvserver_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-NSGetAuthenticationpolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationpolicy.
    .PARAMETER Name
        Name of the advance authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicy_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-NSGetAuthenticationpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyBinding -GetAll
        Get all authenticationpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyBinding -name <string>
        Get authenticationpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_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-NSGetAuthenticationpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_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 authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_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-NSGetAuthenticationpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationpolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationpolicy.
    .PARAMETER Name
        Name of the advance authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationpolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicy_systemglobal_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-NSGetAuthenticationpolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicySystemglobalBinding -GetAll
        Get all authenticationpolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicySystemglobalBinding -Count
        Get the number of authenticationpolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicySystemglobalBinding -name <string>
        Get authenticationpolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_systemglobal_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-NSGetAuthenticationpolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_systemglobal_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 authenticationpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicy_systemglobal_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-NSGetAuthenticationpolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationpolicylabel {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication policy label resource.
    .PARAMETER Labelname
        Name for the new authentication policy label.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER Type
        Type of feature (aaatm or rba) against which to match the policies bound to this policy label.
         
        Possible values = AAATM_REQ, RBA_REQ
    .PARAMETER Comment
        Any comments to preserve information about this authentication policy label.
    .PARAMETER Loginschema
        Login schema associated with authentication policy label. Login schema defines the UI rendering by providing customization option of the fields. If user intervention is not needed for a given factor such as group extraction, a loginSchema whose authentication schema is "noschema" should be used.
    .PARAMETER PassThru
        Return details about the created authenticationpolicylabel item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationpolicylabel -labelname <string>
        An example how to add authenticationpolicylabel config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel/
        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,

        [ValidateSet('AAATM_REQ', 'RBA_REQ')]
        [string]$Type = 'AAATM_REQ',

        [string]$Comment,

        [string]$Loginschema,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationpolicylabel: Starting"
    }
    process {
        try {
            $payload = @{ labelname = $labelname }
            if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('loginschema') ) { $payload.Add('loginschema', $loginschema) }
            if ( $PSCmdlet.ShouldProcess("authenticationpolicylabel", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationpolicylabel -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-NSGetAuthenticationpolicylabel -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationpolicylabel: Finished"
    }
}

function Invoke-NSDeleteAuthenticationpolicylabel {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication policy label resource.
    .PARAMETER Labelname
        Name for the new authentication policy label.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationpolicylabel -Labelname <string>
        An example how to delete authenticationpolicylabel config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel/
        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-NSDeleteAuthenticationpolicylabel: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$labelname", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationpolicylabel -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-NSDeleteAuthenticationpolicylabel: Finished"
    }
}

function Invoke-NSRenameAuthenticationpolicylabel {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication policy label resource.
    .PARAMETER Labelname
        Name for the new authentication policy label.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER Newname
        The new name of the auth policy label.
    .PARAMETER PassThru
        Return details about the created authenticationpolicylabel item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationpolicylabel -labelname <string> -newname <string>
        An example how to rename authenticationpolicylabel config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Newname,

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

            if ( $PSCmdlet.ShouldProcess("authenticationpolicylabel", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationpolicylabel -Action rename -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-NSGetAuthenticationpolicylabel -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationpolicylabel: Finished"
    }
}

function Invoke-NSGetAuthenticationpolicylabel {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for authentication policy label resource.
    .PARAMETER Labelname
        Name for the new authentication policy label.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER GetAll
        Retrieve all authenticationpolicylabel object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicylabel 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-NSGetAuthenticationpolicylabel
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabel -GetAll
        Get all authenticationpolicylabel data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabel -Count
        Get the number of authenticationpolicylabel objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabel -name <string>
        Get authenticationpolicylabel object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabel -Filter @{ 'name'='<value>' }
        Get authenticationpolicylabel data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicylabel
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationpolicylabel: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationpolicylabel objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel -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 authenticationpolicylabel objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicylabel objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicylabel configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicylabel configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel -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-NSGetAuthenticationpolicylabel: Ended"
    }
}

function Invoke-NSAddAuthenticationpolicylabelAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationpolicylabel.
    .PARAMETER Labelname
        Name of the authentication policy label to which to bind the policy.
    .PARAMETER Policyname
        Name of the authentication 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 Nextfactor
        On success invoke label.
    .PARAMETER PassThru
        Return details about the created authenticationpolicylabel_authenticationpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationpolicylabelAuthenticationpolicyBinding -labelname <string> -policyname <string> -priority <double>
        An example how to add authenticationpolicylabel_authenticationpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationpolicylabelAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_authenticationpolicy_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,

        [string]$Nextfactor,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationpolicylabelAuthenticationpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ labelname = $labelname
                policyname          = $policyname
                priority            = $priority
            }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSCmdlet.ShouldProcess("authenticationpolicylabel_authenticationpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationpolicylabel_authenticationpolicy_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-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationpolicylabelAuthenticationpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationpolicylabelAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationpolicylabel.
    .PARAMETER Labelname
        Name of the authentication policy label to which to bind the policy.
    .PARAMETER Policyname
        Name of the authentication policy to bind to the policy label.
    .PARAMETER Priority
        Specifies the priority of the policy.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationpolicylabelAuthenticationpolicyBinding -Labelname <string>
        An example how to delete authenticationpolicylabel_authenticationpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationpolicylabelAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_authenticationpolicy_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-NSDeleteAuthenticationpolicylabelAuthenticationpolicyBinding: 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 Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationpolicylabel_authenticationpolicy_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-NSDeleteAuthenticationpolicylabelAuthenticationpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationpolicylabel.
    .PARAMETER Labelname
        Name of the authentication policy label to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationpolicylabel_authenticationpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicylabel_authenticationpolicy_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-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding -GetAll
        Get all authenticationpolicylabel_authenticationpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding -Count
        Get the number of authenticationpolicylabel_authenticationpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding -name <string>
        Get authenticationpolicylabel_authenticationpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicylabel_authenticationpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_authenticationpolicy_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-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicylabel_authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_authenticationpolicy_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 authenticationpolicylabel_authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_authenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicylabel_authenticationpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_authenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicylabel_authenticationpolicy_binding configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_authenticationpolicy_binding -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicylabel_authenticationpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_authenticationpolicy_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-NSGetAuthenticationpolicylabelAuthenticationpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationpolicylabelBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationpolicylabel.
    .PARAMETER Labelname
        Name of the authorization policy label.
    .PARAMETER GetAll
        Retrieve all authenticationpolicylabel_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpolicylabel_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-NSGetAuthenticationpolicylabelBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelBinding -GetAll
        Get all authenticationpolicylabel_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelBinding -name <string>
        Get authenticationpolicylabel_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpolicylabelBinding -Filter @{ 'name'='<value>' }
        Get authenticationpolicylabel_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpolicylabelBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_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-NSGetAuthenticationpolicylabelBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_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 authenticationpolicylabel_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpolicylabel_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpolicylabel_binding configuration for property 'labelname'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_binding -NitroPath nitro/v1/config -Resource $labelname -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpolicylabel_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpolicylabel_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-NSGetAuthenticationpolicylabelBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationpushservice {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Service details for sending push notifications resource.
    .PARAMETER Name
        Name for the push service. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER Clientid
        Unique identity for communicating with Citrix Push server in cloud.
    .PARAMETER Clientsecret
        Unique secret for communicating with Citrix Push server in cloud.
    .PARAMETER Customerid
        Customer id/name of the account in cloud that is used to create clientid/secret pair.
    .PARAMETER Refreshinterval
        Interval at which certificates or idtoken is refreshed.
    .PARAMETER PassThru
        Return details about the created authenticationpushservice item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationpushservice -name <string>
        An example how to add authenticationpushservice config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationpushservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice/
        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,

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

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

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

        [double]$Refreshinterval = '50',

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationpushservice: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('customerid') ) { $payload.Add('customerid', $customerid) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSCmdlet.ShouldProcess("authenticationpushservice", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationpushservice -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-NSGetAuthenticationpushservice -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationpushservice: Finished"
    }
}

function Invoke-NSDeleteAuthenticationpushservice {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Service details for sending push notifications resource.
    .PARAMETER Name
        Name for the push service. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationpushservice -Name <string>
        An example how to delete authenticationpushservice config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationpushservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice/
        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-NSDeleteAuthenticationpushservice: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationpushservice -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-NSDeleteAuthenticationpushservice: Finished"
    }
}

function Invoke-NSUpdateAuthenticationpushservice {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Service details for sending push notifications resource.
    .PARAMETER Name
        Name for the push service. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER Clientid
        Unique identity for communicating with Citrix Push server in cloud.
    .PARAMETER Clientsecret
        Unique secret for communicating with Citrix Push server in cloud.
    .PARAMETER Customerid
        Customer id/name of the account in cloud that is used to create clientid/secret pair.
    .PARAMETER Refreshinterval
        Interval at which certificates or idtoken is refreshed.
    .PARAMETER PassThru
        Return details about the created authenticationpushservice item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationpushservice -name <string>
        An example how to update authenticationpushservice config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationpushservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice/
        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,

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

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

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

        [double]$Refreshinterval,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationpushservice: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('clientid') ) { $payload.Add('clientid', $clientid) }
            if ( $PSBoundParameters.ContainsKey('clientsecret') ) { $payload.Add('clientsecret', $clientsecret) }
            if ( $PSBoundParameters.ContainsKey('customerid') ) { $payload.Add('customerid', $customerid) }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSCmdlet.ShouldProcess("authenticationpushservice", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationpushservice -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-NSGetAuthenticationpushservice -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationpushservice: Finished"
    }
}

function Invoke-NSUnsetAuthenticationpushservice {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Service details for sending push notifications resource.
    .PARAMETER Name
        Name for the push service. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER Refreshinterval
        Interval at which certificates or idtoken is refreshed.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationpushservice -name <string>
        An example how to unset authenticationpushservice config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationpushservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice
        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]$refreshinterval 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationpushservice: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('refreshinterval') ) { $payload.Add('refreshinterval', $refreshinterval) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationpushservice -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-NSUnsetAuthenticationpushservice: Finished"
    }
}

function Invoke-NSGetAuthenticationpushservice {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Service details for sending push notifications resource.
    .PARAMETER Name
        Name for the push service. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
        CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my push service" or 'my push service'). .
    .PARAMETER GetAll
        Retrieve all authenticationpushservice object(s).
    .PARAMETER Count
        If specified, the count of the authenticationpushservice 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-NSGetAuthenticationpushservice
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpushservice -GetAll
        Get all authenticationpushservice data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpushservice -Count
        Get the number of authenticationpushservice objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpushservice -name <string>
        Get authenticationpushservice object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationpushservice -Filter @{ 'name'='<value>' }
        Get authenticationpushservice data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationpushservice
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice/
        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-NSGetAuthenticationpushservice: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationpushservice objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpushservice -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 authenticationpushservice objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpushservice -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationpushservice objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpushservice -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationpushservice configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpushservice -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationpushservice configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationpushservice -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-NSGetAuthenticationpushservice: Ended"
    }
}

function Invoke-NSUnsetAuthenticationradiusaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS action resource.
    .PARAMETER Name
        Name for the RADIUS action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Serverport
        Port number on which the RADIUS server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Radnasip
        If enabled, the Citrix ADC IP address (NSIP) is sent to the RADIUS server as the Network Access Server IP (NASIP) address.
        The RADIUS protocol defines the meaning and use of the NASIP address.
        Possible values = ENABLED, DISABLED
    .PARAMETER Radnasid
        If configured, this string is sent to the RADIUS server as the Network Access Server ID (NASID).
    .PARAMETER Radvendorid
        RADIUS vendor ID attribute, used for RADIUS group extraction.
    .PARAMETER Radattributetype
        RADIUS attribute type, used for RADIUS group extraction.
    .PARAMETER Radgroupsprefix
        RADIUS groups prefix string.
        This groups prefix precedes the group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Radgroupseparator
        RADIUS group separator string
        The group separator delimits group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Passencoding
        Encoding type for passwords in RADIUS packets that the Citrix ADC sends to the RADIUS server.
         
        Possible values = pap, chap, mschapv1, mschapv2
    .PARAMETER Ipvendorid
        Vendor ID of the intranet IP attribute in the RADIUS response.
        NOTE: A value of 0 indicates that the attribute is not vendor encoded.
    .PARAMETER Ipattributetype
        Remote IP address attribute type in a RADIUS response.
    .PARAMETER Accounting
        Whether the RADIUS server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Pwdvendorid
        Vendor ID of the attribute, in the RADIUS response, used to extract the user password.
    .PARAMETER Pwdattributetype
        Vendor-specific password attribute type in a RADIUS response.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Callingstationid
        Send Calling-Station-ID of the client to the RADIUS server. IP Address of the client is sent as its Calling-Station-ID.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Authservretry
        Number of retry by the Citrix ADC before getting response from the RADIUS server.
         
         
        Maximum value = 10
    .PARAMETER Authentication
        Configure the RADIUS server state to accept or refuse authentication messages.
         
        Possible values = ON, OFF
    .PARAMETER Tunnelendpointclientip
        Send Tunnel Endpoint Client IP address to the RADIUS server.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Transport
        Transport mode to RADIUS server.
         
        Possible values = UDP, TCP, TLS
    .PARAMETER Targetlbvserver
        If transport mode is TLS, specify the name of LB vserver to associate. The LB vserver needs to be of type TCP and service associated needs to be SSL_TCP.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationradiusaction -name <string>
        An example how to unset authenticationradiusaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationradiusaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction
        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]$Name,

        [Boolean]$serverport,

        [Boolean]$authtimeout,

        [Boolean]$radnasip,

        [Boolean]$radnasid,

        [Boolean]$radvendorid,

        [Boolean]$radattributetype,

        [Boolean]$radgroupsprefix,

        [Boolean]$radgroupseparator,

        [Boolean]$passencoding,

        [Boolean]$ipvendorid,

        [Boolean]$ipattributetype,

        [Boolean]$accounting,

        [Boolean]$pwdvendorid,

        [Boolean]$pwdattributetype,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$callingstationid,

        [Boolean]$authservretry,

        [Boolean]$authentication,

        [Boolean]$tunnelendpointclientip,

        [Boolean]$transport,

        [Boolean]$targetlbvserver 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationradiusaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('radnasip') ) { $payload.Add('radnasip', $radnasip) }
            if ( $PSBoundParameters.ContainsKey('radnasid') ) { $payload.Add('radnasid', $radnasid) }
            if ( $PSBoundParameters.ContainsKey('radvendorid') ) { $payload.Add('radvendorid', $radvendorid) }
            if ( $PSBoundParameters.ContainsKey('radattributetype') ) { $payload.Add('radattributetype', $radattributetype) }
            if ( $PSBoundParameters.ContainsKey('radgroupsprefix') ) { $payload.Add('radgroupsprefix', $radgroupsprefix) }
            if ( $PSBoundParameters.ContainsKey('radgroupseparator') ) { $payload.Add('radgroupseparator', $radgroupseparator) }
            if ( $PSBoundParameters.ContainsKey('passencoding') ) { $payload.Add('passencoding', $passencoding) }
            if ( $PSBoundParameters.ContainsKey('ipvendorid') ) { $payload.Add('ipvendorid', $ipvendorid) }
            if ( $PSBoundParameters.ContainsKey('ipattributetype') ) { $payload.Add('ipattributetype', $ipattributetype) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('pwdvendorid') ) { $payload.Add('pwdvendorid', $pwdvendorid) }
            if ( $PSBoundParameters.ContainsKey('pwdattributetype') ) { $payload.Add('pwdattributetype', $pwdattributetype) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('callingstationid') ) { $payload.Add('callingstationid', $callingstationid) }
            if ( $PSBoundParameters.ContainsKey('authservretry') ) { $payload.Add('authservretry', $authservretry) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('tunnelendpointclientip') ) { $payload.Add('tunnelendpointclientip', $tunnelendpointclientip) }
            if ( $PSBoundParameters.ContainsKey('transport') ) { $payload.Add('transport', $transport) }
            if ( $PSBoundParameters.ContainsKey('targetlbvserver') ) { $payload.Add('targetlbvserver', $targetlbvserver) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationradiusaction -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-NSUnsetAuthenticationradiusaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationradiusaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS action resource.
    .PARAMETER Name
        Name for the RADIUS action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationradiusaction -Name <string>
        An example how to delete authenticationradiusaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationradiusaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction/
        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-NSDeleteAuthenticationradiusaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationradiusaction -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-NSDeleteAuthenticationradiusaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationradiusaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS action resource.
    .PARAMETER Name
        Name for the RADIUS action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Serverip
        IP address assigned to the RADIUS server.
    .PARAMETER Servername
        RADIUS server name as a FQDN. Mutually exclusive with RADIUS IP address.
    .PARAMETER Serverport
        Port number on which the RADIUS server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Radkey
        Key shared between the RADIUS server and the Citrix ADC.
        Required to allow the Citrix ADC to communicate with the RADIUS server.
    .PARAMETER Radnasip
        If enabled, the Citrix ADC IP address (NSIP) is sent to the RADIUS server as the Network Access Server IP (NASIP) address.
        The RADIUS protocol defines the meaning and use of the NASIP address.
        Possible values = ENABLED, DISABLED
    .PARAMETER Radnasid
        If configured, this string is sent to the RADIUS server as the Network Access Server ID (NASID).
    .PARAMETER Radvendorid
        RADIUS vendor ID attribute, used for RADIUS group extraction.
    .PARAMETER Radattributetype
        RADIUS attribute type, used for RADIUS group extraction.
    .PARAMETER Radgroupsprefix
        RADIUS groups prefix string.
        This groups prefix precedes the group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Radgroupseparator
        RADIUS group separator string
        The group separator delimits group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Passencoding
        Encoding type for passwords in RADIUS packets that the Citrix ADC sends to the RADIUS server.
         
        Possible values = pap, chap, mschapv1, mschapv2
    .PARAMETER Ipvendorid
        Vendor ID of the intranet IP attribute in the RADIUS response.
        NOTE: A value of 0 indicates that the attribute is not vendor encoded.
    .PARAMETER Ipattributetype
        Remote IP address attribute type in a RADIUS response.
    .PARAMETER Accounting
        Whether the RADIUS server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Pwdvendorid
        Vendor ID of the attribute, in the RADIUS response, used to extract the user password.
    .PARAMETER Pwdattributetype
        Vendor-specific password attribute type in a RADIUS response.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Callingstationid
        Send Calling-Station-ID of the client to the RADIUS server. IP Address of the client is sent as its Calling-Station-ID.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Authservretry
        Number of retry by the Citrix ADC before getting response from the RADIUS server.
         
         
        Maximum value = 10
    .PARAMETER Authentication
        Configure the RADIUS server state to accept or refuse authentication messages.
         
        Possible values = ON, OFF
    .PARAMETER Tunnelendpointclientip
        Send Tunnel Endpoint Client IP address to the RADIUS server.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Transport
        Transport mode to RADIUS server.
         
        Possible values = UDP, TCP, TLS
    .PARAMETER Targetlbvserver
        If transport mode is TLS, specify the name of LB vserver to associate. The LB vserver needs to be of type TCP and service associated needs to be SSL_TCP.
    .PARAMETER PassThru
        Return details about the created authenticationradiusaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationradiusaction -name <string>
        An example how to update authenticationradiusaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationradiusaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction/
        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]$Name,

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

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

        [int]$Serverport,

        [double]$Authtimeout,

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

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

        [string]$Radnasid,

        [double]$Radvendorid,

        [double]$Radattributetype,

        [string]$Radgroupsprefix,

        [string]$Radgroupseparator,

        [ValidateSet('pap', 'chap', 'mschapv1', 'mschapv2')]
        [string]$Passencoding,

        [double]$Ipvendorid,

        [double]$Ipattributetype,

        [ValidateSet('ON', 'OFF')]
        [string]$Accounting,

        [double]$Pwdvendorid,

        [double]$Pwdattributetype,

        [string]$Defaultauthenticationgroup,

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

        [double]$Authservretry,

        [ValidateSet('ON', 'OFF')]
        [string]$Authentication,

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

        [ValidateSet('UDP', 'TCP', 'TLS')]
        [string]$Transport,

        [string]$Targetlbvserver,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationradiusaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('radkey') ) { $payload.Add('radkey', $radkey) }
            if ( $PSBoundParameters.ContainsKey('radnasip') ) { $payload.Add('radnasip', $radnasip) }
            if ( $PSBoundParameters.ContainsKey('radnasid') ) { $payload.Add('radnasid', $radnasid) }
            if ( $PSBoundParameters.ContainsKey('radvendorid') ) { $payload.Add('radvendorid', $radvendorid) }
            if ( $PSBoundParameters.ContainsKey('radattributetype') ) { $payload.Add('radattributetype', $radattributetype) }
            if ( $PSBoundParameters.ContainsKey('radgroupsprefix') ) { $payload.Add('radgroupsprefix', $radgroupsprefix) }
            if ( $PSBoundParameters.ContainsKey('radgroupseparator') ) { $payload.Add('radgroupseparator', $radgroupseparator) }
            if ( $PSBoundParameters.ContainsKey('passencoding') ) { $payload.Add('passencoding', $passencoding) }
            if ( $PSBoundParameters.ContainsKey('ipvendorid') ) { $payload.Add('ipvendorid', $ipvendorid) }
            if ( $PSBoundParameters.ContainsKey('ipattributetype') ) { $payload.Add('ipattributetype', $ipattributetype) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('pwdvendorid') ) { $payload.Add('pwdvendorid', $pwdvendorid) }
            if ( $PSBoundParameters.ContainsKey('pwdattributetype') ) { $payload.Add('pwdattributetype', $pwdattributetype) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('callingstationid') ) { $payload.Add('callingstationid', $callingstationid) }
            if ( $PSBoundParameters.ContainsKey('authservretry') ) { $payload.Add('authservretry', $authservretry) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('tunnelendpointclientip') ) { $payload.Add('tunnelendpointclientip', $tunnelendpointclientip) }
            if ( $PSBoundParameters.ContainsKey('transport') ) { $payload.Add('transport', $transport) }
            if ( $PSBoundParameters.ContainsKey('targetlbvserver') ) { $payload.Add('targetlbvserver', $targetlbvserver) }
            if ( $PSCmdlet.ShouldProcess("authenticationradiusaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationradiusaction -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-NSGetAuthenticationradiusaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationradiusaction: Finished"
    }
}

function Invoke-NSAddAuthenticationradiusaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS action resource.
    .PARAMETER Name
        Name for the RADIUS action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER Serverip
        IP address assigned to the RADIUS server.
    .PARAMETER Servername
        RADIUS server name as a FQDN. Mutually exclusive with RADIUS IP address.
    .PARAMETER Serverport
        Port number on which the RADIUS server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the RADIUS server.
    .PARAMETER Radkey
        Key shared between the RADIUS server and the Citrix ADC.
        Required to allow the Citrix ADC to communicate with the RADIUS server.
    .PARAMETER Radnasip
        If enabled, the Citrix ADC IP address (NSIP) is sent to the RADIUS server as the Network Access Server IP (NASIP) address.
        The RADIUS protocol defines the meaning and use of the NASIP address.
        Possible values = ENABLED, DISABLED
    .PARAMETER Radnasid
        If configured, this string is sent to the RADIUS server as the Network Access Server ID (NASID).
    .PARAMETER Radvendorid
        RADIUS vendor ID attribute, used for RADIUS group extraction.
    .PARAMETER Radattributetype
        RADIUS attribute type, used for RADIUS group extraction.
    .PARAMETER Radgroupsprefix
        RADIUS groups prefix string.
        This groups prefix precedes the group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Radgroupseparator
        RADIUS group separator string
        The group separator delimits group names within a RADIUS attribute for RADIUS group extraction.
    .PARAMETER Passencoding
        Encoding type for passwords in RADIUS packets that the Citrix ADC sends to the RADIUS server.
         
        Possible values = pap, chap, mschapv1, mschapv2
    .PARAMETER Ipvendorid
        Vendor ID of the intranet IP attribute in the RADIUS response.
        NOTE: A value of 0 indicates that the attribute is not vendor encoded.
    .PARAMETER Ipattributetype
        Remote IP address attribute type in a RADIUS response.
    .PARAMETER Accounting
        Whether the RADIUS server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Pwdvendorid
        Vendor ID of the attribute, in the RADIUS response, used to extract the user password.
    .PARAMETER Pwdattributetype
        Vendor-specific password attribute type in a RADIUS response.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Callingstationid
        Send Calling-Station-ID of the client to the RADIUS server. IP Address of the client is sent as its Calling-Station-ID.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Authservretry
        Number of retry by the Citrix ADC before getting response from the RADIUS server.
         
         
        Maximum value = 10
    .PARAMETER Authentication
        Configure the RADIUS server state to accept or refuse authentication messages.
         
        Possible values = ON, OFF
    .PARAMETER Tunnelendpointclientip
        Send Tunnel Endpoint Client IP address to the RADIUS server.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Transport
        Transport mode to RADIUS server.
         
        Possible values = UDP, TCP, TLS
    .PARAMETER Targetlbvserver
        If transport mode is TLS, specify the name of LB vserver to associate. The LB vserver needs to be of type TCP and service associated needs to be SSL_TCP.
    .PARAMETER PassThru
        Return details about the created authenticationradiusaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationradiusaction -name <string> -radkey <string>
        An example how to add authenticationradiusaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationradiusaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction/
        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]$Name,

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

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

        [int]$Serverport,

        [double]$Authtimeout = '3',

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

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

        [string]$Radnasid,

        [double]$Radvendorid,

        [double]$Radattributetype,

        [string]$Radgroupsprefix,

        [string]$Radgroupseparator,

        [ValidateSet('pap', 'chap', 'mschapv1', 'mschapv2')]
        [string]$Passencoding = 'pap',

        [double]$Ipvendorid,

        [double]$Ipattributetype,

        [ValidateSet('ON', 'OFF')]
        [string]$Accounting,

        [double]$Pwdvendorid,

        [double]$Pwdattributetype,

        [string]$Defaultauthenticationgroup,

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

        [double]$Authservretry = '3',

        [ValidateSet('ON', 'OFF')]
        [string]$Authentication = 'ON',

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

        [ValidateSet('UDP', 'TCP', 'TLS')]
        [string]$Transport = 'RAD_TRANSPORT_UDP',

        [string]$Targetlbvserver,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationradiusaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                radkey         = $radkey
            }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('radnasip') ) { $payload.Add('radnasip', $radnasip) }
            if ( $PSBoundParameters.ContainsKey('radnasid') ) { $payload.Add('radnasid', $radnasid) }
            if ( $PSBoundParameters.ContainsKey('radvendorid') ) { $payload.Add('radvendorid', $radvendorid) }
            if ( $PSBoundParameters.ContainsKey('radattributetype') ) { $payload.Add('radattributetype', $radattributetype) }
            if ( $PSBoundParameters.ContainsKey('radgroupsprefix') ) { $payload.Add('radgroupsprefix', $radgroupsprefix) }
            if ( $PSBoundParameters.ContainsKey('radgroupseparator') ) { $payload.Add('radgroupseparator', $radgroupseparator) }
            if ( $PSBoundParameters.ContainsKey('passencoding') ) { $payload.Add('passencoding', $passencoding) }
            if ( $PSBoundParameters.ContainsKey('ipvendorid') ) { $payload.Add('ipvendorid', $ipvendorid) }
            if ( $PSBoundParameters.ContainsKey('ipattributetype') ) { $payload.Add('ipattributetype', $ipattributetype) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('pwdvendorid') ) { $payload.Add('pwdvendorid', $pwdvendorid) }
            if ( $PSBoundParameters.ContainsKey('pwdattributetype') ) { $payload.Add('pwdattributetype', $pwdattributetype) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('callingstationid') ) { $payload.Add('callingstationid', $callingstationid) }
            if ( $PSBoundParameters.ContainsKey('authservretry') ) { $payload.Add('authservretry', $authservretry) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('tunnelendpointclientip') ) { $payload.Add('tunnelendpointclientip', $tunnelendpointclientip) }
            if ( $PSBoundParameters.ContainsKey('transport') ) { $payload.Add('transport', $transport) }
            if ( $PSBoundParameters.ContainsKey('targetlbvserver') ) { $payload.Add('targetlbvserver', $targetlbvserver) }
            if ( $PSCmdlet.ShouldProcess("authenticationradiusaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationradiusaction -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-NSGetAuthenticationradiusaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationradiusaction: Finished"
    }
}

function Invoke-NSGetAuthenticationradiusaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for RADIUS action resource.
    .PARAMETER Name
        Name for the RADIUS action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the RADIUS action is added.
    .PARAMETER GetAll
        Retrieve all authenticationradiusaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiusaction 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-NSGetAuthenticationradiusaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiusaction -GetAll
        Get all authenticationradiusaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiusaction -Count
        Get the number of authenticationradiusaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiusaction -name <string>
        Get authenticationradiusaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiusaction -Filter @{ 'name'='<value>' }
        Get authenticationradiusaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiusaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationradiusaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationradiusaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiusaction -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 authenticationradiusaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiusaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiusaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiusaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiusaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiusaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiusaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiusaction -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-NSGetAuthenticationradiusaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationradiuspolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS policy resource.
    .PARAMETER Name
        Name for the RADIUS authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after RADIUS policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the RADIUS server.
    .PARAMETER Reqaction
        Name of the RADIUS action to perform if the policy matches.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationradiuspolicy -name <string>
        An example how to unset authenticationradiuspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationradiuspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy
        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]$Name,

        [Boolean]$rule,

        [Boolean]$reqaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationradiuspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationradiuspolicy -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-NSUnsetAuthenticationradiuspolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationradiuspolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS policy resource.
    .PARAMETER Name
        Name for the RADIUS authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after RADIUS policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the RADIUS server.
    .PARAMETER Reqaction
        Name of the RADIUS action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationradiuspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationradiuspolicy -name <string> -rule <string>
        An example how to add authenticationradiuspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationradiuspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationradiuspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
            }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationradiuspolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationradiuspolicy -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-NSGetAuthenticationradiuspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationradiuspolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationradiuspolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS policy resource.
    .PARAMETER Name
        Name for the RADIUS authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after RADIUS policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationradiuspolicy -Name <string>
        An example how to delete authenticationradiuspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationradiuspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy/
        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-NSDeleteAuthenticationradiuspolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationradiuspolicy -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-NSDeleteAuthenticationradiuspolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationradiuspolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for RADIUS policy resource.
    .PARAMETER Name
        Name for the RADIUS authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after RADIUS policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the RADIUS server.
    .PARAMETER Reqaction
        Name of the RADIUS action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationradiuspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationradiuspolicy -name <string>
        An example how to update authenticationradiuspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationradiuspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy/
        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]$Name,

        [string]$Rule,

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationradiuspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationradiuspolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationradiuspolicy -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-NSGetAuthenticationradiuspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationradiuspolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationradiuspolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for RADIUS policy resource.
    .PARAMETER Name
        Name for the RADIUS authentication policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after RADIUS policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy 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-NSGetAuthenticationradiuspolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicy -GetAll
        Get all authenticationradiuspolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicy -Count
        Get the number of authenticationradiuspolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicy -name <string>
        Get authenticationradiuspolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicy -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationradiuspolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationradiuspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy -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 authenticationradiuspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy -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-NSGetAuthenticationradiuspolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationradiuspolicy.
    .PARAMETER Name
        Name of the RADIUS authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy_authenticationvserver_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-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding -GetAll
        Get all authenticationradiuspolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding -Count
        Get the number of authenticationradiuspolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding -name <string>
        Get authenticationradiuspolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_authenticationvserver_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-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationradiuspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_authenticationvserver_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 authenticationradiuspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_authenticationvserver_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-NSGetAuthenticationradiuspolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationradiuspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationradiuspolicy.
    .PARAMETER Name
        Name of the RADIUS authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy_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-NSGetAuthenticationradiuspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyBinding -GetAll
        Get all authenticationradiuspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyBinding -name <string>
        Get authenticationradiuspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_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-NSGetAuthenticationradiuspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationradiuspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_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 authenticationradiuspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_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-NSGetAuthenticationradiuspolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationradiuspolicy.
    .PARAMETER Name
        Name of the RADIUS authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy_systemglobal_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-NSGetAuthenticationradiuspolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding -GetAll
        Get all authenticationradiuspolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding -Count
        Get the number of authenticationradiuspolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding -name <string>
        Get authenticationradiuspolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_systemglobal_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-NSGetAuthenticationradiuspolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationradiuspolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_systemglobal_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 authenticationradiuspolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_systemglobal_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-NSGetAuthenticationradiuspolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationradiuspolicy.
    .PARAMETER Name
        Name of the RADIUS authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy_vpnglobal_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-NSGetAuthenticationradiuspolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding -GetAll
        Get all authenticationradiuspolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding -Count
        Get the number of authenticationradiuspolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding -name <string>
        Get authenticationradiuspolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnglobal_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-NSGetAuthenticationradiuspolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationradiuspolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnglobal_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 authenticationradiuspolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnglobal_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-NSGetAuthenticationradiuspolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationradiuspolicy.
    .PARAMETER Name
        Name of the RADIUS authentication policy.
    .PARAMETER GetAll
        Retrieve all authenticationradiuspolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationradiuspolicy_vpnvserver_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-NSGetAuthenticationradiuspolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding -GetAll
        Get all authenticationradiuspolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding -Count
        Get the number of authenticationradiuspolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding -name <string>
        Get authenticationradiuspolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationradiuspolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationradiuspolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnvserver_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-NSGetAuthenticationradiuspolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationradiuspolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnvserver_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 authenticationradiuspolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationradiuspolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationradiuspolicy_vpnvserver_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-NSGetAuthenticationradiuspolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSUnsetAuthenticationsamlaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml action resource.
    .PARAMETER Name
        Name for the SAML server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML profile is created.
    .PARAMETER Metadataurl
        This URL is used for obtaining saml metadata. Note that it fills samlIdPCertName and samlredirectUrl fields so those fields should not be updated when metadataUrl present.
    .PARAMETER Samlsigningcertname
        Name of the SSL certificate to sign requests from ServiceProvider (SP) to Identity Provider (IdP).
    .PARAMETER Samlredirecturl
        URL to which users are redirected for authentication. Note that if metadateURL is present then this filed should be empty.
    .PARAMETER Samlacsindex
        Index/ID of the metadata entry corresponding to this configuration.
         
         
        Maximum value = 255
    .PARAMETER Samluserfield
        SAML user ID, as given in the SAML assertion.
    .PARAMETER Samlrejectunsignedassertion
        Reject unsigned SAML assertions. ON option results in rejection of Assertion that is received without signature. STRICT option ensures that both Response and Assertion are signed. OFF allows unsigned Assertions.
         
        Possible values = ON, OFF, STRICT
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Samltwofactor
        Option to enable second factor after SAML.
         
        Possible values = ON, OFF
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute1. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute2
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute2. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute3
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute3. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute4
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute4. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute5
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute5. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute6
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute6. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute7
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute7. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute8
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute8. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute9
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute9. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute10
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute10. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute11
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute11. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute12
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute12. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute13
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute13. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute14
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute14. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute15
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute15. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute16
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute16. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Relaystaterule
        Boolean expression that will be evaluated to validate the SAML Response.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Requestedauthncontext
        This element specifies the authentication context requirements of authentication statements returned in the response.
         
        Possible values = exact, minimum, maximum, better
    .PARAMETER Authnctxclassref
        This element specifies the authentication class types that are requested from IdP (IdentityProvider).
        InternetProtocol: This is applicable when a principal is authenticated through the use of a provided IP address.
        InternetProtocolPassword: This is applicable when a principal is authenticated through the use of a provided IP address, in addition to a username/password.
        Kerberos: This is applicable when the principal has authenticated using a password to a local authentication authority, in order to acquire a Kerberos ticket.
        MobileOneFactorUnregistered: This indicates authentication of the mobile device without requiring explicit end-user interaction.
        MobileTwoFactorUnregistered: This indicates two-factor based authentication during mobile customer registration process, such as secure device and user PIN.
        MobileOneFactorContract: Reflects mobile contract customer registration procedures and a single factor authentication.
        MobileTwoFactorContract: Reflects mobile contract customer registration procedures and a two-factor based authentication.
        Password: This class is applicable when a principal authenticates using password over unprotected http session.
        PasswordProtectedTransport: This class is applicable when a principal authenticates to an authentication authority through the presentation of a password over a protected session.
        PreviousSession: This class is applicable when a principal had authenticated to an authentication authority at some point in the past using any authentication context.
        X509: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of an X.509 Public Key Infrastructure.
        PGP: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of a PGP Public Key Infrastructure.
        SPKI: This indicates that the principal authenticated by means of a digital signature where the key was validated via an SPKI Infrastructure.
        XMLDSig: This indicates that the principal authenticated by means of a digital signature according to the processing rules specified in the XML Digital Signature specification.
        Smartcard: This indicates that the principal has authenticated using smartcard.
        SmartcardPKI: This class is applicable when a principal authenticates to an authentication authority through a two-factor authentication mechanism using a smartcard with enclosed private key and a PIN.
        SoftwarePKI: This class is applicable when a principal uses an X.509 certificate stored in software to authenticate to the authentication authority.
        Telephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone number, transported via a telephony protocol such as ADSL.
        NomadTelephony: Indicates that the principal is "roaming" and authenticates via the means of the line number, a user suffix, and a password element.
        PersonalTelephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone.
        AuthenticatedTelephony: Indicates that the principal authenticated via the means of the line number, a user suffix, and a password element.
        SecureRemotePassword: This class is applicable when the authentication was performed by means of Secure Remote Password.
        TLSClient: This class indicates that the principal authenticated by means of a client certificate, secured with the SSL/TLS transport.
        TimeSyncToken: This is applicable when a principal authenticates through a time synchronization token.
        Unspecified: This indicates that the authentication was performed by unspecified means.
        Windows: This indicates that Windows integrated authentication is utilized for authentication.
        Possible values = InternetProtocol, InternetProtocolPassword, Kerberos, MobileOneFactorUnregistered, MobileTwoFactorUnregistered, MobileOneFactorContract, MobileTwoFactorContract, Password, PasswordProtectedTransport, PreviousSession, X509, PGP, SPKI, XMLDSig, Smartcard, SmartcardPKI, SoftwarePKI, Telephony, NomadTelephony, PersonalTelephony, AuthenticatedTelephony, SecureRemotePassword, TLSClient, TimeSyncToken, Unspecified, Windows
    .PARAMETER Customauthnctxclassref
        This element specifies the custom authentication class reference to be sent as a part of the Authentication Request that is sent by the SP to SAML IDP. The input string must be the body of the authentication class being requested.
        Input format: Alphanumeric string or URL specifying the body of the Request.If more than one string has to be provided, then the same can be done by specifying the classes as a string of comma separated values.
        Example input: set authentication samlaction samlact1 -customAuthnCtxClassRef http://www.class1.com/LoA1,http://www.class2.com/LoA2
        .
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Attributeconsumingserviceindex
        Index/ID of the attribute specification at Identity Provider (IdP). IdP will locate attributes requested by SP using this index and send those attributes in Assertion.
         
         
        Maximum value = 255
    .PARAMETER Sendthumbprint
        Option to send thumbprint instead of x509 certificate in SAML request.
         
        Possible values = ON, OFF
    .PARAMETER Enforceusername
        Option to choose whether the username that is extracted from SAML assertion can be edited in login page while doing second factor.
         
        Possible values = ON, OFF
    .PARAMETER Logouturl
        SingleLogout URL on IdP to which logoutRequest will be sent on Citrix ADC session cleanup.
    .PARAMETER Artifactresolutionserviceurl
        URL of the Artifact Resolution Service on IdP to which Citrix ADC will post artifact to get actual SAML token.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC ServiceProvider allows on an incoming assertion. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Forceauthn
        Option that forces authentication at the Identity Provider (IdP) that receives Citrix ADC's request.
         
        Possible values = ON, OFF
    .PARAMETER Groupnamefield
        Name of the tag in assertion that contains user groups.
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Metadatarefreshinterval
        Interval in minutes for fetching metadata from specified metadata URL.
    .PARAMETER Storesamlresponse
        Option to store entire SAML Response through the life of user session.
         
        Possible values = ON, OFF
    .PARAMETER Statechecks
        Boolean expression that will be evaluated to validate HTTP requests on SAML endpoints.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsamlaction -name <string>
        An example how to unset authenticationsamlaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsamlaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction
        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]$Name,

        [Boolean]$metadataurl,

        [Boolean]$samlsigningcertname,

        [Boolean]$samlredirecturl,

        [Boolean]$samlacsindex,

        [Boolean]$samluserfield,

        [Boolean]$samlrejectunsignedassertion,

        [Boolean]$samlissuername,

        [Boolean]$samltwofactor,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$attribute1,

        [Boolean]$attribute2,

        [Boolean]$attribute3,

        [Boolean]$attribute4,

        [Boolean]$attribute5,

        [Boolean]$attribute6,

        [Boolean]$attribute7,

        [Boolean]$attribute8,

        [Boolean]$attribute9,

        [Boolean]$attribute10,

        [Boolean]$attribute11,

        [Boolean]$attribute12,

        [Boolean]$attribute13,

        [Boolean]$attribute14,

        [Boolean]$attribute15,

        [Boolean]$attribute16,

        [Boolean]$attributes,

        [Boolean]$relaystaterule,

        [Boolean]$signaturealg,

        [Boolean]$digestmethod,

        [Boolean]$requestedauthncontext,

        [Boolean]$authnctxclassref,

        [Boolean]$customauthnctxclassref,

        [Boolean]$samlbinding,

        [Boolean]$attributeconsumingserviceindex,

        [Boolean]$sendthumbprint,

        [Boolean]$enforceusername,

        [Boolean]$logouturl,

        [Boolean]$artifactresolutionserviceurl,

        [Boolean]$skewtime,

        [Boolean]$logoutbinding,

        [Boolean]$forceauthn,

        [Boolean]$groupnamefield,

        [Boolean]$audience,

        [Boolean]$metadatarefreshinterval,

        [Boolean]$storesamlresponse,

        [Boolean]$statechecks 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsamlaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) }
            if ( $PSBoundParameters.ContainsKey('samlredirecturl') ) { $payload.Add('samlredirecturl', $samlredirecturl) }
            if ( $PSBoundParameters.ContainsKey('samlacsindex') ) { $payload.Add('samlacsindex', $samlacsindex) }
            if ( $PSBoundParameters.ContainsKey('samluserfield') ) { $payload.Add('samluserfield', $samluserfield) }
            if ( $PSBoundParameters.ContainsKey('samlrejectunsignedassertion') ) { $payload.Add('samlrejectunsignedassertion', $samlrejectunsignedassertion) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('samltwofactor') ) { $payload.Add('samltwofactor', $samltwofactor) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('requestedauthncontext') ) { $payload.Add('requestedauthncontext', $requestedauthncontext) }
            if ( $PSBoundParameters.ContainsKey('authnctxclassref') ) { $payload.Add('authnctxclassref', $authnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('customauthnctxclassref') ) { $payload.Add('customauthnctxclassref', $customauthnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('attributeconsumingserviceindex') ) { $payload.Add('attributeconsumingserviceindex', $attributeconsumingserviceindex) }
            if ( $PSBoundParameters.ContainsKey('sendthumbprint') ) { $payload.Add('sendthumbprint', $sendthumbprint) }
            if ( $PSBoundParameters.ContainsKey('enforceusername') ) { $payload.Add('enforceusername', $enforceusername) }
            if ( $PSBoundParameters.ContainsKey('logouturl') ) { $payload.Add('logouturl', $logouturl) }
            if ( $PSBoundParameters.ContainsKey('artifactresolutionserviceurl') ) { $payload.Add('artifactresolutionserviceurl', $artifactresolutionserviceurl) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('forceauthn') ) { $payload.Add('forceauthn', $forceauthn) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('storesamlresponse') ) { $payload.Add('storesamlresponse', $storesamlresponse) }
            if ( $PSBoundParameters.ContainsKey('statechecks') ) { $payload.Add('statechecks', $statechecks) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsamlaction -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-NSUnsetAuthenticationsamlaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsamlaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml action resource.
    .PARAMETER Name
        Name for the SAML server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationsamlaction -Name <string>
        An example how to delete authenticationsamlaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsamlaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction/
        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-NSDeleteAuthenticationsamlaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsamlaction -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-NSDeleteAuthenticationsamlaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationsamlaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml action resource.
    .PARAMETER Name
        Name for the SAML server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML profile is created.
    .PARAMETER Metadataurl
        This URL is used for obtaining saml metadata. Note that it fills samlIdPCertName and samlredirectUrl fields so those fields should not be updated when metadataUrl present.
    .PARAMETER Samlidpcertname
        Name of the SSL certificate used to verify responses from SAML Identity Provider (IdP). Note that if metadateURL is present then this filed should be empty.
    .PARAMETER Samlsigningcertname
        Name of the SSL certificate to sign requests from ServiceProvider (SP) to Identity Provider (IdP).
    .PARAMETER Samlredirecturl
        URL to which users are redirected for authentication. Note that if metadateURL is present then this filed should be empty.
    .PARAMETER Samlacsindex
        Index/ID of the metadata entry corresponding to this configuration.
         
         
        Maximum value = 255
    .PARAMETER Samluserfield
        SAML user ID, as given in the SAML assertion.
    .PARAMETER Samlrejectunsignedassertion
        Reject unsigned SAML assertions. ON option results in rejection of Assertion that is received without signature. STRICT option ensures that both Response and Assertion are signed. OFF allows unsigned Assertions.
         
        Possible values = ON, OFF, STRICT
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Samltwofactor
        Option to enable second factor after SAML.
         
        Possible values = ON, OFF
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute1. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute2
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute2. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute3
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute3. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute4
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute4. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute5
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute5. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute6
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute6. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute7
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute7. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute8
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute8. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute9
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute9. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute10
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute10. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute11
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute11. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute12
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute12. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute13
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute13. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute14
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute14. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute15
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute15. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute16
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute16. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Relaystaterule
        Boolean expression that will be evaluated to validate the SAML Response.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Requestedauthncontext
        This element specifies the authentication context requirements of authentication statements returned in the response.
         
        Possible values = exact, minimum, maximum, better
    .PARAMETER Authnctxclassref
        This element specifies the authentication class types that are requested from IdP (IdentityProvider).
        InternetProtocol: This is applicable when a principal is authenticated through the use of a provided IP address.
        InternetProtocolPassword: This is applicable when a principal is authenticated through the use of a provided IP address, in addition to a username/password.
        Kerberos: This is applicable when the principal has authenticated using a password to a local authentication authority, in order to acquire a Kerberos ticket.
        MobileOneFactorUnregistered: This indicates authentication of the mobile device without requiring explicit end-user interaction.
        MobileTwoFactorUnregistered: This indicates two-factor based authentication during mobile customer registration process, such as secure device and user PIN.
        MobileOneFactorContract: Reflects mobile contract customer registration procedures and a single factor authentication.
        MobileTwoFactorContract: Reflects mobile contract customer registration procedures and a two-factor based authentication.
        Password: This class is applicable when a principal authenticates using password over unprotected http session.
        PasswordProtectedTransport: This class is applicable when a principal authenticates to an authentication authority through the presentation of a password over a protected session.
        PreviousSession: This class is applicable when a principal had authenticated to an authentication authority at some point in the past using any authentication context.
        X509: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of an X.509 Public Key Infrastructure.
        PGP: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of a PGP Public Key Infrastructure.
        SPKI: This indicates that the principal authenticated by means of a digital signature where the key was validated via an SPKI Infrastructure.
        XMLDSig: This indicates that the principal authenticated by means of a digital signature according to the processing rules specified in the XML Digital Signature specification.
        Smartcard: This indicates that the principal has authenticated using smartcard.
        SmartcardPKI: This class is applicable when a principal authenticates to an authentication authority through a two-factor authentication mechanism using a smartcard with enclosed private key and a PIN.
        SoftwarePKI: This class is applicable when a principal uses an X.509 certificate stored in software to authenticate to the authentication authority.
        Telephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone number, transported via a telephony protocol such as ADSL.
        NomadTelephony: Indicates that the principal is "roaming" and authenticates via the means of the line number, a user suffix, and a password element.
        PersonalTelephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone.
        AuthenticatedTelephony: Indicates that the principal authenticated via the means of the line number, a user suffix, and a password element.
        SecureRemotePassword: This class is applicable when the authentication was performed by means of Secure Remote Password.
        TLSClient: This class indicates that the principal authenticated by means of a client certificate, secured with the SSL/TLS transport.
        TimeSyncToken: This is applicable when a principal authenticates through a time synchronization token.
        Unspecified: This indicates that the authentication was performed by unspecified means.
        Windows: This indicates that Windows integrated authentication is utilized for authentication.
        Possible values = InternetProtocol, InternetProtocolPassword, Kerberos, MobileOneFactorUnregistered, MobileTwoFactorUnregistered, MobileOneFactorContract, MobileTwoFactorContract, Password, PasswordProtectedTransport, PreviousSession, X509, PGP, SPKI, XMLDSig, Smartcard, SmartcardPKI, SoftwarePKI, Telephony, NomadTelephony, PersonalTelephony, AuthenticatedTelephony, SecureRemotePassword, TLSClient, TimeSyncToken, Unspecified, Windows
    .PARAMETER Customauthnctxclassref
        This element specifies the custom authentication class reference to be sent as a part of the Authentication Request that is sent by the SP to SAML IDP. The input string must be the body of the authentication class being requested.
        Input format: Alphanumeric string or URL specifying the body of the Request.If more than one string has to be provided, then the same can be done by specifying the classes as a string of comma separated values.
        Example input: set authentication samlaction samlact1 -customAuthnCtxClassRef http://www.class1.com/LoA1,http://www.class2.com/LoA2
        .
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Attributeconsumingserviceindex
        Index/ID of the attribute specification at Identity Provider (IdP). IdP will locate attributes requested by SP using this index and send those attributes in Assertion.
         
         
        Maximum value = 255
    .PARAMETER Sendthumbprint
        Option to send thumbprint instead of x509 certificate in SAML request.
         
        Possible values = ON, OFF
    .PARAMETER Enforceusername
        Option to choose whether the username that is extracted from SAML assertion can be edited in login page while doing second factor.
         
        Possible values = ON, OFF
    .PARAMETER Logouturl
        SingleLogout URL on IdP to which logoutRequest will be sent on Citrix ADC session cleanup.
    .PARAMETER Artifactresolutionserviceurl
        URL of the Artifact Resolution Service on IdP to which Citrix ADC will post artifact to get actual SAML token.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC ServiceProvider allows on an incoming assertion. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Forceauthn
        Option that forces authentication at the Identity Provider (IdP) that receives Citrix ADC's request.
         
        Possible values = ON, OFF
    .PARAMETER Groupnamefield
        Name of the tag in assertion that contains user groups.
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Metadatarefreshinterval
        Interval in minutes for fetching metadata from specified metadata URL.
    .PARAMETER Storesamlresponse
        Option to store entire SAML Response through the life of user session.
         
        Possible values = ON, OFF
    .PARAMETER Statechecks
        Boolean expression that will be evaluated to validate HTTP requests on SAML endpoints.
    .PARAMETER PassThru
        Return details about the created authenticationsamlaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsamlaction -name <string>
        An example how to update authenticationsamlaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsamlaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction/
        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]$Name,

        [string]$Metadataurl,

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

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

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

        [double]$Samlacsindex,

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

        [ValidateSet('ON', 'OFF', 'STRICT')]
        [string]$Samlrejectunsignedassertion,

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

        [ValidateSet('ON', 'OFF')]
        [string]$Samltwofactor,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [string]$Relaystaterule,

        [ValidateSet('RSA-SHA1', 'RSA-SHA256')]
        [string]$Signaturealg,

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

        [ValidateSet('exact', 'minimum', 'maximum', 'better')]
        [string]$Requestedauthncontext,

        [ValidateSet('InternetProtocol', 'InternetProtocolPassword', 'Kerberos', 'MobileOneFactorUnregistered', 'MobileTwoFactorUnregistered', 'MobileOneFactorContract', 'MobileTwoFactorContract', 'Password', 'PasswordProtectedTransport', 'PreviousSession', 'X509', 'PGP', 'SPKI', 'XMLDSig', 'Smartcard', 'SmartcardPKI', 'SoftwarePKI', 'Telephony', 'NomadTelephony', 'PersonalTelephony', 'AuthenticatedTelephony', 'SecureRemotePassword', 'TLSClient', 'TimeSyncToken', 'Unspecified', 'Windows')]
        [string[]]$Authnctxclassref,

        [string]$Customauthnctxclassref,

        [ValidateSet('REDIRECT', 'POST', 'ARTIFACT')]
        [string]$Samlbinding,

        [double]$Attributeconsumingserviceindex,

        [ValidateSet('ON', 'OFF')]
        [string]$Sendthumbprint,

        [ValidateSet('ON', 'OFF')]
        [string]$Enforceusername,

        [string]$Logouturl,

        [string]$Artifactresolutionserviceurl,

        [double]$Skewtime,

        [ValidateSet('REDIRECT', 'POST')]
        [string]$Logoutbinding,

        [ValidateSet('ON', 'OFF')]
        [string]$Forceauthn,

        [string]$Groupnamefield,

        [string]$Audience,

        [double]$Metadatarefreshinterval,

        [ValidateSet('ON', 'OFF')]
        [string]$Storesamlresponse,

        [string]$Statechecks,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('samlidpcertname') ) { $payload.Add('samlidpcertname', $samlidpcertname) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) }
            if ( $PSBoundParameters.ContainsKey('samlredirecturl') ) { $payload.Add('samlredirecturl', $samlredirecturl) }
            if ( $PSBoundParameters.ContainsKey('samlacsindex') ) { $payload.Add('samlacsindex', $samlacsindex) }
            if ( $PSBoundParameters.ContainsKey('samluserfield') ) { $payload.Add('samluserfield', $samluserfield) }
            if ( $PSBoundParameters.ContainsKey('samlrejectunsignedassertion') ) { $payload.Add('samlrejectunsignedassertion', $samlrejectunsignedassertion) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('samltwofactor') ) { $payload.Add('samltwofactor', $samltwofactor) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('requestedauthncontext') ) { $payload.Add('requestedauthncontext', $requestedauthncontext) }
            if ( $PSBoundParameters.ContainsKey('authnctxclassref') ) { $payload.Add('authnctxclassref', $authnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('customauthnctxclassref') ) { $payload.Add('customauthnctxclassref', $customauthnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('attributeconsumingserviceindex') ) { $payload.Add('attributeconsumingserviceindex', $attributeconsumingserviceindex) }
            if ( $PSBoundParameters.ContainsKey('sendthumbprint') ) { $payload.Add('sendthumbprint', $sendthumbprint) }
            if ( $PSBoundParameters.ContainsKey('enforceusername') ) { $payload.Add('enforceusername', $enforceusername) }
            if ( $PSBoundParameters.ContainsKey('logouturl') ) { $payload.Add('logouturl', $logouturl) }
            if ( $PSBoundParameters.ContainsKey('artifactresolutionserviceurl') ) { $payload.Add('artifactresolutionserviceurl', $artifactresolutionserviceurl) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('forceauthn') ) { $payload.Add('forceauthn', $forceauthn) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('storesamlresponse') ) { $payload.Add('storesamlresponse', $storesamlresponse) }
            if ( $PSBoundParameters.ContainsKey('statechecks') ) { $payload.Add('statechecks', $statechecks) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsamlaction -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-NSGetAuthenticationsamlaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlaction: Finished"
    }
}

function Invoke-NSAddAuthenticationsamlaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml action resource.
    .PARAMETER Name
        Name for the SAML server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML profile is created.
    .PARAMETER Metadataurl
        This URL is used for obtaining saml metadata. Note that it fills samlIdPCertName and samlredirectUrl fields so those fields should not be updated when metadataUrl present.
    .PARAMETER Samlidpcertname
        Name of the SSL certificate used to verify responses from SAML Identity Provider (IdP). Note that if metadateURL is present then this filed should be empty.
    .PARAMETER Samlsigningcertname
        Name of the SSL certificate to sign requests from ServiceProvider (SP) to Identity Provider (IdP).
    .PARAMETER Samlredirecturl
        URL to which users are redirected for authentication. Note that if metadateURL is present then this filed should be empty.
    .PARAMETER Samlacsindex
        Index/ID of the metadata entry corresponding to this configuration.
         
         
        Maximum value = 255
    .PARAMETER Samluserfield
        SAML user ID, as given in the SAML assertion.
    .PARAMETER Samlrejectunsignedassertion
        Reject unsigned SAML assertions. ON option results in rejection of Assertion that is received without signature. STRICT option ensures that both Response and Assertion are signed. OFF allows unsigned Assertions.
         
        Possible values = ON, OFF, STRICT
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Samltwofactor
        Option to enable second factor after SAML.
         
        Possible values = ON, OFF
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute1. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute2
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute2. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute3
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute3. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute4
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute4. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute5
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute5. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute6
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute6. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute7
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute7. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute8
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute8. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute9
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute9. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute10
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute10. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute11
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute11. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute12
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute12. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute13
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute13. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute14
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute14. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute15
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute15. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attribute16
        Name of the attribute in SAML Assertion whose value needs to be extracted and stored as attribute16. Maximum length of the extracted attribute is 239 bytes.
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be extracted.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER Relaystaterule
        Boolean expression that will be evaluated to validate the SAML Response.
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Requestedauthncontext
        This element specifies the authentication context requirements of authentication statements returned in the response.
         
        Possible values = exact, minimum, maximum, better
    .PARAMETER Authnctxclassref
        This element specifies the authentication class types that are requested from IdP (IdentityProvider).
        InternetProtocol: This is applicable when a principal is authenticated through the use of a provided IP address.
        InternetProtocolPassword: This is applicable when a principal is authenticated through the use of a provided IP address, in addition to a username/password.
        Kerberos: This is applicable when the principal has authenticated using a password to a local authentication authority, in order to acquire a Kerberos ticket.
        MobileOneFactorUnregistered: This indicates authentication of the mobile device without requiring explicit end-user interaction.
        MobileTwoFactorUnregistered: This indicates two-factor based authentication during mobile customer registration process, such as secure device and user PIN.
        MobileOneFactorContract: Reflects mobile contract customer registration procedures and a single factor authentication.
        MobileTwoFactorContract: Reflects mobile contract customer registration procedures and a two-factor based authentication.
        Password: This class is applicable when a principal authenticates using password over unprotected http session.
        PasswordProtectedTransport: This class is applicable when a principal authenticates to an authentication authority through the presentation of a password over a protected session.
        PreviousSession: This class is applicable when a principal had authenticated to an authentication authority at some point in the past using any authentication context.
        X509: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of an X.509 Public Key Infrastructure.
        PGP: This indicates that the principal authenticated by means of a digital signature where the key was validated as part of a PGP Public Key Infrastructure.
        SPKI: This indicates that the principal authenticated by means of a digital signature where the key was validated via an SPKI Infrastructure.
        XMLDSig: This indicates that the principal authenticated by means of a digital signature according to the processing rules specified in the XML Digital Signature specification.
        Smartcard: This indicates that the principal has authenticated using smartcard.
        SmartcardPKI: This class is applicable when a principal authenticates to an authentication authority through a two-factor authentication mechanism using a smartcard with enclosed private key and a PIN.
        SoftwarePKI: This class is applicable when a principal uses an X.509 certificate stored in software to authenticate to the authentication authority.
        Telephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone number, transported via a telephony protocol such as ADSL.
        NomadTelephony: Indicates that the principal is "roaming" and authenticates via the means of the line number, a user suffix, and a password element.
        PersonalTelephony: This class is used to indicate that the principal authenticated via the provision of a fixed-line telephone.
        AuthenticatedTelephony: Indicates that the principal authenticated via the means of the line number, a user suffix, and a password element.
        SecureRemotePassword: This class is applicable when the authentication was performed by means of Secure Remote Password.
        TLSClient: This class indicates that the principal authenticated by means of a client certificate, secured with the SSL/TLS transport.
        TimeSyncToken: This is applicable when a principal authenticates through a time synchronization token.
        Unspecified: This indicates that the authentication was performed by unspecified means.
        Windows: This indicates that Windows integrated authentication is utilized for authentication.
        Possible values = InternetProtocol, InternetProtocolPassword, Kerberos, MobileOneFactorUnregistered, MobileTwoFactorUnregistered, MobileOneFactorContract, MobileTwoFactorContract, Password, PasswordProtectedTransport, PreviousSession, X509, PGP, SPKI, XMLDSig, Smartcard, SmartcardPKI, SoftwarePKI, Telephony, NomadTelephony, PersonalTelephony, AuthenticatedTelephony, SecureRemotePassword, TLSClient, TimeSyncToken, Unspecified, Windows
    .PARAMETER Customauthnctxclassref
        This element specifies the custom authentication class reference to be sent as a part of the Authentication Request that is sent by the SP to SAML IDP. The input string must be the body of the authentication class being requested.
        Input format: Alphanumeric string or URL specifying the body of the Request.If more than one string has to be provided, then the same can be done by specifying the classes as a string of comma separated values.
        Example input: set authentication samlaction samlact1 -customAuthnCtxClassRef http://www.class1.com/LoA1,http://www.class2.com/LoA2
        .
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Attributeconsumingserviceindex
        Index/ID of the attribute specification at Identity Provider (IdP). IdP will locate attributes requested by SP using this index and send those attributes in Assertion.
         
         
        Maximum value = 255
    .PARAMETER Sendthumbprint
        Option to send thumbprint instead of x509 certificate in SAML request.
         
        Possible values = ON, OFF
    .PARAMETER Enforceusername
        Option to choose whether the username that is extracted from SAML assertion can be edited in login page while doing second factor.
         
        Possible values = ON, OFF
    .PARAMETER Logouturl
        SingleLogout URL on IdP to which logoutRequest will be sent on Citrix ADC session cleanup.
    .PARAMETER Artifactresolutionserviceurl
        URL of the Artifact Resolution Service on IdP to which Citrix ADC will post artifact to get actual SAML token.
    .PARAMETER Skewtime
        This option specifies the allowed clock skew in number of minutes that Citrix ADC ServiceProvider allows on an incoming assertion. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Forceauthn
        Option that forces authentication at the Identity Provider (IdP) that receives Citrix ADC's request.
         
        Possible values = ON, OFF
    .PARAMETER Groupnamefield
        Name of the tag in assertion that contains user groups.
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Metadatarefreshinterval
        Interval in minutes for fetching metadata from specified metadata URL.
    .PARAMETER Storesamlresponse
        Option to store entire SAML Response through the life of user session.
         
        Possible values = ON, OFF
    .PARAMETER Statechecks
        Boolean expression that will be evaluated to validate HTTP requests on SAML endpoints.
    .PARAMETER PassThru
        Return details about the created authenticationsamlaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsamlaction -name <string>
        An example how to add authenticationsamlaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsamlaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction/
        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]$Name,

        [string]$Metadataurl,

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

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

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

        [double]$Samlacsindex = '255',

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

        [ValidateSet('ON', 'OFF', 'STRICT')]
        [string]$Samlrejectunsignedassertion = 'ON',

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

        [ValidateSet('ON', 'OFF')]
        [string]$Samltwofactor = 'OFF',

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [string]$Relaystaterule,

        [ValidateSet('RSA-SHA1', 'RSA-SHA256')]
        [string]$Signaturealg = 'RSA-SHA256',

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

        [ValidateSet('exact', 'minimum', 'maximum', 'better')]
        [string]$Requestedauthncontext = 'exact',

        [ValidateSet('InternetProtocol', 'InternetProtocolPassword', 'Kerberos', 'MobileOneFactorUnregistered', 'MobileTwoFactorUnregistered', 'MobileOneFactorContract', 'MobileTwoFactorContract', 'Password', 'PasswordProtectedTransport', 'PreviousSession', 'X509', 'PGP', 'SPKI', 'XMLDSig', 'Smartcard', 'SmartcardPKI', 'SoftwarePKI', 'Telephony', 'NomadTelephony', 'PersonalTelephony', 'AuthenticatedTelephony', 'SecureRemotePassword', 'TLSClient', 'TimeSyncToken', 'Unspecified', 'Windows')]
        [string[]]$Authnctxclassref,

        [string]$Customauthnctxclassref,

        [ValidateSet('REDIRECT', 'POST', 'ARTIFACT')]
        [string]$Samlbinding = 'POST',

        [double]$Attributeconsumingserviceindex = '255',

        [ValidateSet('ON', 'OFF')]
        [string]$Sendthumbprint = 'OFF',

        [ValidateSet('ON', 'OFF')]
        [string]$Enforceusername = 'ON',

        [string]$Logouturl,

        [string]$Artifactresolutionserviceurl,

        [double]$Skewtime = '5',

        [ValidateSet('REDIRECT', 'POST')]
        [string]$Logoutbinding = 'POST',

        [ValidateSet('ON', 'OFF')]
        [string]$Forceauthn = 'OFF',

        [string]$Groupnamefield,

        [string]$Audience,

        [double]$Metadatarefreshinterval = '3600',

        [ValidateSet('ON', 'OFF')]
        [string]$Storesamlresponse = 'OFF',

        [string]$Statechecks,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsamlaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('samlidpcertname') ) { $payload.Add('samlidpcertname', $samlidpcertname) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) }
            if ( $PSBoundParameters.ContainsKey('samlredirecturl') ) { $payload.Add('samlredirecturl', $samlredirecturl) }
            if ( $PSBoundParameters.ContainsKey('samlacsindex') ) { $payload.Add('samlacsindex', $samlacsindex) }
            if ( $PSBoundParameters.ContainsKey('samluserfield') ) { $payload.Add('samluserfield', $samluserfield) }
            if ( $PSBoundParameters.ContainsKey('samlrejectunsignedassertion') ) { $payload.Add('samlrejectunsignedassertion', $samlrejectunsignedassertion) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('samltwofactor') ) { $payload.Add('samltwofactor', $samltwofactor) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('requestedauthncontext') ) { $payload.Add('requestedauthncontext', $requestedauthncontext) }
            if ( $PSBoundParameters.ContainsKey('authnctxclassref') ) { $payload.Add('authnctxclassref', $authnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('customauthnctxclassref') ) { $payload.Add('customauthnctxclassref', $customauthnctxclassref) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('attributeconsumingserviceindex') ) { $payload.Add('attributeconsumingserviceindex', $attributeconsumingserviceindex) }
            if ( $PSBoundParameters.ContainsKey('sendthumbprint') ) { $payload.Add('sendthumbprint', $sendthumbprint) }
            if ( $PSBoundParameters.ContainsKey('enforceusername') ) { $payload.Add('enforceusername', $enforceusername) }
            if ( $PSBoundParameters.ContainsKey('logouturl') ) { $payload.Add('logouturl', $logouturl) }
            if ( $PSBoundParameters.ContainsKey('artifactresolutionserviceurl') ) { $payload.Add('artifactresolutionserviceurl', $artifactresolutionserviceurl) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('forceauthn') ) { $payload.Add('forceauthn', $forceauthn) }
            if ( $PSBoundParameters.ContainsKey('groupnamefield') ) { $payload.Add('groupnamefield', $groupnamefield) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('storesamlresponse') ) { $payload.Add('storesamlresponse', $storesamlresponse) }
            if ( $PSBoundParameters.ContainsKey('statechecks') ) { $payload.Add('statechecks', $statechecks) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsamlaction -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-NSGetAuthenticationsamlaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsamlaction: Finished"
    }
}

function Invoke-NSGetAuthenticationsamlaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for AAA Saml action resource.
    .PARAMETER Name
        Name for the SAML server profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationsamlaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlaction 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-NSGetAuthenticationsamlaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlaction -GetAll
        Get all authenticationsamlaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlaction -Count
        Get the number of authenticationsamlaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlaction -name <string>
        Get authenticationsamlaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlaction -Filter @{ 'name'='<value>' }
        Get authenticationsamlaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationsamlaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsamlaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlaction -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 authenticationsamlaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlaction -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-NSGetAuthenticationsamlaction: Ended"
    }
}

function Invoke-NSAddAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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 which is evaluated to choose a profile for authentication.
         
        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 profile to apply to requests or connections that match this policy.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationsamlidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsamlidppolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationsamlidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Rule,

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsamlidppolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlidppolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsamlidppolicy -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-NSGetAuthenticationsamlidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsamlidppolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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-NSDeleteAuthenticationsamlidppolicy -Name <string>
        An example how to delete authenticationsamlidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy/
        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-NSDeleteAuthenticationsamlidppolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsamlidppolicy -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-NSDeleteAuthenticationsamlidppolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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 which is evaluated to choose a profile for authentication.
         
        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 profile to apply to requests or connections that match this policy.
    .PARAMETER Undefaction
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .PARAMETER PassThru
        Return details about the created authenticationsamlidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsamlidppolicy -name <string>
        An example how to update authenticationsamlidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy/
        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,

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

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

        [string]$Undefaction,

        [string]$Comment,

        [string]$Logaction,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlidppolicy: 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 ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlidppolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsamlidppolicy -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-NSGetAuthenticationsamlidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlidppolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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
        Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Only the above built-in actions can be used.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER Logaction
        Name of messagelog action to use when a request matches this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsamlidppolicy -name <string>
        An example how to unset authenticationsamlidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy
        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,

        [Boolean]$logaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsamlidppolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('undefaction') ) { $payload.Add('undefaction', $undefaction) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsamlidppolicy -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-NSUnsetAuthenticationsamlidppolicy: Finished"
    }
}

function Invoke-NSRenameAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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 Newname
        New name for the SAML IdentityProvider policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER PassThru
        Return details about the created authenticationsamlidppolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationsamlidppolicy -name <string> -newname <string>
        An example how to rename authenticationsamlidppolicy config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy/
        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)]
        [ValidateScript({ $_.Length -gt 1 })]
        [string]$Newname,

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

            if ( $PSCmdlet.ShouldProcess("authenticationsamlidppolicy", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsamlidppolicy -Action rename -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-NSGetAuthenticationsamlidppolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationsamlidppolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationsamlidppolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) policy resource.
    .PARAMETER Name
        Name for the SAML Identity Provider (IdP) authentication policy. This is used for configuring Citrix ADC as SAML Identity Provider. 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 authenticationsamlidppolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlidppolicy 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-NSGetAuthenticationsamlidppolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicy -GetAll
        Get all authenticationsamlidppolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicy -Count
        Get the number of authenticationsamlidppolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicy -name <string>
        Get authenticationsamlidppolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicy -Filter @{ 'name'='<value>' }
        Get authenticationsamlidppolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlidppolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy/
        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-NSGetAuthenticationsamlidppolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsamlidppolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy -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 authenticationsamlidppolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlidppolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy -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-NSGetAuthenticationsamlidppolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationsamlidppolicy.
    .PARAMETER Name
        Name of the SAML IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationsamlidppolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlidppolicy_authenticationvserver_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-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding -GetAll
        Get all authenticationsamlidppolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding -Count
        Get the number of authenticationsamlidppolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding -name <string>
        Get authenticationsamlidppolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlidppolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_authenticationvserver_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-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlidppolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_authenticationvserver_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 authenticationsamlidppolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlidppolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_authenticationvserver_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-NSGetAuthenticationsamlidppolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlidppolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationsamlidppolicy.
    .PARAMETER Name
        Name of the SAML IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationsamlidppolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlidppolicy_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-NSGetAuthenticationsamlidppolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyBinding -GetAll
        Get all authenticationsamlidppolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyBinding -name <string>
        Get authenticationsamlidppolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlidppolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_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-NSGetAuthenticationsamlidppolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_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 authenticationsamlidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlidppolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_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-NSGetAuthenticationsamlidppolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationsamlidppolicy.
    .PARAMETER Name
        Name of the SAML IdentityProvider (IdP) policy for which to display detailed information.
    .PARAMETER GetAll
        Retrieve all authenticationsamlidppolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlidppolicy_vpnvserver_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-NSGetAuthenticationsamlidppolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding -GetAll
        Get all authenticationsamlidppolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding -Count
        Get the number of authenticationsamlidppolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding -name <string>
        Get authenticationsamlidppolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlidppolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlidppolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_vpnvserver_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-NSGetAuthenticationsamlidppolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlidppolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_vpnvserver_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 authenticationsamlidppolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlidppolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlidppolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidppolicy_vpnvserver_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-NSGetAuthenticationsamlidppolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationsamlidpprofile {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) profile resource.
    .PARAMETER Name
        Name for the new saml single sign-on 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 an action is created.
    .PARAMETER Samlspcertname
        Name of the SSL certificate of SAML Relying Party. This certificate is used to verify signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Samlidpcertname
        Name of the certificate used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Assertionconsumerserviceurl
        URL to which the assertion is to be sent.
    .PARAMETER Sendpassword
        Option to send password in assertion.
         
        Possible values = ON, OFF
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Rejectunsignedrequests
        Option to Reject unsigned SAML Requests. ON option denies any authentication requests that arrive without signature.
         
        Possible values = ON, OFF
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Nameidformat
        Format of Name Identifier sent in Assertion.
         
        Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient
    .PARAMETER Nameidexpr
        Expression that will be evaluated to obtain NameIdentifier to be sent in assertion.
    .PARAMETER Attribute1
        Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1expr
        Expression that will be evaluated to obtain attribute1's value to be sent in Assertion.
    .PARAMETER Attribute1friendlyname
        User-Friendly Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1format
        Format of Attribute1 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute2
        Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2expr
        Expression that will be evaluated to obtain attribute2's value to be sent in Assertion.
    .PARAMETER Attribute2friendlyname
        User-Friendly Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2format
        Format of Attribute2 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute3
        Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3expr
        Expression that will be evaluated to obtain attribute3's value to be sent in Assertion.
    .PARAMETER Attribute3friendlyname
        User-Friendly Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3format
        Format of Attribute3 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute4
        Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4expr
        Expression that will be evaluated to obtain attribute4's value to be sent in Assertion.
    .PARAMETER Attribute4friendlyname
        User-Friendly Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4format
        Format of Attribute4 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute5
        Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5expr
        Expression that will be evaluated to obtain attribute5's value to be sent in Assertion.
    .PARAMETER Attribute5friendlyname
        User-Friendly Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5format
        Format of Attribute5 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute6
        Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6expr
        Expression that will be evaluated to obtain attribute6's value to be sent in Assertion.
    .PARAMETER Attribute6friendlyname
        User-Friendly Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6format
        Format of Attribute6 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute7
        Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7expr
        Expression that will be evaluated to obtain attribute7's value to be sent in Assertion.
    .PARAMETER Attribute7friendlyname
        User-Friendly Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7format
        Format of Attribute7 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute8
        Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8expr
        Expression that will be evaluated to obtain attribute8's value to be sent in Assertion.
    .PARAMETER Attribute8friendlyname
        User-Friendly Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8format
        Format of Attribute8 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute9
        Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9expr
        Expression that will be evaluated to obtain attribute9's value to be sent in Assertion.
    .PARAMETER Attribute9friendlyname
        User-Friendly Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9format
        Format of Attribute9 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute10
        Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10expr
        Expression that will be evaluated to obtain attribute10's value to be sent in Assertion.
    .PARAMETER Attribute10friendlyname
        User-Friendly Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10format
        Format of Attribute10 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute11
        Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11expr
        Expression that will be evaluated to obtain attribute11's value to be sent in Assertion.
    .PARAMETER Attribute11friendlyname
        User-Friendly Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11format
        Format of Attribute11 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute12
        Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12expr
        Expression that will be evaluated to obtain attribute12's value to be sent in Assertion.
    .PARAMETER Attribute12friendlyname
        User-Friendly Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12format
        Format of Attribute12 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute13
        Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13expr
        Expression that will be evaluated to obtain attribute13's value to be sent in Assertion.
    .PARAMETER Attribute13friendlyname
        User-Friendly Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13format
        Format of Attribute13 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute14
        Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14expr
        Expression that will be evaluated to obtain attribute14's value to be sent in Assertion.
    .PARAMETER Attribute14friendlyname
        User-Friendly Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14format
        Format of Attribute14 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute15
        Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15expr
        Expression that will be evaluated to obtain attribute15's value to be sent in Assertion.
    .PARAMETER Attribute15friendlyname
        User-Friendly Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15format
        Format of Attribute15 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute16
        Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16expr
        Expression that will be evaluated to obtain attribute16's value to be sent in Assertion.
    .PARAMETER Attribute16friendlyname
        User-Friendly Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16format
        Format of Attribute16 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Encryptassertion
        Option to encrypt assertion when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Encryptionalgorithm
        Algorithm to be used to encrypt SAML assertion.
         
        Possible values = DES3, AES128, AES192, AES256
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Skewtime
        This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Serviceproviderid
        Unique identifier of the Service Provider that sends SAML Request. Citrix ADC will ensure that the Issuer of the SAML Request matches this URI. In case of SP initiated sign-in scenarios, this value must be same as samlIssuerName configured in samlAction.
    .PARAMETER Signassertion
        Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed.
         
        Possible values = NONE, ASSERTION, RESPONSE, BOTH
    .PARAMETER Keytransportalg
        Key transport algorithm to be used in encryption of SAML assertion.
         
        Possible values = RSA-V1_5, RSA_OAEP
    .PARAMETER Splogouturl
        Endpoint on the ServiceProvider (SP) to which logout messages are to be sent.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Metadataurl
        This URL is used for obtaining samlidp metadata.
    .PARAMETER Metadatarefreshinterval
        Interval in minute for fetching metadata from specified metadata URL.
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data.
    .PARAMETER Samlsigningcertversion
        version of the certificate in signature service used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Samlspcertversion
        version of the certificate in signature service used to verify the signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Acsurlrule
        Expression that will be evaluated to allow Assertion Consumer Service URI coming in the SAML Request.
    .PARAMETER PassThru
        Return details about the created authenticationsamlidpprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsamlidpprofile -name <string>
        An example how to add authenticationsamlidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsamlidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile/
        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,

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

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

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

        [ValidateSet('ON', 'OFF')]
        [string]$Sendpassword = 'OFF',

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

        [ValidateSet('ON', 'OFF')]
        [string]$Rejectunsignedrequests = 'ON',

        [ValidateSet('RSA-SHA1', 'RSA-SHA256')]
        [string]$Signaturealg = 'RSA-SHA256',

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

        [string]$Audience,

        [ValidateSet('Unspecified', 'emailAddress', 'X509SubjectName', 'WindowsDomainQualifiedName', 'kerberos', 'entity', 'persistent', 'transient')]
        [string]$Nameidformat = 'transient',

        [string]$Nameidexpr,

        [string]$Attribute1,

        [string]$Attribute1expr,

        [string]$Attribute1friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute1format,

        [string]$Attribute2,

        [string]$Attribute2expr,

        [string]$Attribute2friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute2format,

        [string]$Attribute3,

        [string]$Attribute3expr,

        [string]$Attribute3friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute3format,

        [string]$Attribute4,

        [string]$Attribute4expr,

        [string]$Attribute4friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute4format,

        [string]$Attribute5,

        [string]$Attribute5expr,

        [string]$Attribute5friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute5format,

        [string]$Attribute6,

        [string]$Attribute6expr,

        [string]$Attribute6friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute6format,

        [string]$Attribute7,

        [string]$Attribute7expr,

        [string]$Attribute7friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute7format,

        [string]$Attribute8,

        [string]$Attribute8expr,

        [string]$Attribute8friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute8format,

        [string]$Attribute9,

        [string]$Attribute9expr,

        [string]$Attribute9friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute9format,

        [string]$Attribute10,

        [string]$Attribute10expr,

        [string]$Attribute10friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute10format,

        [string]$Attribute11,

        [string]$Attribute11expr,

        [string]$Attribute11friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute11format,

        [string]$Attribute12,

        [string]$Attribute12expr,

        [string]$Attribute12friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute12format,

        [string]$Attribute13,

        [string]$Attribute13expr,

        [string]$Attribute13friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute13format,

        [string]$Attribute14,

        [string]$Attribute14expr,

        [string]$Attribute14friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute14format,

        [string]$Attribute15,

        [string]$Attribute15expr,

        [string]$Attribute15friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute15format,

        [string]$Attribute16,

        [string]$Attribute16expr,

        [string]$Attribute16friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute16format,

        [ValidateSet('ON', 'OFF')]
        [string]$Encryptassertion = 'OFF',

        [ValidateSet('DES3', 'AES128', 'AES192', 'AES256')]
        [string]$Encryptionalgorithm = 'AES256',

        [ValidateSet('REDIRECT', 'POST', 'ARTIFACT')]
        [string]$Samlbinding = 'POST',

        [double]$Skewtime = '5',

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

        [ValidateSet('NONE', 'ASSERTION', 'RESPONSE', 'BOTH')]
        [string]$Signassertion = 'ASSERTION',

        [ValidateSet('RSA-V1_5', 'RSA_OAEP')]
        [string]$Keytransportalg = 'RSA_OAEP',

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

        [ValidateSet('REDIRECT', 'POST')]
        [string]$Logoutbinding = 'POST',

        [string]$Defaultauthenticationgroup,

        [string]$Metadataurl,

        [double]$Metadatarefreshinterval = '3600',

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

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

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

        [string]$Acsurlrule,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsamlidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) }
            if ( $PSBoundParameters.ContainsKey('samlidpcertname') ) { $payload.Add('samlidpcertname', $samlidpcertname) }
            if ( $PSBoundParameters.ContainsKey('assertionconsumerserviceurl') ) { $payload.Add('assertionconsumerserviceurl', $assertionconsumerserviceurl) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('rejectunsignedrequests') ) { $payload.Add('rejectunsignedrequests', $rejectunsignedrequests) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) }
            if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute1expr') ) { $payload.Add('attribute1expr', $attribute1expr) }
            if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute2expr') ) { $payload.Add('attribute2expr', $attribute2expr) }
            if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute3expr') ) { $payload.Add('attribute3expr', $attribute3expr) }
            if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute4expr') ) { $payload.Add('attribute4expr', $attribute4expr) }
            if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute5expr') ) { $payload.Add('attribute5expr', $attribute5expr) }
            if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute6expr') ) { $payload.Add('attribute6expr', $attribute6expr) }
            if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute7expr') ) { $payload.Add('attribute7expr', $attribute7expr) }
            if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute8expr') ) { $payload.Add('attribute8expr', $attribute8expr) }
            if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute9expr') ) { $payload.Add('attribute9expr', $attribute9expr) }
            if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute10expr') ) { $payload.Add('attribute10expr', $attribute10expr) }
            if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute11expr') ) { $payload.Add('attribute11expr', $attribute11expr) }
            if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute12expr') ) { $payload.Add('attribute12expr', $attribute12expr) }
            if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute13expr') ) { $payload.Add('attribute13expr', $attribute13expr) }
            if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute14expr') ) { $payload.Add('attribute14expr', $attribute14expr) }
            if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute15expr') ) { $payload.Add('attribute15expr', $attribute15expr) }
            if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attribute16expr') ) { $payload.Add('attribute16expr', $attribute16expr) }
            if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) }
            if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) }
            if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('serviceproviderid') ) { $payload.Add('serviceproviderid', $serviceproviderid) }
            if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) }
            if ( $PSBoundParameters.ContainsKey('keytransportalg') ) { $payload.Add('keytransportalg', $keytransportalg) }
            if ( $PSBoundParameters.ContainsKey('splogouturl') ) { $payload.Add('splogouturl', $splogouturl) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertversion') ) { $payload.Add('samlsigningcertversion', $samlsigningcertversion) }
            if ( $PSBoundParameters.ContainsKey('samlspcertversion') ) { $payload.Add('samlspcertversion', $samlspcertversion) }
            if ( $PSBoundParameters.ContainsKey('acsurlrule') ) { $payload.Add('acsurlrule', $acsurlrule) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlidpprofile", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsamlidpprofile -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-NSGetAuthenticationsamlidpprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsamlidpprofile: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsamlidpprofile {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) profile resource.
    .PARAMETER Name
        Name for the new saml single sign-on 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 an action is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationsamlidpprofile -Name <string>
        An example how to delete authenticationsamlidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsamlidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile/
        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-NSDeleteAuthenticationsamlidpprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsamlidpprofile -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-NSDeleteAuthenticationsamlidpprofile: Finished"
    }
}

function Invoke-NSUpdateAuthenticationsamlidpprofile {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) profile resource.
    .PARAMETER Name
        Name for the new saml single sign-on 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 an action is created.
    .PARAMETER Samlspcertname
        Name of the SSL certificate of SAML Relying Party. This certificate is used to verify signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Samlidpcertname
        Name of the certificate used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Assertionconsumerserviceurl
        URL to which the assertion is to be sent.
    .PARAMETER Sendpassword
        Option to send password in assertion.
         
        Possible values = ON, OFF
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Rejectunsignedrequests
        Option to Reject unsigned SAML Requests. ON option denies any authentication requests that arrive without signature.
         
        Possible values = ON, OFF
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Nameidformat
        Format of Name Identifier sent in Assertion.
         
        Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient
    .PARAMETER Nameidexpr
        Expression that will be evaluated to obtain NameIdentifier to be sent in assertion.
    .PARAMETER Attribute1
        Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1expr
        Expression that will be evaluated to obtain attribute1's value to be sent in Assertion.
    .PARAMETER Attribute1friendlyname
        User-Friendly Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1format
        Format of Attribute1 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute2
        Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2expr
        Expression that will be evaluated to obtain attribute2's value to be sent in Assertion.
    .PARAMETER Attribute2friendlyname
        User-Friendly Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2format
        Format of Attribute2 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute3
        Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3expr
        Expression that will be evaluated to obtain attribute3's value to be sent in Assertion.
    .PARAMETER Attribute3friendlyname
        User-Friendly Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3format
        Format of Attribute3 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute4
        Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4expr
        Expression that will be evaluated to obtain attribute4's value to be sent in Assertion.
    .PARAMETER Attribute4friendlyname
        User-Friendly Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4format
        Format of Attribute4 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute5
        Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5expr
        Expression that will be evaluated to obtain attribute5's value to be sent in Assertion.
    .PARAMETER Attribute5friendlyname
        User-Friendly Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5format
        Format of Attribute5 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute6
        Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6expr
        Expression that will be evaluated to obtain attribute6's value to be sent in Assertion.
    .PARAMETER Attribute6friendlyname
        User-Friendly Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6format
        Format of Attribute6 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute7
        Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7expr
        Expression that will be evaluated to obtain attribute7's value to be sent in Assertion.
    .PARAMETER Attribute7friendlyname
        User-Friendly Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7format
        Format of Attribute7 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute8
        Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8expr
        Expression that will be evaluated to obtain attribute8's value to be sent in Assertion.
    .PARAMETER Attribute8friendlyname
        User-Friendly Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8format
        Format of Attribute8 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute9
        Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9expr
        Expression that will be evaluated to obtain attribute9's value to be sent in Assertion.
    .PARAMETER Attribute9friendlyname
        User-Friendly Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9format
        Format of Attribute9 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute10
        Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10expr
        Expression that will be evaluated to obtain attribute10's value to be sent in Assertion.
    .PARAMETER Attribute10friendlyname
        User-Friendly Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10format
        Format of Attribute10 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute11
        Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11expr
        Expression that will be evaluated to obtain attribute11's value to be sent in Assertion.
    .PARAMETER Attribute11friendlyname
        User-Friendly Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11format
        Format of Attribute11 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute12
        Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12expr
        Expression that will be evaluated to obtain attribute12's value to be sent in Assertion.
    .PARAMETER Attribute12friendlyname
        User-Friendly Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12format
        Format of Attribute12 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute13
        Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13expr
        Expression that will be evaluated to obtain attribute13's value to be sent in Assertion.
    .PARAMETER Attribute13friendlyname
        User-Friendly Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13format
        Format of Attribute13 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute14
        Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14expr
        Expression that will be evaluated to obtain attribute14's value to be sent in Assertion.
    .PARAMETER Attribute14friendlyname
        User-Friendly Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14format
        Format of Attribute14 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute15
        Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15expr
        Expression that will be evaluated to obtain attribute15's value to be sent in Assertion.
    .PARAMETER Attribute15friendlyname
        User-Friendly Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15format
        Format of Attribute15 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute16
        Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16expr
        Expression that will be evaluated to obtain attribute16's value to be sent in Assertion.
    .PARAMETER Attribute16friendlyname
        User-Friendly Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16format
        Format of Attribute16 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Encryptassertion
        Option to encrypt assertion when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Encryptionalgorithm
        Algorithm to be used to encrypt SAML assertion.
         
        Possible values = DES3, AES128, AES192, AES256
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Skewtime
        This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Serviceproviderid
        Unique identifier of the Service Provider that sends SAML Request. Citrix ADC will ensure that the Issuer of the SAML Request matches this URI. In case of SP initiated sign-in scenarios, this value must be same as samlIssuerName configured in samlAction.
    .PARAMETER Signassertion
        Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed.
         
        Possible values = NONE, ASSERTION, RESPONSE, BOTH
    .PARAMETER Keytransportalg
        Key transport algorithm to be used in encryption of SAML assertion.
         
        Possible values = RSA-V1_5, RSA_OAEP
    .PARAMETER Splogouturl
        Endpoint on the ServiceProvider (SP) to which logout messages are to be sent.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Metadataurl
        This URL is used for obtaining samlidp metadata.
    .PARAMETER Metadatarefreshinterval
        Interval in minute for fetching metadata from specified metadata URL.
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data.
    .PARAMETER Samlsigningcertversion
        version of the certificate in signature service used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Samlspcertversion
        version of the certificate in signature service used to verify the signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Acsurlrule
        Expression that will be evaluated to allow Assertion Consumer Service URI coming in the SAML Request.
    .PARAMETER PassThru
        Return details about the created authenticationsamlidpprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsamlidpprofile -name <string>
        An example how to update authenticationsamlidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsamlidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile/
        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,

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

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

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

        [ValidateSet('ON', 'OFF')]
        [string]$Sendpassword,

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

        [ValidateSet('ON', 'OFF')]
        [string]$Rejectunsignedrequests,

        [ValidateSet('RSA-SHA1', 'RSA-SHA256')]
        [string]$Signaturealg,

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

        [string]$Audience,

        [ValidateSet('Unspecified', 'emailAddress', 'X509SubjectName', 'WindowsDomainQualifiedName', 'kerberos', 'entity', 'persistent', 'transient')]
        [string]$Nameidformat,

        [string]$Nameidexpr,

        [string]$Attribute1,

        [string]$Attribute1expr,

        [string]$Attribute1friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute1format,

        [string]$Attribute2,

        [string]$Attribute2expr,

        [string]$Attribute2friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute2format,

        [string]$Attribute3,

        [string]$Attribute3expr,

        [string]$Attribute3friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute3format,

        [string]$Attribute4,

        [string]$Attribute4expr,

        [string]$Attribute4friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute4format,

        [string]$Attribute5,

        [string]$Attribute5expr,

        [string]$Attribute5friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute5format,

        [string]$Attribute6,

        [string]$Attribute6expr,

        [string]$Attribute6friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute6format,

        [string]$Attribute7,

        [string]$Attribute7expr,

        [string]$Attribute7friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute7format,

        [string]$Attribute8,

        [string]$Attribute8expr,

        [string]$Attribute8friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute8format,

        [string]$Attribute9,

        [string]$Attribute9expr,

        [string]$Attribute9friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute9format,

        [string]$Attribute10,

        [string]$Attribute10expr,

        [string]$Attribute10friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute10format,

        [string]$Attribute11,

        [string]$Attribute11expr,

        [string]$Attribute11friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute11format,

        [string]$Attribute12,

        [string]$Attribute12expr,

        [string]$Attribute12friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute12format,

        [string]$Attribute13,

        [string]$Attribute13expr,

        [string]$Attribute13friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute13format,

        [string]$Attribute14,

        [string]$Attribute14expr,

        [string]$Attribute14friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute14format,

        [string]$Attribute15,

        [string]$Attribute15expr,

        [string]$Attribute15friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute15format,

        [string]$Attribute16,

        [string]$Attribute16expr,

        [string]$Attribute16friendlyname,

        [ValidateSet('URI', 'Basic')]
        [string]$Attribute16format,

        [ValidateSet('ON', 'OFF')]
        [string]$Encryptassertion,

        [ValidateSet('DES3', 'AES128', 'AES192', 'AES256')]
        [string]$Encryptionalgorithm,

        [ValidateSet('REDIRECT', 'POST', 'ARTIFACT')]
        [string]$Samlbinding,

        [double]$Skewtime,

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

        [ValidateSet('NONE', 'ASSERTION', 'RESPONSE', 'BOTH')]
        [string]$Signassertion,

        [ValidateSet('RSA-V1_5', 'RSA_OAEP')]
        [string]$Keytransportalg,

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

        [ValidateSet('REDIRECT', 'POST')]
        [string]$Logoutbinding,

        [string]$Defaultauthenticationgroup,

        [string]$Metadataurl,

        [double]$Metadatarefreshinterval,

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

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

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

        [string]$Acsurlrule,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) }
            if ( $PSBoundParameters.ContainsKey('samlidpcertname') ) { $payload.Add('samlidpcertname', $samlidpcertname) }
            if ( $PSBoundParameters.ContainsKey('assertionconsumerserviceurl') ) { $payload.Add('assertionconsumerserviceurl', $assertionconsumerserviceurl) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('rejectunsignedrequests') ) { $payload.Add('rejectunsignedrequests', $rejectunsignedrequests) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) }
            if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute1expr') ) { $payload.Add('attribute1expr', $attribute1expr) }
            if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute2expr') ) { $payload.Add('attribute2expr', $attribute2expr) }
            if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute3expr') ) { $payload.Add('attribute3expr', $attribute3expr) }
            if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute4expr') ) { $payload.Add('attribute4expr', $attribute4expr) }
            if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute5expr') ) { $payload.Add('attribute5expr', $attribute5expr) }
            if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute6expr') ) { $payload.Add('attribute6expr', $attribute6expr) }
            if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute7expr') ) { $payload.Add('attribute7expr', $attribute7expr) }
            if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute8expr') ) { $payload.Add('attribute8expr', $attribute8expr) }
            if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute9expr') ) { $payload.Add('attribute9expr', $attribute9expr) }
            if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute10expr') ) { $payload.Add('attribute10expr', $attribute10expr) }
            if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute11expr') ) { $payload.Add('attribute11expr', $attribute11expr) }
            if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute12expr') ) { $payload.Add('attribute12expr', $attribute12expr) }
            if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute13expr') ) { $payload.Add('attribute13expr', $attribute13expr) }
            if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute14expr') ) { $payload.Add('attribute14expr', $attribute14expr) }
            if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute15expr') ) { $payload.Add('attribute15expr', $attribute15expr) }
            if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attribute16expr') ) { $payload.Add('attribute16expr', $attribute16expr) }
            if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) }
            if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) }
            if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('serviceproviderid') ) { $payload.Add('serviceproviderid', $serviceproviderid) }
            if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) }
            if ( $PSBoundParameters.ContainsKey('keytransportalg') ) { $payload.Add('keytransportalg', $keytransportalg) }
            if ( $PSBoundParameters.ContainsKey('splogouturl') ) { $payload.Add('splogouturl', $splogouturl) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertversion') ) { $payload.Add('samlsigningcertversion', $samlsigningcertversion) }
            if ( $PSBoundParameters.ContainsKey('samlspcertversion') ) { $payload.Add('samlspcertversion', $samlspcertversion) }
            if ( $PSBoundParameters.ContainsKey('acsurlrule') ) { $payload.Add('acsurlrule', $acsurlrule) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlidpprofile", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsamlidpprofile -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-NSGetAuthenticationsamlidpprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlidpprofile: Finished"
    }
}

function Invoke-NSUnsetAuthenticationsamlidpprofile {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) profile resource.
    .PARAMETER Name
        Name for the new saml single sign-on 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 an action is created.
    .PARAMETER Samlspcertname
        Name of the SSL certificate of SAML Relying Party. This certificate is used to verify signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Samlidpcertname
        Name of the certificate used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Assertionconsumerserviceurl
        URL to which the assertion is to be sent.
    .PARAMETER Sendpassword
        Option to send password in assertion.
         
        Possible values = ON, OFF
    .PARAMETER Samlissuername
        The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC.
    .PARAMETER Rejectunsignedrequests
        Option to Reject unsigned SAML Requests. ON option denies any authentication requests that arrive without signature.
         
        Possible values = ON, OFF
    .PARAMETER Signaturealg
        Algorithm to be used to sign/verify SAML transactions.
         
        Possible values = RSA-SHA1, RSA-SHA256
    .PARAMETER Digestmethod
        Algorithm to be used to compute/verify digest for SAML transactions.
         
        Possible values = SHA1, SHA256
    .PARAMETER Audience
        Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider.
    .PARAMETER Nameidformat
        Format of Name Identifier sent in Assertion.
         
        Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient
    .PARAMETER Nameidexpr
        Expression that will be evaluated to obtain NameIdentifier to be sent in assertion.
    .PARAMETER Attribute1
        Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1friendlyname
        User-Friendly Name of attribute1 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute1format
        Format of Attribute1 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute2
        Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2friendlyname
        User-Friendly Name of attribute2 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute2format
        Format of Attribute2 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute3
        Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3friendlyname
        User-Friendly Name of attribute3 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute3format
        Format of Attribute3 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute4
        Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4friendlyname
        User-Friendly Name of attribute4 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute4format
        Format of Attribute4 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute5
        Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5friendlyname
        User-Friendly Name of attribute5 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute5format
        Format of Attribute5 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute6
        Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6friendlyname
        User-Friendly Name of attribute6 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute6format
        Format of Attribute6 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute7
        Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7friendlyname
        User-Friendly Name of attribute7 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute7format
        Format of Attribute7 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute8
        Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8friendlyname
        User-Friendly Name of attribute8 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute8format
        Format of Attribute8 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute9
        Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9friendlyname
        User-Friendly Name of attribute9 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute9format
        Format of Attribute9 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute10
        Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10friendlyname
        User-Friendly Name of attribute10 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute10format
        Format of Attribute10 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute11
        Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11friendlyname
        User-Friendly Name of attribute11 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute11format
        Format of Attribute11 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute12
        Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12friendlyname
        User-Friendly Name of attribute12 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute12format
        Format of Attribute12 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute13
        Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13friendlyname
        User-Friendly Name of attribute13 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute13format
        Format of Attribute13 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute14
        Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14friendlyname
        User-Friendly Name of attribute14 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute14format
        Format of Attribute14 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute15
        Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15friendlyname
        User-Friendly Name of attribute15 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute15format
        Format of Attribute15 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Attribute16
        Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16friendlyname
        User-Friendly Name of attribute16 that needs to be sent in SAML Assertion.
    .PARAMETER Attribute16format
        Format of Attribute16 to be sent in Assertion.
        Possible values = URI, Basic
    .PARAMETER Encryptassertion
        Option to encrypt assertion when Citrix ADC IDP sends one.
         
        Possible values = ON, OFF
    .PARAMETER Encryptionalgorithm
        Algorithm to be used to encrypt SAML assertion.
         
        Possible values = DES3, AES128, AES192, AES256
    .PARAMETER Samlbinding
        This element specifies the transport mechanism of saml messages.
         
        Possible values = REDIRECT, POST, ARTIFACT
    .PARAMETER Skewtime
        This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all.
    .PARAMETER Serviceproviderid
        Unique identifier of the Service Provider that sends SAML Request. Citrix ADC will ensure that the Issuer of the SAML Request matches this URI. In case of SP initiated sign-in scenarios, this value must be same as samlIssuerName configured in samlAction.
    .PARAMETER Signassertion
        Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed.
         
        Possible values = NONE, ASSERTION, RESPONSE, BOTH
    .PARAMETER Keytransportalg
        Key transport algorithm to be used in encryption of SAML assertion.
         
        Possible values = RSA-V1_5, RSA_OAEP
    .PARAMETER Splogouturl
        Endpoint on the ServiceProvider (SP) to which logout messages are to be sent.
    .PARAMETER Logoutbinding
        This element specifies the transport mechanism of saml logout messages.
         
        Possible values = REDIRECT, POST
    .PARAMETER Defaultauthenticationgroup
        This group will be part of AAA session's internal group list. This will be helpful to admin in Nfactor flow to decide right AAA configuration for Relaying Party. In authentication policy AAA.USER.IS_MEMBER_OF("&lt;default_auth_group&gt;") is way to use this feature.
    .PARAMETER Metadataurl
        This URL is used for obtaining samlidp metadata.
    .PARAMETER Metadatarefreshinterval
        Interval in minute for fetching metadata from specified metadata URL.
    .PARAMETER Signatureservice
        Name of the service in cloud used to sign the data.
    .PARAMETER Samlsigningcertversion
        version of the certificate in signature service used to sign the SAMLResposne that is sent to Relying Party or Service Provider after successful authentication.
    .PARAMETER Samlspcertversion
        version of the certificate in signature service used to verify the signature of the incoming AuthnRequest from a Relying Party or Service Provider.
    .PARAMETER Acsurlrule
        Expression that will be evaluated to allow Assertion Consumer Service URI coming in the SAML Request.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsamlidpprofile -name <string>
        An example how to unset authenticationsamlidpprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsamlidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile
        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]$samlspcertname,

        [Boolean]$samlidpcertname,

        [Boolean]$assertionconsumerserviceurl,

        [Boolean]$sendpassword,

        [Boolean]$samlissuername,

        [Boolean]$rejectunsignedrequests,

        [Boolean]$signaturealg,

        [Boolean]$digestmethod,

        [Boolean]$audience,

        [Boolean]$nameidformat,

        [Boolean]$nameidexpr,

        [Boolean]$attribute1,

        [Boolean]$attribute1friendlyname,

        [Boolean]$attribute1format,

        [Boolean]$attribute2,

        [Boolean]$attribute2friendlyname,

        [Boolean]$attribute2format,

        [Boolean]$attribute3,

        [Boolean]$attribute3friendlyname,

        [Boolean]$attribute3format,

        [Boolean]$attribute4,

        [Boolean]$attribute4friendlyname,

        [Boolean]$attribute4format,

        [Boolean]$attribute5,

        [Boolean]$attribute5friendlyname,

        [Boolean]$attribute5format,

        [Boolean]$attribute6,

        [Boolean]$attribute6friendlyname,

        [Boolean]$attribute6format,

        [Boolean]$attribute7,

        [Boolean]$attribute7friendlyname,

        [Boolean]$attribute7format,

        [Boolean]$attribute8,

        [Boolean]$attribute8friendlyname,

        [Boolean]$attribute8format,

        [Boolean]$attribute9,

        [Boolean]$attribute9friendlyname,

        [Boolean]$attribute9format,

        [Boolean]$attribute10,

        [Boolean]$attribute10friendlyname,

        [Boolean]$attribute10format,

        [Boolean]$attribute11,

        [Boolean]$attribute11friendlyname,

        [Boolean]$attribute11format,

        [Boolean]$attribute12,

        [Boolean]$attribute12friendlyname,

        [Boolean]$attribute12format,

        [Boolean]$attribute13,

        [Boolean]$attribute13friendlyname,

        [Boolean]$attribute13format,

        [Boolean]$attribute14,

        [Boolean]$attribute14friendlyname,

        [Boolean]$attribute14format,

        [Boolean]$attribute15,

        [Boolean]$attribute15friendlyname,

        [Boolean]$attribute15format,

        [Boolean]$attribute16,

        [Boolean]$attribute16friendlyname,

        [Boolean]$attribute16format,

        [Boolean]$encryptassertion,

        [Boolean]$encryptionalgorithm,

        [Boolean]$samlbinding,

        [Boolean]$skewtime,

        [Boolean]$serviceproviderid,

        [Boolean]$signassertion,

        [Boolean]$keytransportalg,

        [Boolean]$splogouturl,

        [Boolean]$logoutbinding,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$metadataurl,

        [Boolean]$metadatarefreshinterval,

        [Boolean]$signatureservice,

        [Boolean]$samlsigningcertversion,

        [Boolean]$samlspcertversion,

        [Boolean]$acsurlrule 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsamlidpprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) }
            if ( $PSBoundParameters.ContainsKey('samlidpcertname') ) { $payload.Add('samlidpcertname', $samlidpcertname) }
            if ( $PSBoundParameters.ContainsKey('assertionconsumerserviceurl') ) { $payload.Add('assertionconsumerserviceurl', $assertionconsumerserviceurl) }
            if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) }
            if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) }
            if ( $PSBoundParameters.ContainsKey('rejectunsignedrequests') ) { $payload.Add('rejectunsignedrequests', $rejectunsignedrequests) }
            if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) }
            if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) }
            if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) }
            if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) }
            if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) }
            if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) }
            if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) }
            if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) }
            if ( $PSBoundParameters.ContainsKey('samlbinding') ) { $payload.Add('samlbinding', $samlbinding) }
            if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) }
            if ( $PSBoundParameters.ContainsKey('serviceproviderid') ) { $payload.Add('serviceproviderid', $serviceproviderid) }
            if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) }
            if ( $PSBoundParameters.ContainsKey('keytransportalg') ) { $payload.Add('keytransportalg', $keytransportalg) }
            if ( $PSBoundParameters.ContainsKey('splogouturl') ) { $payload.Add('splogouturl', $splogouturl) }
            if ( $PSBoundParameters.ContainsKey('logoutbinding') ) { $payload.Add('logoutbinding', $logoutbinding) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('metadataurl') ) { $payload.Add('metadataurl', $metadataurl) }
            if ( $PSBoundParameters.ContainsKey('metadatarefreshinterval') ) { $payload.Add('metadatarefreshinterval', $metadatarefreshinterval) }
            if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) }
            if ( $PSBoundParameters.ContainsKey('samlsigningcertversion') ) { $payload.Add('samlsigningcertversion', $samlsigningcertversion) }
            if ( $PSBoundParameters.ContainsKey('samlspcertversion') ) { $payload.Add('samlspcertversion', $samlspcertversion) }
            if ( $PSBoundParameters.ContainsKey('acsurlrule') ) { $payload.Add('acsurlrule', $acsurlrule) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsamlidpprofile -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-NSUnsetAuthenticationsamlidpprofile: Finished"
    }
}

function Invoke-NSGetAuthenticationsamlidpprofile {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for AAA Saml IdentityProvider (IdP) profile resource.
    .PARAMETER Name
        Name for the new saml single sign-on 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 an action is created.
    .PARAMETER GetAll
        Retrieve all authenticationsamlidpprofile object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlidpprofile 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-NSGetAuthenticationsamlidpprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidpprofile -GetAll
        Get all authenticationsamlidpprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidpprofile -Count
        Get the number of authenticationsamlidpprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidpprofile -name <string>
        Get authenticationsamlidpprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlidpprofile -Filter @{ 'name'='<value>' }
        Get authenticationsamlidpprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlidpprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile/
        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-NSGetAuthenticationsamlidpprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsamlidpprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidpprofile -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 authenticationsamlidpprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlidpprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidpprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlidpprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidpprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlidpprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlidpprofile -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-NSGetAuthenticationsamlidpprofile: Ended"
    }
}

function Invoke-NSUpdateAuthenticationsamlpolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml policy resource.
    .PARAMETER Name
        Name for the SAML policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the SAML server.
    .PARAMETER Reqaction
        Name of the SAML authentication action to be performed if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationsamlpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsamlpolicy -name <string>
        An example how to update authenticationsamlpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsamlpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationsamlpolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsamlpolicy -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-NSGetAuthenticationsamlpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsamlpolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationsamlpolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml policy resource.
    .PARAMETER Name
        Name for the SAML policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the SAML server.
    .PARAMETER Reqaction
        Name of the SAML authentication action to be performed if the policy matches.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsamlpolicy -name <string>
        An example how to unset authenticationsamlpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsamlpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy
        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]$Name,

        [Boolean]$rule,

        [Boolean]$reqaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsamlpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsamlpolicy -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-NSUnsetAuthenticationsamlpolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationsamlpolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml policy resource.
    .PARAMETER Name
        Name for the SAML policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the SAML server.
    .PARAMETER Reqaction
        Name of the SAML authentication action to be performed if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationsamlpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsamlpolicy -name <string> -rule <string> -reqaction <string>
        An example how to add authenticationsamlpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsamlpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsamlpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                reqaction      = $reqaction
            }

            if ( $PSCmdlet.ShouldProcess("authenticationsamlpolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsamlpolicy -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-NSGetAuthenticationsamlpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsamlpolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsamlpolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for AAA Saml policy resource.
    .PARAMETER Name
        Name for the SAML policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationsamlpolicy -Name <string>
        An example how to delete authenticationsamlpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsamlpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy/
        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-NSDeleteAuthenticationsamlpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsamlpolicy -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-NSDeleteAuthenticationsamlpolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationsamlpolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for AAA Saml policy resource.
    .PARAMETER Name
        Name for the SAML policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after SAML policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationsamlpolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlpolicy 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-NSGetAuthenticationsamlpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicy -GetAll
        Get all authenticationsamlpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicy -Count
        Get the number of authenticationsamlpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicy -name <string>
        Get authenticationsamlpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicy -Filter @{ 'name'='<value>' }
        Get authenticationsamlpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationsamlpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsamlpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy -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 authenticationsamlpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy -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-NSGetAuthenticationsamlpolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationsamlpolicy.
    .PARAMETER Name
        Name of the SAML policy.
    .PARAMETER GetAll
        Retrieve all authenticationsamlpolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlpolicy_authenticationvserver_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-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding -GetAll
        Get all authenticationsamlpolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding -Count
        Get the number of authenticationsamlpolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding -name <string>
        Get authenticationsamlpolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlpolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_authenticationvserver_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-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_authenticationvserver_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 authenticationsamlpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlpolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_authenticationvserver_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-NSGetAuthenticationsamlpolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationsamlpolicy.
    .PARAMETER Name
        Name of the SAML policy.
    .PARAMETER GetAll
        Retrieve all authenticationsamlpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlpolicy_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-NSGetAuthenticationsamlpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyBinding -GetAll
        Get all authenticationsamlpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyBinding -name <string>
        Get authenticationsamlpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_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-NSGetAuthenticationsamlpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_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 authenticationsamlpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_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-NSGetAuthenticationsamlpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationsamlpolicy.
    .PARAMETER Name
        Name of the SAML policy.
    .PARAMETER GetAll
        Retrieve all authenticationsamlpolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlpolicy_vpnglobal_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-NSGetAuthenticationsamlpolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding -GetAll
        Get all authenticationsamlpolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding -Count
        Get the number of authenticationsamlpolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding -name <string>
        Get authenticationsamlpolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlpolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlpolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnglobal_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-NSGetAuthenticationsamlpolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnglobal_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 authenticationsamlpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnglobal_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-NSGetAuthenticationsamlpolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationsamlpolicy.
    .PARAMETER Name
        Name of the SAML policy.
    .PARAMETER GetAll
        Retrieve all authenticationsamlpolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsamlpolicy_vpnvserver_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-NSGetAuthenticationsamlpolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding -GetAll
        Get all authenticationsamlpolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding -Count
        Get the number of authenticationsamlpolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding -name <string>
        Get authenticationsamlpolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationsamlpolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsamlpolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnvserver_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-NSGetAuthenticationsamlpolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsamlpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnvserver_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 authenticationsamlpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsamlpolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsamlpolicy_vpnvserver_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-NSGetAuthenticationsamlpolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationsmartaccesspolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess policy resource.
    .PARAMETER Name
        Name for the Smartaccess policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after Smartaccess policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression.
    .PARAMETER Action
        Name of the Smartaccess profile to use if the policy matches.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER PassThru
        Return details about the created authenticationsmartaccesspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsmartaccesspolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationsmartaccesspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsmartaccesspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy/
        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]$Name,

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

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

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsmartaccesspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("authenticationsmartaccesspolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsmartaccesspolicy -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-NSGetAuthenticationsmartaccesspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsmartaccesspolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsmartaccesspolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess policy resource.
    .PARAMETER Name
        Name for the Smartaccess policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after Smartaccess policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationsmartaccesspolicy -Name <string>
        An example how to delete authenticationsmartaccesspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsmartaccesspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy/
        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-NSDeleteAuthenticationsmartaccesspolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsmartaccesspolicy -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-NSDeleteAuthenticationsmartaccesspolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationsmartaccesspolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess policy resource.
    .PARAMETER Name
        Name for the Smartaccess policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after Smartaccess policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression.
    .PARAMETER Action
        Name of the Smartaccess profile to use if the policy matches.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .PARAMETER PassThru
        Return details about the created authenticationsmartaccesspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsmartaccesspolicy -name <string>
        An example how to update authenticationsmartaccesspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsmartaccesspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy/
        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]$Name,

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

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

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsmartaccesspolicy: 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('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("authenticationsmartaccesspolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsmartaccesspolicy -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-NSGetAuthenticationsmartaccesspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsmartaccesspolicy: Finished"
    }
}

function Invoke-NSUnsetAuthenticationsmartaccesspolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess policy resource.
    .PARAMETER Name
        Name for the Smartaccess policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after Smartaccess policy is created.
    .PARAMETER Comment
        Any comments to preserve information about this policy.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsmartaccesspolicy -name <string>
        An example how to unset authenticationsmartaccesspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsmartaccesspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy
        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]$Name,

        [Boolean]$comment 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsmartaccesspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsmartaccesspolicy -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-NSUnsetAuthenticationsmartaccesspolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationsmartaccesspolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for SmartAccess policy resource.
    .PARAMETER Name
        Name for the Smartaccess policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after Smartaccess policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationsmartaccesspolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsmartaccesspolicy 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-NSGetAuthenticationsmartaccesspolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicy -GetAll
        Get all authenticationsmartaccesspolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicy -Count
        Get the number of authenticationsmartaccesspolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicy -name <string>
        Get authenticationsmartaccesspolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicy -Filter @{ 'name'='<value>' }
        Get authenticationsmartaccesspolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsmartaccesspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationsmartaccesspolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsmartaccesspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy -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 authenticationsmartaccesspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy -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-NSGetAuthenticationsmartaccesspolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationsmartaccesspolicy.
    .PARAMETER Name
        Name of the Smartaccess policy.
    .PARAMETER GetAll
        Retrieve all authenticationsmartaccesspolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsmartaccesspolicy_authenticationvserver_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-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding -GetAll
        Get all authenticationsmartaccesspolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding -Count
        Get the number of authenticationsmartaccesspolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding -name <string>
        Get authenticationsmartaccesspolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationsmartaccesspolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy_authenticationvserver_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-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsmartaccesspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_authenticationvserver_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 authenticationsmartaccesspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_authenticationvserver_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-NSGetAuthenticationsmartaccesspolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationsmartaccesspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationsmartaccesspolicy.
    .PARAMETER Name
        Name of the Smartaccess policy.
    .PARAMETER GetAll
        Retrieve all authenticationsmartaccesspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsmartaccesspolicy_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-NSGetAuthenticationsmartaccesspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyBinding -GetAll
        Get all authenticationsmartaccesspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyBinding -name <string>
        Get authenticationsmartaccesspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccesspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationsmartaccesspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsmartaccesspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccesspolicy_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-NSGetAuthenticationsmartaccesspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationsmartaccesspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_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 authenticationsmartaccesspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsmartaccesspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccesspolicy_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-NSGetAuthenticationsmartaccesspolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationsmartaccessprofile {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess profile resource.
    .PARAMETER Name
        Name of the Smartaccess profile.
    .PARAMETER Tags
        The tag that is associated with Smartaccess profile.
    .PARAMETER Comment
        Optional comment for the profile.
    .PARAMETER PassThru
        Return details about the created authenticationsmartaccessprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationsmartaccessprofile -name <string> -tags <string>
        An example how to add authenticationsmartaccessprofile config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationsmartaccessprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccessprofile/
        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]$Name,

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

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationsmartaccessprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                tags           = $tags
            }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("authenticationsmartaccessprofile", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationsmartaccessprofile -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-NSGetAuthenticationsmartaccessprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationsmartaccessprofile: Finished"
    }
}

function Invoke-NSUpdateAuthenticationsmartaccessprofile {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess profile resource.
    .PARAMETER Name
        Name of the Smartaccess profile.
    .PARAMETER Tags
        The tag that is associated with Smartaccess profile.
    .PARAMETER Comment
        Optional comment for the profile.
    .PARAMETER PassThru
        Return details about the created authenticationsmartaccessprofile item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationsmartaccessprofile -name <string>
        An example how to update authenticationsmartaccessprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationsmartaccessprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccessprofile/
        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]$Name,

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

        [string]$Comment,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationsmartaccessprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('tags') ) { $payload.Add('tags', $tags) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("authenticationsmartaccessprofile", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationsmartaccessprofile -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-NSGetAuthenticationsmartaccessprofile -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationsmartaccessprofile: Finished"
    }
}

function Invoke-NSUnsetAuthenticationsmartaccessprofile {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess profile resource.
    .PARAMETER Name
        Name of the Smartaccess profile.
    .PARAMETER Comment
        Optional comment for the profile.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationsmartaccessprofile -name <string>
        An example how to unset authenticationsmartaccessprofile config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationsmartaccessprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccessprofile
        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]$Name,

        [Boolean]$comment 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationsmartaccessprofile: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationsmartaccessprofile -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-NSUnsetAuthenticationsmartaccessprofile: Finished"
    }
}

function Invoke-NSDeleteAuthenticationsmartaccessprofile {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for SmartAccess profile resource.
    .PARAMETER Name
        Name of the Smartaccess profile.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationsmartaccessprofile -Name <string>
        An example how to delete authenticationsmartaccessprofile config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationsmartaccessprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccessprofile/
        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-NSDeleteAuthenticationsmartaccessprofile: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationsmartaccessprofile -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-NSDeleteAuthenticationsmartaccessprofile: Finished"
    }
}

function Invoke-NSGetAuthenticationsmartaccessprofile {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for SmartAccess profile resource.
    .PARAMETER Name
        Name of the Smartaccess profile.
    .PARAMETER GetAll
        Retrieve all authenticationsmartaccessprofile object(s).
    .PARAMETER Count
        If specified, the count of the authenticationsmartaccessprofile 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-NSGetAuthenticationsmartaccessprofile
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccessprofile -GetAll
        Get all authenticationsmartaccessprofile data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccessprofile -Count
        Get the number of authenticationsmartaccessprofile objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccessprofile -name <string>
        Get authenticationsmartaccessprofile object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationsmartaccessprofile -Filter @{ 'name'='<value>' }
        Get authenticationsmartaccessprofile data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationsmartaccessprofile
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsmartaccessprofile/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationsmartaccessprofile: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationsmartaccessprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccessprofile -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 authenticationsmartaccessprofile objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccessprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationsmartaccessprofile objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccessprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationsmartaccessprofile configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccessprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationsmartaccessprofile configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationsmartaccessprofile -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-NSGetAuthenticationsmartaccessprofile: Ended"
    }
}

function Invoke-NSAddAuthenticationstorefrontauthaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Storefront authentication action resource.
    .PARAMETER Name
        Name for the Storefront Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Serverurl
        URL of the Storefront server. This is the FQDN of the Storefront server. example: https://storefront.com/. Authentication endpoints are learned dynamically by Gateway.
    .PARAMETER Domain
        Domain of the server that is used for authentication. If users enter name without domain, this parameter is added to username in the authentication request to server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationstorefrontauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationstorefrontauthaction -name <string> -serverurl <string>
        An example how to add authenticationstorefrontauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationstorefrontauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction/
        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]$Name,

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

        [string]$Domain,

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationstorefrontauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                serverurl      = $serverurl
            }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationstorefrontauthaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationstorefrontauthaction -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-NSGetAuthenticationstorefrontauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationstorefrontauthaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationstorefrontauthaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Storefront authentication action resource.
    .PARAMETER Name
        Name for the Storefront Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationstorefrontauthaction -Name <string>
        An example how to delete authenticationstorefrontauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationstorefrontauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction/
        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-NSDeleteAuthenticationstorefrontauthaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationstorefrontauthaction -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-NSDeleteAuthenticationstorefrontauthaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationstorefrontauthaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Storefront authentication action resource.
    .PARAMETER Name
        Name for the Storefront Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Serverurl
        URL of the Storefront server. This is the FQDN of the Storefront server. example: https://storefront.com/. Authentication endpoints are learned dynamically by Gateway.
    .PARAMETER Domain
        Domain of the server that is used for authentication. If users enter name without domain, this parameter is added to username in the authentication request to server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER PassThru
        Return details about the created authenticationstorefrontauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationstorefrontauthaction -name <string>
        An example how to update authenticationstorefrontauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationstorefrontauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction/
        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]$Name,

        [string]$Serverurl,

        [string]$Domain,

        [string]$Defaultauthenticationgroup,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationstorefrontauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverurl') ) { $payload.Add('serverurl', $serverurl) }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("authenticationstorefrontauthaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationstorefrontauthaction -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-NSGetAuthenticationstorefrontauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationstorefrontauthaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationstorefrontauthaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Storefront authentication action resource.
    .PARAMETER Name
        Name for the Storefront Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Domain
        Domain of the server that is used for authentication. If users enter name without domain, this parameter is added to username in the authentication request to server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationstorefrontauthaction -name <string>
        An example how to unset authenticationstorefrontauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationstorefrontauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction
        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]$Name,

        [Boolean]$domain,

        [Boolean]$defaultauthenticationgroup 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationstorefrontauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('domain') ) { $payload.Add('domain', $domain) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationstorefrontauthaction -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-NSUnsetAuthenticationstorefrontauthaction: Finished"
    }
}

function Invoke-NSGetAuthenticationstorefrontauthaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Storefront authentication action resource.
    .PARAMETER Name
        Name for the Storefront Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationstorefrontauthaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationstorefrontauthaction 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-NSGetAuthenticationstorefrontauthaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationstorefrontauthaction -GetAll
        Get all authenticationstorefrontauthaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationstorefrontauthaction -Count
        Get the number of authenticationstorefrontauthaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationstorefrontauthaction -name <string>
        Get authenticationstorefrontauthaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationstorefrontauthaction -Filter @{ 'name'='<value>' }
        Get authenticationstorefrontauthaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationstorefrontauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationstorefrontauthaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationstorefrontauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationstorefrontauthaction -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 authenticationstorefrontauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationstorefrontauthaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationstorefrontauthaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationstorefrontauthaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationstorefrontauthaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationstorefrontauthaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationstorefrontauthaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationstorefrontauthaction -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-NSGetAuthenticationstorefrontauthaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationtacacsaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS action resource.
    .PARAMETER Name
        Name for the TACACS+ profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS profile is created.
    .PARAMETER Serverip
        IP address assigned to the TACACS+ server.
    .PARAMETER Serverport
        Port number on which the TACACS+ server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the TACACS+ server.
    .PARAMETER Tacacssecret
        Key shared between the TACACS+ server and the Citrix ADC.
        Required for allowing the Citrix ADC to communicate with the TACACS+ server.
    .PARAMETER Authorization
        Use streaming authorization on the TACACS+ server.
        Possible values = ON, OFF
    .PARAMETER Accounting
        Whether the TACACS+ server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Auditfailedcmds
        The state of the TACACS+ server that will receive accounting messages.
        Possible values = ON, OFF
    .PARAMETER Groupattrname
        TACACS+ group attribute name.
        Used for group extraction on the TACACS+ server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the custom attribute to be extracted from server and stored at index '1' (where '1' changes for each attribute).
    .PARAMETER Attribute2
        Name of the custom attribute to be extracted from server and stored at index '2' (where '2' changes for each attribute).
    .PARAMETER Attribute3
        Name of the custom attribute to be extracted from server and stored at index '3' (where '3' changes for each attribute).
    .PARAMETER Attribute4
        Name of the custom attribute to be extracted from server and stored at index '4' (where '4' changes for each attribute).
    .PARAMETER Attribute5
        Name of the custom attribute to be extracted from server and stored at index '5' (where '5' changes for each attribute).
    .PARAMETER Attribute6
        Name of the custom attribute to be extracted from server and stored at index '6' (where '6' changes for each attribute).
    .PARAMETER Attribute7
        Name of the custom attribute to be extracted from server and stored at index '7' (where '7' changes for each attribute).
    .PARAMETER Attribute8
        Name of the custom attribute to be extracted from server and stored at index '8' (where '8' changes for each attribute).
    .PARAMETER Attribute9
        Name of the custom attribute to be extracted from server and stored at index '9' (where '9' changes for each attribute).
    .PARAMETER Attribute10
        Name of the custom attribute to be extracted from server and stored at index '10' (where '10' changes for each attribute).
    .PARAMETER Attribute11
        Name of the custom attribute to be extracted from server and stored at index '11' (where '11' changes for each attribute).
    .PARAMETER Attribute12
        Name of the custom attribute to be extracted from server and stored at index '12' (where '12' changes for each attribute).
    .PARAMETER Attribute13
        Name of the custom attribute to be extracted from server and stored at index '13' (where '13' changes for each attribute).
    .PARAMETER Attribute14
        Name of the custom attribute to be extracted from server and stored at index '14' (where '14' changes for each attribute).
    .PARAMETER Attribute15
        Name of the custom attribute to be extracted from server and stored at index '15' (where '15' changes for each attribute).
    .PARAMETER Attribute16
        Name of the custom attribute to be extracted from server and stored at index '16' (where '16' changes for each attribute).
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from tacacs server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationtacacsaction -name <string>
        An example how to unset authenticationtacacsaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationtacacsaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction
        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]$Name,

        [Boolean]$serverip,

        [Boolean]$serverport,

        [Boolean]$authtimeout,

        [Boolean]$tacacssecret,

        [Boolean]$authorization,

        [Boolean]$accounting,

        [Boolean]$auditfailedcmds,

        [Boolean]$groupattrname,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$attribute1,

        [Boolean]$attribute2,

        [Boolean]$attribute3,

        [Boolean]$attribute4,

        [Boolean]$attribute5,

        [Boolean]$attribute6,

        [Boolean]$attribute7,

        [Boolean]$attribute8,

        [Boolean]$attribute9,

        [Boolean]$attribute10,

        [Boolean]$attribute11,

        [Boolean]$attribute12,

        [Boolean]$attribute13,

        [Boolean]$attribute14,

        [Boolean]$attribute15,

        [Boolean]$attribute16,

        [Boolean]$attributes 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationtacacsaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('tacacssecret') ) { $payload.Add('tacacssecret', $tacacssecret) }
            if ( $PSBoundParameters.ContainsKey('authorization') ) { $payload.Add('authorization', $authorization) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('auditfailedcmds') ) { $payload.Add('auditfailedcmds', $auditfailedcmds) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationtacacsaction -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-NSUnsetAuthenticationtacacsaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationtacacsaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS action resource.
    .PARAMETER Name
        Name for the TACACS+ profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationtacacsaction -Name <string>
        An example how to delete authenticationtacacsaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationtacacsaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction/
        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-NSDeleteAuthenticationtacacsaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationtacacsaction -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-NSDeleteAuthenticationtacacsaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationtacacsaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS action resource.
    .PARAMETER Name
        Name for the TACACS+ profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS profile is created.
    .PARAMETER Serverip
        IP address assigned to the TACACS+ server.
    .PARAMETER Serverport
        Port number on which the TACACS+ server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the TACACS+ server.
    .PARAMETER Tacacssecret
        Key shared between the TACACS+ server and the Citrix ADC.
        Required for allowing the Citrix ADC to communicate with the TACACS+ server.
    .PARAMETER Authorization
        Use streaming authorization on the TACACS+ server.
        Possible values = ON, OFF
    .PARAMETER Accounting
        Whether the TACACS+ server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Auditfailedcmds
        The state of the TACACS+ server that will receive accounting messages.
        Possible values = ON, OFF
    .PARAMETER Groupattrname
        TACACS+ group attribute name.
        Used for group extraction on the TACACS+ server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the custom attribute to be extracted from server and stored at index '1' (where '1' changes for each attribute).
    .PARAMETER Attribute2
        Name of the custom attribute to be extracted from server and stored at index '2' (where '2' changes for each attribute).
    .PARAMETER Attribute3
        Name of the custom attribute to be extracted from server and stored at index '3' (where '3' changes for each attribute).
    .PARAMETER Attribute4
        Name of the custom attribute to be extracted from server and stored at index '4' (where '4' changes for each attribute).
    .PARAMETER Attribute5
        Name of the custom attribute to be extracted from server and stored at index '5' (where '5' changes for each attribute).
    .PARAMETER Attribute6
        Name of the custom attribute to be extracted from server and stored at index '6' (where '6' changes for each attribute).
    .PARAMETER Attribute7
        Name of the custom attribute to be extracted from server and stored at index '7' (where '7' changes for each attribute).
    .PARAMETER Attribute8
        Name of the custom attribute to be extracted from server and stored at index '8' (where '8' changes for each attribute).
    .PARAMETER Attribute9
        Name of the custom attribute to be extracted from server and stored at index '9' (where '9' changes for each attribute).
    .PARAMETER Attribute10
        Name of the custom attribute to be extracted from server and stored at index '10' (where '10' changes for each attribute).
    .PARAMETER Attribute11
        Name of the custom attribute to be extracted from server and stored at index '11' (where '11' changes for each attribute).
    .PARAMETER Attribute12
        Name of the custom attribute to be extracted from server and stored at index '12' (where '12' changes for each attribute).
    .PARAMETER Attribute13
        Name of the custom attribute to be extracted from server and stored at index '13' (where '13' changes for each attribute).
    .PARAMETER Attribute14
        Name of the custom attribute to be extracted from server and stored at index '14' (where '14' changes for each attribute).
    .PARAMETER Attribute15
        Name of the custom attribute to be extracted from server and stored at index '15' (where '15' changes for each attribute).
    .PARAMETER Attribute16
        Name of the custom attribute to be extracted from server and stored at index '16' (where '16' changes for each attribute).
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from tacacs server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER PassThru
        Return details about the created authenticationtacacsaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationtacacsaction -name <string>
        An example how to update authenticationtacacsaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationtacacsaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction/
        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]$Name,

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

        [int]$Serverport,

        [double]$Authtimeout,

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

        [ValidateSet('ON', 'OFF')]
        [string]$Authorization,

        [ValidateSet('ON', 'OFF')]
        [string]$Accounting,

        [ValidateSet('ON', 'OFF')]
        [string]$Auditfailedcmds,

        [string]$Groupattrname,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationtacacsaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('tacacssecret') ) { $payload.Add('tacacssecret', $tacacssecret) }
            if ( $PSBoundParameters.ContainsKey('authorization') ) { $payload.Add('authorization', $authorization) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('auditfailedcmds') ) { $payload.Add('auditfailedcmds', $auditfailedcmds) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSCmdlet.ShouldProcess("authenticationtacacsaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationtacacsaction -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-NSGetAuthenticationtacacsaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationtacacsaction: Finished"
    }
}

function Invoke-NSAddAuthenticationtacacsaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS action resource.
    .PARAMETER Name
        Name for the TACACS+ profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS profile is created.
    .PARAMETER Serverip
        IP address assigned to the TACACS+ server.
    .PARAMETER Serverport
        Port number on which the TACACS+ server listens for connections.
    .PARAMETER Authtimeout
        Number of seconds the Citrix ADC waits for a response from the TACACS+ server.
    .PARAMETER Tacacssecret
        Key shared between the TACACS+ server and the Citrix ADC.
        Required for allowing the Citrix ADC to communicate with the TACACS+ server.
    .PARAMETER Authorization
        Use streaming authorization on the TACACS+ server.
        Possible values = ON, OFF
    .PARAMETER Accounting
        Whether the TACACS+ server is currently accepting accounting messages.
        Possible values = ON, OFF
    .PARAMETER Auditfailedcmds
        The state of the TACACS+ server that will receive accounting messages.
        Possible values = ON, OFF
    .PARAMETER Groupattrname
        TACACS+ group attribute name.
        Used for group extraction on the TACACS+ server.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Name of the custom attribute to be extracted from server and stored at index '1' (where '1' changes for each attribute).
    .PARAMETER Attribute2
        Name of the custom attribute to be extracted from server and stored at index '2' (where '2' changes for each attribute).
    .PARAMETER Attribute3
        Name of the custom attribute to be extracted from server and stored at index '3' (where '3' changes for each attribute).
    .PARAMETER Attribute4
        Name of the custom attribute to be extracted from server and stored at index '4' (where '4' changes for each attribute).
    .PARAMETER Attribute5
        Name of the custom attribute to be extracted from server and stored at index '5' (where '5' changes for each attribute).
    .PARAMETER Attribute6
        Name of the custom attribute to be extracted from server and stored at index '6' (where '6' changes for each attribute).
    .PARAMETER Attribute7
        Name of the custom attribute to be extracted from server and stored at index '7' (where '7' changes for each attribute).
    .PARAMETER Attribute8
        Name of the custom attribute to be extracted from server and stored at index '8' (where '8' changes for each attribute).
    .PARAMETER Attribute9
        Name of the custom attribute to be extracted from server and stored at index '9' (where '9' changes for each attribute).
    .PARAMETER Attribute10
        Name of the custom attribute to be extracted from server and stored at index '10' (where '10' changes for each attribute).
    .PARAMETER Attribute11
        Name of the custom attribute to be extracted from server and stored at index '11' (where '11' changes for each attribute).
    .PARAMETER Attribute12
        Name of the custom attribute to be extracted from server and stored at index '12' (where '12' changes for each attribute).
    .PARAMETER Attribute13
        Name of the custom attribute to be extracted from server and stored at index '13' (where '13' changes for each attribute).
    .PARAMETER Attribute14
        Name of the custom attribute to be extracted from server and stored at index '14' (where '14' changes for each attribute).
    .PARAMETER Attribute15
        Name of the custom attribute to be extracted from server and stored at index '15' (where '15' changes for each attribute).
    .PARAMETER Attribute16
        Name of the custom attribute to be extracted from server and stored at index '16' (where '16' changes for each attribute).
    .PARAMETER Attributes
        List of attribute names separated by ',' which needs to be fetched from tacacs server.
        Note that preceeding and trailing spaces will be removed.
        Attribute name can be 127 bytes and total length of this string should not cross 2047 bytes.
        These attributes have multi-value support separated by ',' and stored as key-value pair in AAA session.
    .PARAMETER PassThru
        Return details about the created authenticationtacacsaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationtacacsaction -name <string>
        An example how to add authenticationtacacsaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationtacacsaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction/
        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]$Name,

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

        [int]$Serverport = '49',

        [double]$Authtimeout = '3',

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

        [ValidateSet('ON', 'OFF')]
        [string]$Authorization,

        [ValidateSet('ON', 'OFF')]
        [string]$Accounting,

        [ValidateSet('ON', 'OFF')]
        [string]$Auditfailedcmds,

        [string]$Groupattrname,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [string]$Attributes,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationtacacsaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('authtimeout') ) { $payload.Add('authtimeout', $authtimeout) }
            if ( $PSBoundParameters.ContainsKey('tacacssecret') ) { $payload.Add('tacacssecret', $tacacssecret) }
            if ( $PSBoundParameters.ContainsKey('authorization') ) { $payload.Add('authorization', $authorization) }
            if ( $PSBoundParameters.ContainsKey('accounting') ) { $payload.Add('accounting', $accounting) }
            if ( $PSBoundParameters.ContainsKey('auditfailedcmds') ) { $payload.Add('auditfailedcmds', $auditfailedcmds) }
            if ( $PSBoundParameters.ContainsKey('groupattrname') ) { $payload.Add('groupattrname', $groupattrname) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSBoundParameters.ContainsKey('attributes') ) { $payload.Add('attributes', $attributes) }
            if ( $PSCmdlet.ShouldProcess("authenticationtacacsaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationtacacsaction -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-NSGetAuthenticationtacacsaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationtacacsaction: Finished"
    }
}

function Invoke-NSGetAuthenticationtacacsaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for TACACS action resource.
    .PARAMETER Name
        Name for the TACACS+ profile (action).
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationtacacsaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacsaction 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-NSGetAuthenticationtacacsaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacsaction -GetAll
        Get all authenticationtacacsaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacsaction -Count
        Get the number of authenticationtacacsaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacsaction -name <string>
        Get authenticationtacacsaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacsaction -Filter @{ 'name'='<value>' }
        Get authenticationtacacsaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacsaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationtacacsaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationtacacsaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacsaction -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 authenticationtacacsaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacsaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacsaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacsaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacsaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacsaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacsaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacsaction -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-NSGetAuthenticationtacacsaction: Ended"
    }
}

function Invoke-NSUnsetAuthenticationtacacspolicy {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS policy resource.
    .PARAMETER Name
        Name for the TACACS+ policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS+ policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the TACACS+ server.
    .PARAMETER Reqaction
        Name of the TACACS+ action to perform if the policy matches.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationtacacspolicy -name <string>
        An example how to unset authenticationtacacspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationtacacspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy
        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]$Name,

        [Boolean]$rule,

        [Boolean]$reqaction 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationtacacspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationtacacspolicy -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-NSUnsetAuthenticationtacacspolicy: Finished"
    }
}

function Invoke-NSAddAuthenticationtacacspolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS policy resource.
    .PARAMETER Name
        Name for the TACACS+ policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS+ policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the TACACS+ server.
    .PARAMETER Reqaction
        Name of the TACACS+ action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationtacacspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationtacacspolicy -name <string> -rule <string>
        An example how to add authenticationtacacspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationtacacspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationtacacspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
            }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationtacacspolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationtacacspolicy -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-NSGetAuthenticationtacacspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationtacacspolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationtacacspolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS policy resource.
    .PARAMETER Name
        Name for the TACACS+ policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS+ policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationtacacspolicy -Name <string>
        An example how to delete authenticationtacacspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationtacacspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy/
        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-NSDeleteAuthenticationtacacspolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationtacacspolicy -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-NSDeleteAuthenticationtacacspolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationtacacspolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for TACACS policy resource.
    .PARAMETER Name
        Name for the TACACS+ policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS+ policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the TACACS+ server.
    .PARAMETER Reqaction
        Name of the TACACS+ action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationtacacspolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationtacacspolicy -name <string>
        An example how to update authenticationtacacspolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationtacacspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationtacacspolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('reqaction') ) { $payload.Add('reqaction', $reqaction) }
            if ( $PSCmdlet.ShouldProcess("authenticationtacacspolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationtacacspolicy -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-NSGetAuthenticationtacacspolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationtacacspolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationtacacspolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for TACACS policy resource.
    .PARAMETER Name
        Name for the TACACS+ policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after TACACS+ policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy 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-NSGetAuthenticationtacacspolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicy -GetAll
        Get all authenticationtacacspolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicy -Count
        Get the number of authenticationtacacspolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicy -name <string>
        Get authenticationtacacspolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicy -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationtacacspolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationtacacspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy -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 authenticationtacacspolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy -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-NSGetAuthenticationtacacspolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationtacacspolicy.
    .PARAMETER Name
        Name of the TACACS+ policy.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy_authenticationvserver_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-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding -GetAll
        Get all authenticationtacacspolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding -Count
        Get the number of authenticationtacacspolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding -name <string>
        Get authenticationtacacspolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_authenticationvserver_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-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationtacacspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_authenticationvserver_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 authenticationtacacspolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_authenticationvserver_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-NSGetAuthenticationtacacspolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationtacacspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationtacacspolicy.
    .PARAMETER Name
        Name of the TACACS+ policy.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy_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-NSGetAuthenticationtacacspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyBinding -GetAll
        Get all authenticationtacacspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyBinding -name <string>
        Get authenticationtacacspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_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-NSGetAuthenticationtacacspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationtacacspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_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 authenticationtacacspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_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-NSGetAuthenticationtacacspolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationtacacspolicy.
    .PARAMETER Name
        Name of the TACACS+ policy.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy_systemglobal_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-NSGetAuthenticationtacacspolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding -GetAll
        Get all authenticationtacacspolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding -Count
        Get the number of authenticationtacacspolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding -name <string>
        Get authenticationtacacspolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_systemglobal_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-NSGetAuthenticationtacacspolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationtacacspolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_systemglobal_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 authenticationtacacspolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_systemglobal_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-NSGetAuthenticationtacacspolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationtacacspolicy.
    .PARAMETER Name
        Name of the TACACS+ policy.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy_vpnglobal_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-NSGetAuthenticationtacacspolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding -GetAll
        Get all authenticationtacacspolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding -Count
        Get the number of authenticationtacacspolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding -name <string>
        Get authenticationtacacspolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnglobal_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-NSGetAuthenticationtacacspolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationtacacspolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnglobal_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 authenticationtacacspolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnglobal_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-NSGetAuthenticationtacacspolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationtacacspolicy.
    .PARAMETER Name
        Name of the TACACS+ policy.
    .PARAMETER GetAll
        Retrieve all authenticationtacacspolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationtacacspolicy_vpnvserver_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-NSGetAuthenticationtacacspolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding -GetAll
        Get all authenticationtacacspolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding -Count
        Get the number of authenticationtacacspolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding -name <string>
        Get authenticationtacacspolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationtacacspolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationtacacspolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnvserver_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-NSGetAuthenticationtacacspolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationtacacspolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnvserver_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 authenticationtacacspolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationtacacspolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationtacacspolicy_vpnvserver_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-NSGetAuthenticationtacacspolicyVpnvserverBinding: Ended"
    }
}

function Invoke-NSRenameAuthenticationvserver {
    <#
    .SYNOPSIS
        Rename Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .PARAMETER Newname
        New name of the authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
    .PARAMETER PassThru
        Return details about the created authenticationvserver item.
    .EXAMPLE
        PS C:\>Invoke-NSRenameAuthenticationvserver -name <string> -newname <string>
        An example how to rename authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSRenameAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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]$Name,

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

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

            if ( $PSCmdlet.ShouldProcess("authenticationvserver", "Rename Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationvserver -Action rename -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-NSGetAuthenticationvserver -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSRenameAuthenticationvserver: Finished"
    }
}

function Invoke-NSEnableAuthenticationvserver {
    <#
    .SYNOPSIS
        Enable Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .EXAMPLE
        PS C:\>Invoke-NSEnableAuthenticationvserver -name <string>
        An example how to enable authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSEnableAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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]$Name 

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

            if ( $PSCmdlet.ShouldProcess($Name, "Enable Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationvserver -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-NSEnableAuthenticationvserver: Finished"
    }
}

function Invoke-NSDisableAuthenticationvserver {
    <#
    .SYNOPSIS
        Disable Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .EXAMPLE
        PS C:\>Invoke-NSDisableAuthenticationvserver -name <string>
        An example how to disable authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSDisableAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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]$Name 

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

            if ( $PSCmdlet.ShouldProcess($Name, "Disable Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationvserver -Action disable -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-NSDisableAuthenticationvserver: Finished"
    }
}

function Invoke-NSUnsetAuthenticationvserver {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .PARAMETER Authenticationdomain
        The domain of the authentication cookie set by Authentication vserver.
    .PARAMETER Maxloginattempts
        Maximum Number of login Attempts.
         
        Maximum value = 255
    .PARAMETER Authentication
        Require users to be authenticated before sending traffic through this virtual server.
         
        Possible values = ON, OFF
    .PARAMETER Comment
        Any comments associated with this virtual server.
    .PARAMETER Appflowlog
        Log AppFlow flow information.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Failedlogintimeout
        Number of minutes an account will be locked if user exceeds maximum permissible attempts.
    .PARAMETER Certkeynames
        Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate.
    .PARAMETER Samesite
        SameSite attribute value for Cookies generated in AAATM context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite.
        Possible values = None, LAX, STRICT
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationvserver -name <string>
        An example how to unset authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver
        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]$Name,

        [Boolean]$authenticationdomain,

        [Boolean]$maxloginattempts,

        [Boolean]$authentication,

        [Boolean]$comment,

        [Boolean]$appflowlog,

        [Boolean]$failedlogintimeout,

        [Boolean]$certkeynames,

        [Boolean]$samesite 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationvserver: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) }
            if ( $PSBoundParameters.ContainsKey('failedlogintimeout') ) { $payload.Add('failedlogintimeout', $failedlogintimeout) }
            if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) }
            if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationvserver -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-NSUnsetAuthenticationvserver: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserver {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserver -Name <string>
        An example how to delete authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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-NSDeleteAuthenticationvserver: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver -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-NSDeleteAuthenticationvserver: Finished"
    }
}

function Invoke-NSUpdateAuthenticationvserver {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .PARAMETER Ipv46
        IP address of the authentication virtual server, if a single IP address is assigned to the virtual server.
    .PARAMETER Authentication
        Require users to be authenticated before sending traffic through this virtual server.
         
        Possible values = ON, OFF
    .PARAMETER Authenticationdomain
        The domain of the authentication cookie set by Authentication vserver.
    .PARAMETER Comment
        Any comments associated with this virtual server.
    .PARAMETER Appflowlog
        Log AppFlow flow information.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxloginattempts
        Maximum Number of login Attempts.
         
        Maximum value = 255
    .PARAMETER Failedlogintimeout
        Number of minutes an account will be locked if user exceeds maximum permissible attempts.
    .PARAMETER Certkeynames
        Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate.
    .PARAMETER Samesite
        SameSite attribute value for Cookies generated in AAATM context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite.
        Possible values = None, LAX, STRICT
    .PARAMETER PassThru
        Return details about the created authenticationvserver item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationvserver -name <string>
        An example how to update authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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]$Name,

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

        [ValidateSet('ON', 'OFF')]
        [string]$Authentication,

        [ValidateLength(3, 252)]
        [string]$Authenticationdomain,

        [string]$Comment,

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

        [double]$Maxloginattempts,

        [double]$Failedlogintimeout,

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

        [ValidateSet('None', 'LAX', 'STRICT')]
        [string]$Samesite,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationvserver: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('ipv46') ) { $payload.Add('ipv46', $ipv46) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) }
            if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) }
            if ( $PSBoundParameters.ContainsKey('failedlogintimeout') ) { $payload.Add('failedlogintimeout', $failedlogintimeout) }
            if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) }
            if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver -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-NSGetAuthenticationvserver -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationvserver: Finished"
    }
}

function Invoke-NSAddAuthenticationvserver {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .PARAMETER Servicetype
        Protocol type of the authentication virtual server. Always SSL.
         
        Possible values = SSL
    .PARAMETER Ipv46
        IP address of the authentication virtual server, if a single IP address is assigned to the virtual server.
    .PARAMETER Range
        If you are creating a series of virtual servers with a range of IP addresses assigned to them, the length of the range.
        The new range of authentication virtual servers will have IP addresses consecutively numbered, starting with the primary address specified with the IP Address parameter.
    .PARAMETER Port
        TCP port on which the virtual server accepts connections.
    .PARAMETER State
        Initial state of the new virtual server.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Authentication
        Require users to be authenticated before sending traffic through this virtual server.
         
        Possible values = ON, OFF
    .PARAMETER Authenticationdomain
        The domain of the authentication cookie set by Authentication vserver.
    .PARAMETER Comment
        Any comments associated with this virtual server.
    .PARAMETER Td
        Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0.
         
        Maximum value = 4094
    .PARAMETER Appflowlog
        Log AppFlow flow information.
         
        Possible values = ENABLED, DISABLED
    .PARAMETER Maxloginattempts
        Maximum Number of login Attempts.
         
        Maximum value = 255
    .PARAMETER Failedlogintimeout
        Number of minutes an account will be locked if user exceeds maximum permissible attempts.
    .PARAMETER Certkeynames
        Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate.
    .PARAMETER Samesite
        SameSite attribute value for Cookies generated in AAATM context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite.
        Possible values = None, LAX, STRICT
    .PARAMETER PassThru
        Return details about the created authenticationvserver item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserver -name <string> -servicetype <string>
        An example how to add authenticationvserver config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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]$Name,

        [Parameter(Mandatory)]
        [ValidateSet('SSL')]
        [string]$Servicetype = 'SSL',

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

        [double]$Range = '1',

        [ValidateRange(1, 65535)]
        [int]$Port,

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

        [ValidateSet('ON', 'OFF')]
        [string]$Authentication = 'ON',

        [ValidateLength(3, 252)]
        [string]$Authenticationdomain,

        [string]$Comment,

        [double]$Td,

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

        [double]$Maxloginattempts,

        [double]$Failedlogintimeout,

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

        [ValidateSet('None', 'LAX', 'STRICT')]
        [string]$Samesite,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserver: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                servicetype    = $servicetype
            }
            if ( $PSBoundParameters.ContainsKey('ipv46') ) { $payload.Add('ipv46', $ipv46) }
            if ( $PSBoundParameters.ContainsKey('range') ) { $payload.Add('range', $range) }
            if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) }
            if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) }
            if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) }
            if ( $PSBoundParameters.ContainsKey('authenticationdomain') ) { $payload.Add('authenticationdomain', $authenticationdomain) }
            if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) }
            if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) }
            if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) }
            if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) }
            if ( $PSBoundParameters.ContainsKey('failedlogintimeout') ) { $payload.Add('failedlogintimeout', $failedlogintimeout) }
            if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) }
            if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationvserver -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-NSGetAuthenticationvserver -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserver: Finished"
    }
}

function Invoke-NSGetAuthenticationvserver {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for authentication virtual server resource.
    .PARAMETER Name
        Name for the new authentication virtual server.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the authentication virtual server is added by using the rename authentication vserver command.
    .PARAMETER GetAll
        Retrieve all authenticationvserver object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver 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-NSGetAuthenticationvserver
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserver -GetAll
        Get all authenticationvserver data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserver -Count
        Get the number of authenticationvserver objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserver -name <string>
        Get authenticationvserver object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserver -Filter @{ 'name'='<value>' }
        Get authenticationvserver data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserver
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationvserver: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationvserver objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver -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 authenticationvserver objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver -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-NSGetAuthenticationvserver: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuditnslogpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the auditnslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_auditnslogpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuditnslogpolicyBinding -name <string>
        An example how to add authenticationvserver_auditnslogpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuditnslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditnslogpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuditnslogpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_auditnslogpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_auditnslogpolicy_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-NSGetAuthenticationvserverAuditnslogpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuditnslogpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuditnslogpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the auditnslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuditnslogpolicyBinding -Name <string>
        An example how to delete authenticationvserver_auditnslogpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuditnslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditnslogpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuditnslogpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_auditnslogpolicy_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-NSDeleteAuthenticationvserverAuditnslogpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the auditnslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_auditnslogpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_auditnslogpolicy_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-NSGetAuthenticationvserverAuditnslogpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding -GetAll
        Get all authenticationvserver_auditnslogpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding -Count
        Get the number of authenticationvserver_auditnslogpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding -name <string>
        Get authenticationvserver_auditnslogpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_auditnslogpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuditnslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditnslogpolicy_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-NSGetAuthenticationvserverAuditnslogpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_auditnslogpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditnslogpolicy_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 authenticationvserver_auditnslogpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_auditnslogpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_auditnslogpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_auditnslogpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditnslogpolicy_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-NSGetAuthenticationvserverAuditnslogpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuditsyslogpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the auditsyslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_auditsyslogpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuditsyslogpolicyBinding -name <string>
        An example how to add authenticationvserver_auditsyslogpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuditsyslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditsyslogpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuditsyslogpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_auditsyslogpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_auditsyslogpolicy_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-NSGetAuthenticationvserverAuditsyslogpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuditsyslogpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuditsyslogpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the auditsyslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuditsyslogpolicyBinding -Name <string>
        An example how to delete authenticationvserver_auditsyslogpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuditsyslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditsyslogpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuditsyslogpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_auditsyslogpolicy_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-NSDeleteAuthenticationvserverAuditsyslogpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the auditsyslogpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_auditsyslogpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_auditsyslogpolicy_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-NSGetAuthenticationvserverAuditsyslogpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding -GetAll
        Get all authenticationvserver_auditsyslogpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding -Count
        Get the number of authenticationvserver_auditsyslogpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding -name <string>
        Get authenticationvserver_auditsyslogpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_auditsyslogpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuditsyslogpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditsyslogpolicy_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-NSGetAuthenticationvserverAuditsyslogpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_auditsyslogpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditsyslogpolicy_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 authenticationvserver_auditsyslogpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_auditsyslogpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_auditsyslogpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_auditsyslogpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_auditsyslogpolicy_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-NSGetAuthenticationvserverAuditsyslogpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationcertpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationcertpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationcertpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationcertpolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationcertpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationcertpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationcertpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationcertpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationcertpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationcertpolicy_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-NSGetAuthenticationvserverAuthenticationcertpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationcertpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationcertpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationcertpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationcertpolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationcertpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationcertpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationcertpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationcertpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationcertpolicy_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-NSDeleteAuthenticationvserverAuthenticationcertpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationcertpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationcertpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationcertpolicy_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-NSGetAuthenticationvserverAuthenticationcertpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding -GetAll
        Get all authenticationvserver_authenticationcertpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding -Count
        Get the number of authenticationvserver_authenticationcertpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding -name <string>
        Get authenticationvserver_authenticationcertpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationcertpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationcertpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationcertpolicy_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-NSGetAuthenticationvserverAuthenticationcertpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationcertpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationcertpolicy_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 authenticationvserver_authenticationcertpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationcertpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationcertpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationcertpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationcertpolicy_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-NSGetAuthenticationvserverAuthenticationcertpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationldappolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationldappolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationldappolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationldappolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationldappolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationldappolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationldappolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationldappolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationldappolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationldappolicy_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-NSGetAuthenticationvserverAuthenticationldappolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationldappolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationldappolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationldappolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationldappolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationldappolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationldappolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationldappolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationldappolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationldappolicy_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-NSDeleteAuthenticationvserverAuthenticationldappolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationldappolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationldappolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationldappolicy_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-NSGetAuthenticationvserverAuthenticationldappolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding -GetAll
        Get all authenticationvserver_authenticationldappolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding -Count
        Get the number of authenticationvserver_authenticationldappolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding -name <string>
        Get authenticationvserver_authenticationldappolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationldappolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationldappolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationldappolicy_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-NSGetAuthenticationvserverAuthenticationldappolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationldappolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationldappolicy_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 authenticationvserver_authenticationldappolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationldappolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationldappolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationldappolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationldappolicy_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-NSGetAuthenticationvserverAuthenticationldappolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationlocalpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationlocalpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationlocalpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationlocalpolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationlocalpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationlocalpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationlocalpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationlocalpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationlocalpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationlocalpolicy_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-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationlocalpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationlocalpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationlocalpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationlocalpolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationlocalpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationlocalpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationlocalpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationlocalpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationlocalpolicy_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-NSDeleteAuthenticationvserverAuthenticationlocalpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationlocalpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationlocalpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationlocalpolicy_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-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding -GetAll
        Get all authenticationvserver_authenticationlocalpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding -Count
        Get the number of authenticationvserver_authenticationlocalpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding -name <string>
        Get authenticationvserver_authenticationlocalpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationlocalpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationlocalpolicy_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-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationlocalpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationlocalpolicy_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 authenticationvserver_authenticationlocalpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationlocalpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationlocalpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationlocalpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationlocalpolicy_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-NSGetAuthenticationvserverAuthenticationlocalpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationloginschemapolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationloginschemapolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationloginschemapolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationloginschemapolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationloginschemapolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationloginschemapolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationloginschemapolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationloginschemapolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationloginschemapolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationloginschemapolicy_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-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationloginschemapolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationloginschemapolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationloginschemapolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationloginschemapolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationloginschemapolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationloginschemapolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationloginschemapolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationloginschemapolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationloginschemapolicy_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-NSDeleteAuthenticationvserverAuthenticationloginschemapolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationloginschemapolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationloginschemapolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationloginschemapolicy_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-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding -GetAll
        Get all authenticationvserver_authenticationloginschemapolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding -Count
        Get the number of authenticationvserver_authenticationloginschemapolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding -name <string>
        Get authenticationvserver_authenticationloginschemapolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationloginschemapolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationloginschemapolicy_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-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationloginschemapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationloginschemapolicy_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 authenticationvserver_authenticationloginschemapolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationloginschemapolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationloginschemapolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationloginschemapolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationloginschemapolicy_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-NSGetAuthenticationvserverAuthenticationloginschemapolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationnegotiatepolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationnegotiatepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationnegotiatepolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationnegotiatepolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationnegotiatepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationnegotiatepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationnegotiatepolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationnegotiatepolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationnegotiatepolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationnegotiatepolicy_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-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationnegotiatepolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationnegotiatepolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationnegotiatepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationnegotiatepolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationnegotiatepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationnegotiatepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationnegotiatepolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationnegotiatepolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationnegotiatepolicy_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-NSDeleteAuthenticationvserverAuthenticationnegotiatepolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationnegotiatepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationnegotiatepolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationnegotiatepolicy_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-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding -GetAll
        Get all authenticationvserver_authenticationnegotiatepolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding -Count
        Get the number of authenticationvserver_authenticationnegotiatepolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding -name <string>
        Get authenticationvserver_authenticationnegotiatepolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationnegotiatepolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationnegotiatepolicy_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-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationnegotiatepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationnegotiatepolicy_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 authenticationvserver_authenticationnegotiatepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationnegotiatepolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationnegotiatepolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationnegotiatepolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationnegotiatepolicy_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-NSGetAuthenticationvserverAuthenticationnegotiatepolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationoauthidppolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationoauthidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        On success invoke label.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationoauthidppolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationoauthidppolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationoauthidppolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationoauthidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationoauthidppolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationoauthidppolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationoauthidppolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationoauthidppolicy_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-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationoauthidppolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationoauthidppolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationoauthidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationoauthidppolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationoauthidppolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationoauthidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationoauthidppolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationoauthidppolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationoauthidppolicy_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-NSDeleteAuthenticationvserverAuthenticationoauthidppolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationoauthidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationoauthidppolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationoauthidppolicy_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-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding -GetAll
        Get all authenticationvserver_authenticationoauthidppolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding -Count
        Get the number of authenticationvserver_authenticationoauthidppolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding -name <string>
        Get authenticationvserver_authenticationoauthidppolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationoauthidppolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationoauthidppolicy_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-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationoauthidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationoauthidppolicy_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 authenticationvserver_authenticationoauthidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationoauthidppolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationoauthidppolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationoauthidppolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationoauthidppolicy_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-NSGetAuthenticationvserverAuthenticationoauthidppolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        On success invoke label.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationpolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationpolicy_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-NSGetAuthenticationvserverAuthenticationpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationpolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationpolicy_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-NSDeleteAuthenticationvserverAuthenticationpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationpolicy_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-NSGetAuthenticationvserverAuthenticationpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding -GetAll
        Get all authenticationvserver_authenticationpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding -Count
        Get the number of authenticationvserver_authenticationpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding -name <string>
        Get authenticationvserver_authenticationpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationpolicy_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-NSGetAuthenticationvserverAuthenticationpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationpolicy_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 authenticationvserver_authenticationpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationpolicy_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-NSGetAuthenticationvserverAuthenticationpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationradiuspolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationradiuspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationradiuspolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationradiuspolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationradiuspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationradiuspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationradiuspolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationradiuspolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationradiuspolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationradiuspolicy_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-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationradiuspolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationradiuspolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationradiuspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationradiuspolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationradiuspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationradiuspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationradiuspolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationradiuspolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationradiuspolicy_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-NSDeleteAuthenticationvserverAuthenticationradiuspolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationradiuspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationradiuspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationradiuspolicy_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-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding -GetAll
        Get all authenticationvserver_authenticationradiuspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding -Count
        Get the number of authenticationvserver_authenticationradiuspolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding -name <string>
        Get authenticationvserver_authenticationradiuspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationradiuspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationradiuspolicy_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-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationradiuspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationradiuspolicy_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 authenticationvserver_authenticationradiuspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationradiuspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationradiuspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationradiuspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationradiuspolicy_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-NSGetAuthenticationvserverAuthenticationradiuspolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationsamlidppolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsamlidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        On success invoke label.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationsamlidppolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationsamlidppolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationsamlidppolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationsamlidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlidppolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsamlidppolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationsamlidppolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationsamlidppolicy_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-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsamlidppolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationsamlidppolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsamlidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationsamlidppolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationsamlidppolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationsamlidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlidppolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationsamlidppolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationsamlidppolicy_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-NSDeleteAuthenticationvserverAuthenticationsamlidppolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationsamlidppolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationsamlidppolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationsamlidppolicy_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-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding -GetAll
        Get all authenticationvserver_authenticationsamlidppolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding -Count
        Get the number of authenticationvserver_authenticationsamlidppolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding -name <string>
        Get authenticationvserver_authenticationsamlidppolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationsamlidppolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlidppolicy_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-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationsamlidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlidppolicy_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 authenticationvserver_authenticationsamlidppolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlidppolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlidppolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlidppolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlidppolicy_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-NSGetAuthenticationvserverAuthenticationsamlidppolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationsamlpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsamlpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationsamlpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationsamlpolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationsamlpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationsamlpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsamlpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationsamlpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationsamlpolicy_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-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsamlpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationsamlpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsamlpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationsamlpolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationsamlpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationsamlpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationsamlpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationsamlpolicy_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-NSDeleteAuthenticationvserverAuthenticationsamlpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationsamlpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationsamlpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationsamlpolicy_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-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding -GetAll
        Get all authenticationvserver_authenticationsamlpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding -Count
        Get the number of authenticationvserver_authenticationsamlpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding -name <string>
        Get authenticationvserver_authenticationsamlpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationsamlpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlpolicy_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-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationsamlpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlpolicy_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 authenticationvserver_authenticationsamlpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationsamlpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsamlpolicy_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-NSGetAuthenticationvserverAuthenticationsamlpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationsmartaccesspolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsmartaccesspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationsmartaccesspolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationsmartaccesspolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationsmartaccesspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationsmartaccesspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsmartaccesspolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationsmartaccesspolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationsmartaccesspolicy_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-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationsmartaccesspolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationsmartaccesspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationsmartaccesspolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationsmartaccesspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationsmartaccesspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsmartaccesspolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationsmartaccesspolicy_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-NSDeleteAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationsmartaccesspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationsmartaccesspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationsmartaccesspolicy_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-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding -GetAll
        Get all authenticationvserver_authenticationsmartaccesspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding -Count
        Get the number of authenticationvserver_authenticationsmartaccesspolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding -name <string>
        Get authenticationvserver_authenticationsmartaccesspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationsmartaccesspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsmartaccesspolicy_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-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationsmartaccesspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsmartaccesspolicy_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 authenticationvserver_authenticationsmartaccesspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsmartaccesspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationsmartaccesspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsmartaccesspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationsmartaccesspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationsmartaccesspolicy_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-NSGetAuthenticationvserverAuthenticationsmartaccesspolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationtacacspolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationtacacspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationtacacspolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationtacacspolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationtacacspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationtacacspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationtacacspolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationtacacspolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationtacacspolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationtacacspolicy_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-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationtacacspolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationtacacspolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationtacacspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationtacacspolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationtacacspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationtacacspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationtacacspolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationtacacspolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationtacacspolicy_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-NSDeleteAuthenticationvserverAuthenticationtacacspolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationtacacspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationtacacspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationtacacspolicy_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-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding -GetAll
        Get all authenticationvserver_authenticationtacacspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding -Count
        Get the number of authenticationvserver_authenticationtacacspolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding -name <string>
        Get authenticationvserver_authenticationtacacspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationtacacspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationtacacspolicy_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-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationtacacspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationtacacspolicy_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 authenticationvserver_authenticationtacacspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationtacacspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationtacacspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationtacacspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationtacacspolicy_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-NSGetAuthenticationvserverAuthenticationtacacspolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverAuthenticationwebauthpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationwebauthpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Applicable only to advance authentication policy. 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 priority number that is numerically higher than the highest 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 Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_authenticationwebauthpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverAuthenticationwebauthpolicyBinding -name <string>
        An example how to add authenticationvserver_authenticationwebauthpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverAuthenticationwebauthpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationwebauthpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationwebauthpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_authenticationwebauthpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_authenticationwebauthpolicy_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-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverAuthenticationwebauthpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverAuthenticationwebauthpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the authenticationwebauthpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Bind the authentication policy to the secondary chain. Provides for multifactor authentication in which a user must authenticate via both a primary authentication method and, afterward, via a secondary authentication method. Because user groups are aggregated across authentication systems, usernames must be the same on all authentication servers. Passwords can be different.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverAuthenticationwebauthpolicyBinding -Name <string>
        An example how to delete authenticationvserver_authenticationwebauthpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverAuthenticationwebauthpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationwebauthpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverAuthenticationwebauthpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_authenticationwebauthpolicy_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-NSDeleteAuthenticationvserverAuthenticationwebauthpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationwebauthpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_authenticationwebauthpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_authenticationwebauthpolicy_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-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding -GetAll
        Get all authenticationvserver_authenticationwebauthpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding -Count
        Get the number of authenticationvserver_authenticationwebauthpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding -name <string>
        Get authenticationvserver_authenticationwebauthpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_authenticationwebauthpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationwebauthpolicy_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-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_authenticationwebauthpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationwebauthpolicy_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 authenticationvserver_authenticationwebauthpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationwebauthpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_authenticationwebauthpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_authenticationwebauthpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_authenticationwebauthpolicy_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-NSGetAuthenticationvserverAuthenticationwebauthpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_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-NSGetAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverBinding -GetAll
        Get all authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverBinding -name <string>
        Get authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_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-NSGetAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_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 authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_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-NSGetAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverCachepolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the cachepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_cachepolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverCachepolicyBinding -name <string>
        An example how to add authenticationvserver_cachepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverCachepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cachepolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverCachepolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_cachepolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_cachepolicy_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-NSGetAuthenticationvserverCachepolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverCachepolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverCachepolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the cachepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverCachepolicyBinding -Name <string>
        An example how to delete authenticationvserver_cachepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverCachepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cachepolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverCachepolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_cachepolicy_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-NSDeleteAuthenticationvserverCachepolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverCachepolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the cachepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_cachepolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_cachepolicy_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-NSGetAuthenticationvserverCachepolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCachepolicyBinding -GetAll
        Get all authenticationvserver_cachepolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCachepolicyBinding -Count
        Get the number of authenticationvserver_cachepolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCachepolicyBinding -name <string>
        Get authenticationvserver_cachepolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCachepolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_cachepolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverCachepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cachepolicy_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-NSGetAuthenticationvserverCachepolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_cachepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cachepolicy_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 authenticationvserver_cachepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cachepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_cachepolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cachepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_cachepolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cachepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_cachepolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cachepolicy_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-NSGetAuthenticationvserverCachepolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverCspolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the cspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_cspolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverCspolicyBinding -name <string>
        An example how to add authenticationvserver_cspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverCspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cspolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverCspolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_cspolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_cspolicy_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-NSGetAuthenticationvserverCspolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverCspolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverCspolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the cspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverCspolicyBinding -Name <string>
        An example how to delete authenticationvserver_cspolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverCspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cspolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverCspolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_cspolicy_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-NSDeleteAuthenticationvserverCspolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverCspolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the cspolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_cspolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_cspolicy_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-NSGetAuthenticationvserverCspolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCspolicyBinding -GetAll
        Get all authenticationvserver_cspolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCspolicyBinding -Count
        Get the number of authenticationvserver_cspolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCspolicyBinding -name <string>
        Get authenticationvserver_cspolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverCspolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_cspolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverCspolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cspolicy_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-NSGetAuthenticationvserverCspolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_cspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cspolicy_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 authenticationvserver_cspolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_cspolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_cspolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_cspolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_cspolicy_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-NSGetAuthenticationvserverCspolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverResponderpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the responderpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_responderpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverResponderpolicyBinding -name <string>
        An example how to add authenticationvserver_responderpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverResponderpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_responderpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverResponderpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_responderpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_responderpolicy_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-NSGetAuthenticationvserverResponderpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverResponderpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverResponderpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the responderpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverResponderpolicyBinding -Name <string>
        An example how to delete authenticationvserver_responderpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverResponderpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_responderpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverResponderpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_responderpolicy_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-NSDeleteAuthenticationvserverResponderpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverResponderpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the responderpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_responderpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_responderpolicy_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-NSGetAuthenticationvserverResponderpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverResponderpolicyBinding -GetAll
        Get all authenticationvserver_responderpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverResponderpolicyBinding -Count
        Get the number of authenticationvserver_responderpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverResponderpolicyBinding -name <string>
        Get authenticationvserver_responderpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverResponderpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_responderpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverResponderpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_responderpolicy_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-NSGetAuthenticationvserverResponderpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_responderpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_responderpolicy_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 authenticationvserver_responderpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_responderpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_responderpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_responderpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_responderpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_responderpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_responderpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_responderpolicy_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-NSGetAuthenticationvserverResponderpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverRewritepolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the rewritepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_rewritepolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverRewritepolicyBinding -name <string>
        An example how to add authenticationvserver_rewritepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverRewritepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_rewritepolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverRewritepolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_rewritepolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_rewritepolicy_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-NSGetAuthenticationvserverRewritepolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverRewritepolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverRewritepolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the rewritepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bindpoint to which the policy is bound.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverRewritepolicyBinding -Name <string>
        An example how to delete authenticationvserver_rewritepolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverRewritepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_rewritepolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverRewritepolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_rewritepolicy_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-NSDeleteAuthenticationvserverRewritepolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverRewritepolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the rewritepolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_rewritepolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_rewritepolicy_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-NSGetAuthenticationvserverRewritepolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverRewritepolicyBinding -GetAll
        Get all authenticationvserver_rewritepolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverRewritepolicyBinding -Count
        Get the number of authenticationvserver_rewritepolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverRewritepolicyBinding -name <string>
        Get authenticationvserver_rewritepolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverRewritepolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_rewritepolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverRewritepolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_rewritepolicy_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-NSGetAuthenticationvserverRewritepolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_rewritepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_rewritepolicy_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 authenticationvserver_rewritepolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_rewritepolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_rewritepolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_rewritepolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_rewritepolicy_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-NSGetAuthenticationvserverRewritepolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverTmsessionpolicyBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the tmsessionpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Priority
        The priority, if any, of the vpn vserver policy.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Nextfactor
        Applicable only while binding advance authentication policy as classic authentication policy does not support nFactor.
    .PARAMETER Gotopriorityexpression
        Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .PARAMETER PassThru
        Return details about the created authenticationvserver_tmsessionpolicy_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverTmsessionpolicyBinding -name <string>
        An example how to add authenticationvserver_tmsessionpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverTmsessionpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_tmsessionpolicy_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]$Name,

        [string]$Policy,

        [double]$Priority,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Nextfactor,

        [string]$Gotopriorityexpression,

        [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')]
        [string]$Bindpoint,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverTmsessionpolicyBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) }
            if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) }
            if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) }
            if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) }
            if ( $PSBoundParameters.ContainsKey('nextfactor') ) { $payload.Add('nextfactor', $nextfactor) }
            if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) }
            if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_tmsessionpolicy_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_tmsessionpolicy_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-NSGetAuthenticationvserverTmsessionpolicyBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverTmsessionpolicyBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverTmsessionpolicyBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the tmsessionpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Policy
        The name of the policy, if any, bound to the authentication vserver.
    .PARAMETER Secondary
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Groupextraction
        Applicable only while bindind classic authentication policy as advance authentication policy use nFactor.
    .PARAMETER Bindpoint
        Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression.
        Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverTmsessionpolicyBinding -Name <string>
        An example how to delete authenticationvserver_tmsessionpolicy_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverTmsessionpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_tmsessionpolicy_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]$Policy,

        [boolean]$Secondary,

        [boolean]$Groupextraction,

        [string]$Bindpoint 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverTmsessionpolicyBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) }
            if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) }
            if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) }
            if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_tmsessionpolicy_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-NSDeleteAuthenticationvserverTmsessionpolicyBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the tmsessionpolicy that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_tmsessionpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_tmsessionpolicy_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-NSGetAuthenticationvserverTmsessionpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding -GetAll
        Get all authenticationvserver_tmsessionpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding -Count
        Get the number of authenticationvserver_tmsessionpolicy_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding -name <string>
        Get authenticationvserver_tmsessionpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_tmsessionpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverTmsessionpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_tmsessionpolicy_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-NSGetAuthenticationvserverTmsessionpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_tmsessionpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_tmsessionpolicy_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 authenticationvserver_tmsessionpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_tmsessionpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_tmsessionpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_tmsessionpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_tmsessionpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_tmsessionpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_tmsessionpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_tmsessionpolicy_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-NSGetAuthenticationvserverTmsessionpolicyBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationvserverVpnportalthemeBinding {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the vpnportaltheme that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Portaltheme
        Theme for Authentication virtual server Login portal.
    .PARAMETER PassThru
        Return details about the created authenticationvserver_vpnportaltheme_binding item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationvserverVpnportalthemeBinding -name <string>
        An example how to add authenticationvserver_vpnportaltheme_binding config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationvserverVpnportalthemeBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_vpnportaltheme_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]$Name,

        [string]$Portaltheme,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationvserverVpnportalthemeBinding: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('portaltheme') ) { $payload.Add('portaltheme', $portaltheme) }
            if ( $PSCmdlet.ShouldProcess("authenticationvserver_vpnportaltheme_binding", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationvserver_vpnportaltheme_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-NSGetAuthenticationvserverVpnportalthemeBinding -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationvserverVpnportalthemeBinding: Finished"
    }
}

function Invoke-NSDeleteAuthenticationvserverVpnportalthemeBinding {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Binding object showing the vpnportaltheme that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER Portaltheme
        Theme for Authentication virtual server Login portal.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationvserverVpnportalthemeBinding -Name <string>
        An example how to delete authenticationvserver_vpnportaltheme_binding config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationvserverVpnportalthemeBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_vpnportaltheme_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]$Portaltheme 
    )
    begin {
        Write-Verbose "Invoke-NSDeleteAuthenticationvserverVpnportalthemeBinding: Starting"
    }
    process {
        try {
            $arguments = @{ }
            if ( $PSBoundParameters.ContainsKey('Portaltheme') ) { $arguments.Add('portaltheme', $Portaltheme) }
            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationvserver_vpnportaltheme_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-NSDeleteAuthenticationvserverVpnportalthemeBinding: Finished"
    }
}

function Invoke-NSGetAuthenticationvserverVpnportalthemeBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnportaltheme that can be bound to authenticationvserver.
    .PARAMETER Name
        Name of the authentication virtual server to which to bind the policy.
    .PARAMETER GetAll
        Retrieve all authenticationvserver_vpnportaltheme_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationvserver_vpnportaltheme_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-NSGetAuthenticationvserverVpnportalthemeBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverVpnportalthemeBinding -GetAll
        Get all authenticationvserver_vpnportaltheme_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverVpnportalthemeBinding -Count
        Get the number of authenticationvserver_vpnportaltheme_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverVpnportalthemeBinding -name <string>
        Get authenticationvserver_vpnportaltheme_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationvserverVpnportalthemeBinding -Filter @{ 'name'='<value>' }
        Get authenticationvserver_vpnportaltheme_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationvserverVpnportalthemeBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_vpnportaltheme_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-NSGetAuthenticationvserverVpnportalthemeBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationvserver_vpnportaltheme_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_vpnportaltheme_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 authenticationvserver_vpnportaltheme_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationvserver_vpnportaltheme_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationvserver_vpnportaltheme_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationvserver_vpnportaltheme_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationvserver_vpnportaltheme_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-NSGetAuthenticationvserverVpnportalthemeBinding: Ended"
    }
}

function Invoke-NSAddAuthenticationwebauthaction {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication action resource.
    .PARAMETER Name
        Name for the Web Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Serverip
        IP address of the web server to be used for authentication.
    .PARAMETER Serverport
        Port on which the web server accepts connections.
    .PARAMETER Fullreqexpr
        Exact HTTP request, in the form of an expression, which the Citrix ADC sends to the authentication server.
        The Citrix ADC does not check the validity of this request. One must manually validate the request.
    .PARAMETER Scheme
        Type of scheme for the web server.
        Possible values = http, https
    .PARAMETER Successrule
        Expression, that checks to see if authentication is successful.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the webauth response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the webauth response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the webauth response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the webauth response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the webauth response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the webauth response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the webauth response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the webauth response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the webauth response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the webauth response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the webauth response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the webauth response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the webauth response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the webauth response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the webauth response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the webauth response.
    .PARAMETER PassThru
        Return details about the created authenticationwebauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationwebauthaction -name <string> -serverip <string> -serverport <int> -scheme <string> -successrule <string>
        An example how to add authenticationwebauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationwebauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction/
        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]$Name,

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

        [Parameter(Mandatory)]
        [ValidateRange(1, 65535)]
        [int]$Serverport,

        [string]$Fullreqexpr,

        [Parameter(Mandatory)]
        [ValidateSet('http', 'https')]
        [string]$Scheme,

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

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationwebauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                serverip       = $serverip
                serverport     = $serverport
                scheme         = $scheme
                successrule    = $successrule
            }
            if ( $PSBoundParameters.ContainsKey('fullreqexpr') ) { $payload.Add('fullreqexpr', $fullreqexpr) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSCmdlet.ShouldProcess("authenticationwebauthaction", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationwebauthaction -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-NSGetAuthenticationwebauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationwebauthaction: Finished"
    }
}

function Invoke-NSDeleteAuthenticationwebauthaction {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication action resource.
    .PARAMETER Name
        Name for the Web Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationwebauthaction -Name <string>
        An example how to delete authenticationwebauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationwebauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction/
        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-NSDeleteAuthenticationwebauthaction: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationwebauthaction -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-NSDeleteAuthenticationwebauthaction: Finished"
    }
}

function Invoke-NSUpdateAuthenticationwebauthaction {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication action resource.
    .PARAMETER Name
        Name for the Web Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Serverip
        IP address of the web server to be used for authentication.
    .PARAMETER Serverport
        Port on which the web server accepts connections.
    .PARAMETER Fullreqexpr
        Exact HTTP request, in the form of an expression, which the Citrix ADC sends to the authentication server.
        The Citrix ADC does not check the validity of this request. One must manually validate the request.
    .PARAMETER Scheme
        Type of scheme for the web server.
        Possible values = http, https
    .PARAMETER Successrule
        Expression, that checks to see if authentication is successful.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the webauth response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the webauth response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the webauth response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the webauth response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the webauth response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the webauth response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the webauth response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the webauth response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the webauth response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the webauth response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the webauth response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the webauth response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the webauth response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the webauth response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the webauth response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the webauth response.
    .PARAMETER PassThru
        Return details about the created authenticationwebauthaction item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationwebauthaction -name <string>
        An example how to update authenticationwebauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationwebauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction/
        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]$Name,

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

        [ValidateRange(1, 65535)]
        [int]$Serverport,

        [string]$Fullreqexpr,

        [ValidateSet('http', 'https')]
        [string]$Scheme,

        [string]$Successrule,

        [string]$Defaultauthenticationgroup,

        [string]$Attribute1,

        [string]$Attribute2,

        [string]$Attribute3,

        [string]$Attribute4,

        [string]$Attribute5,

        [string]$Attribute6,

        [string]$Attribute7,

        [string]$Attribute8,

        [string]$Attribute9,

        [string]$Attribute10,

        [string]$Attribute11,

        [string]$Attribute12,

        [string]$Attribute13,

        [string]$Attribute14,

        [string]$Attribute15,

        [string]$Attribute16,

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationwebauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('fullreqexpr') ) { $payload.Add('fullreqexpr', $fullreqexpr) }
            if ( $PSBoundParameters.ContainsKey('scheme') ) { $payload.Add('scheme', $scheme) }
            if ( $PSBoundParameters.ContainsKey('successrule') ) { $payload.Add('successrule', $successrule) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSCmdlet.ShouldProcess("authenticationwebauthaction", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationwebauthaction -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-NSGetAuthenticationwebauthaction -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationwebauthaction: Finished"
    }
}

function Invoke-NSUnsetAuthenticationwebauthaction {
    <#
    .SYNOPSIS
        Unset Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication action resource.
    .PARAMETER Name
        Name for the Web Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER Serverip
        IP address of the web server to be used for authentication.
    .PARAMETER Serverport
        Port on which the web server accepts connections.
    .PARAMETER Fullreqexpr
        Exact HTTP request, in the form of an expression, which the Citrix ADC sends to the authentication server.
        The Citrix ADC does not check the validity of this request. One must manually validate the request.
    .PARAMETER Defaultauthenticationgroup
        This is the default group that is chosen when the authentication succeeds in addition to extracted groups.
    .PARAMETER Attribute1
        Expression that would be evaluated to extract attribute1 from the webauth response.
    .PARAMETER Attribute2
        Expression that would be evaluated to extract attribute2 from the webauth response.
    .PARAMETER Attribute3
        Expression that would be evaluated to extract attribute3 from the webauth response.
    .PARAMETER Attribute4
        Expression that would be evaluated to extract attribute4 from the webauth response.
    .PARAMETER Attribute5
        Expression that would be evaluated to extract attribute5 from the webauth response.
    .PARAMETER Attribute6
        Expression that would be evaluated to extract attribute6 from the webauth response.
    .PARAMETER Attribute7
        Expression that would be evaluated to extract attribute7 from the webauth response.
    .PARAMETER Attribute8
        Expression that would be evaluated to extract attribute8 from the webauth response.
    .PARAMETER Attribute9
        Expression that would be evaluated to extract attribute9 from the webauth response.
    .PARAMETER Attribute10
        Expression that would be evaluated to extract attribute10 from the webauth response.
    .PARAMETER Attribute11
        Expression that would be evaluated to extract attribute11 from the webauth response.
    .PARAMETER Attribute12
        Expression that would be evaluated to extract attribute12 from the webauth response.
    .PARAMETER Attribute13
        Expression that would be evaluated to extract attribute13 from the webauth response.
    .PARAMETER Attribute14
        Expression that would be evaluated to extract attribute14 from the webauth response.
    .PARAMETER Attribute15
        Expression that would be evaluated to extract attribute15 from the webauth response.
    .PARAMETER Attribute16
        Expression that would be evaluated to extract attribute16 from the webauth response.
    .EXAMPLE
        PS C:\>Invoke-NSUnsetAuthenticationwebauthaction -name <string>
        An example how to unset authenticationwebauthaction config Object(s).
    .NOTES
        File Name : Invoke-NSUnsetAuthenticationwebauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction
        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]$Name,

        [Boolean]$serverip,

        [Boolean]$serverport,

        [Boolean]$fullreqexpr,

        [Boolean]$defaultauthenticationgroup,

        [Boolean]$attribute1,

        [Boolean]$attribute2,

        [Boolean]$attribute3,

        [Boolean]$attribute4,

        [Boolean]$attribute5,

        [Boolean]$attribute6,

        [Boolean]$attribute7,

        [Boolean]$attribute8,

        [Boolean]$attribute9,

        [Boolean]$attribute10,

        [Boolean]$attribute11,

        [Boolean]$attribute12,

        [Boolean]$attribute13,

        [Boolean]$attribute14,

        [Boolean]$attribute15,

        [Boolean]$attribute16 
    )
    begin {
        Write-Verbose "Invoke-NSUnsetAuthenticationwebauthaction: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) }
            if ( $PSBoundParameters.ContainsKey('serverport') ) { $payload.Add('serverport', $serverport) }
            if ( $PSBoundParameters.ContainsKey('fullreqexpr') ) { $payload.Add('fullreqexpr', $fullreqexpr) }
            if ( $PSBoundParameters.ContainsKey('defaultauthenticationgroup') ) { $payload.Add('defaultauthenticationgroup', $defaultauthenticationgroup) }
            if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) }
            if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) }
            if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) }
            if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) }
            if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) }
            if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) }
            if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) }
            if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) }
            if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) }
            if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) }
            if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) }
            if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) }
            if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) }
            if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) }
            if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) }
            if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) }
            if ( $PSCmdlet.ShouldProcess("$name", "Unset Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type authenticationwebauthaction -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-NSUnsetAuthenticationwebauthaction: Finished"
    }
}

function Invoke-NSGetAuthenticationwebauthaction {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Web authentication action resource.
    .PARAMETER Name
        Name for the Web Authentication action.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthaction object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthaction 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-NSGetAuthenticationwebauthaction
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthaction -GetAll
        Get all authenticationwebauthaction data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthaction -Count
        Get the number of authenticationwebauthaction objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthaction -name <string>
        Get authenticationwebauthaction object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthaction -Filter @{ 'name'='<value>' }
        Get authenticationwebauthaction data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthaction
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationwebauthaction: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationwebauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthaction -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 authenticationwebauthaction objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthaction objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthaction configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthaction configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthaction -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-NSGetAuthenticationwebauthaction: Ended"
    }
}

function Invoke-NSAddAuthenticationwebauthpolicy {
    <#
    .SYNOPSIS
        Add Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication policy resource.
    .PARAMETER Name
        Name for the WebAuth policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the Web server.
    .PARAMETER Action
        Name of the WebAuth action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationwebauthpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSAddAuthenticationwebauthpolicy -name <string> -rule <string> -action <string>
        An example how to add authenticationwebauthpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSAddAuthenticationwebauthpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSAddAuthenticationwebauthpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name
                rule           = $rule
                action         = $action
            }

            if ( $PSCmdlet.ShouldProcess("authenticationwebauthpolicy", "Add Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type authenticationwebauthpolicy -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-NSGetAuthenticationwebauthpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSAddAuthenticationwebauthpolicy: Finished"
    }
}

function Invoke-NSDeleteAuthenticationwebauthpolicy {
    <#
    .SYNOPSIS
        Delete Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication policy resource.
    .PARAMETER Name
        Name for the WebAuth policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .EXAMPLE
        PS C:\>Invoke-NSDeleteAuthenticationwebauthpolicy -Name <string>
        An example how to delete authenticationwebauthpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSDeleteAuthenticationwebauthpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy/
        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-NSDeleteAuthenticationwebauthpolicy: Starting"
    }
    process {
        try {
            $arguments = @{ }

            if ( $PSCmdlet.ShouldProcess("$name", "Delete Authentication configuration. config Object") ) {
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type authenticationwebauthpolicy -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-NSDeleteAuthenticationwebauthpolicy: Finished"
    }
}

function Invoke-NSUpdateAuthenticationwebauthpolicy {
    <#
    .SYNOPSIS
        Update Authentication configuration. config Object.
    .DESCRIPTION
        Configuration for Web authentication policy resource.
    .PARAMETER Name
        Name for the WebAuth policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER Rule
        Name of the Citrix ADC named rule, or an expression, that the policy uses to determine whether to attempt to authenticate the user with the Web server.
    .PARAMETER Action
        Name of the WebAuth action to perform if the policy matches.
    .PARAMETER PassThru
        Return details about the created authenticationwebauthpolicy item.
    .EXAMPLE
        PS C:\>Invoke-NSUpdateAuthenticationwebauthpolicy -name <string>
        An example how to update authenticationwebauthpolicy config Object(s).
    .NOTES
        File Name : Invoke-NSUpdateAuthenticationwebauthpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy/
        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]$Name,

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

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

        [Switch]$PassThru 
    )
    begin {
        Write-Verbose "Invoke-NSUpdateAuthenticationwebauthpolicy: Starting"
    }
    process {
        try {
            $payload = @{ name = $name }
            if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) }
            if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) }
            if ( $PSCmdlet.ShouldProcess("authenticationwebauthpolicy", "Update Authentication configuration. config Object") ) {
                $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type authenticationwebauthpolicy -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-NSGetAuthenticationwebauthpolicy -Filter $payload)
                } else {
                    Write-Output $result
                }
            }
        } catch {
            Write-Verbose "ERROR: $($_.Exception.Message)"
            throw $_
        }
    }
    end {
        Write-Verbose "Invoke-NSUpdateAuthenticationwebauthpolicy: Finished"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicy {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Configuration for Web authentication policy resource.
    .PARAMETER Name
        Name for the WebAuth policy.
        Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after LDAP policy is created.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy 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-NSGetAuthenticationwebauthpolicy
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicy -GetAll
        Get all authenticationwebauthpolicy data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicy -Count
        Get the number of authenticationwebauthpolicy objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicy -name <string>
        Get authenticationwebauthpolicy object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicy -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicy
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy/
        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,

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

    )
    begin {
        Write-Verbose "Invoke-NSGetAuthenticationwebauthpolicy: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{ }
                Write-Verbose "Retrieving all authenticationwebauthpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy -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 authenticationwebauthpolicy objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy -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-NSGetAuthenticationwebauthpolicy: Ended"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the authenticationvserver that can be bound to authenticationwebauthpolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy_authenticationvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy_authenticationvserver_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-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding -GetAll
        Get all authenticationwebauthpolicy_authenticationvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding -Count
        Get the number of authenticationwebauthpolicy_authenticationvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding -name <string>
        Get authenticationwebauthpolicy_authenticationvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy_authenticationvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_authenticationvserver_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-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationwebauthpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_authenticationvserver_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 authenticationwebauthpolicy_authenticationvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_authenticationvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_authenticationvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_authenticationvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy_authenticationvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_authenticationvserver_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-NSGetAuthenticationwebauthpolicyAuthenticationvserverBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicyBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object which returns the resources bound to authenticationwebauthpolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy_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-NSGetAuthenticationwebauthpolicyBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyBinding -GetAll
        Get all authenticationwebauthpolicy_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyBinding -name <string>
        Get authenticationwebauthpolicy_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyBinding -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicyBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_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-NSGetAuthenticationwebauthpolicyBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationwebauthpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_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 authenticationwebauthpolicy_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_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-NSGetAuthenticationwebauthpolicyBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the systemglobal that can be bound to authenticationwebauthpolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy_systemglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy_systemglobal_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-NSGetAuthenticationwebauthpolicySystemglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding -GetAll
        Get all authenticationwebauthpolicy_systemglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding -Count
        Get the number of authenticationwebauthpolicy_systemglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding -name <string>
        Get authenticationwebauthpolicy_systemglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy_systemglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicySystemglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_systemglobal_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-NSGetAuthenticationwebauthpolicySystemglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationwebauthpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_systemglobal_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 authenticationwebauthpolicy_systemglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_systemglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_systemglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_systemglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_systemglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_systemglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy_systemglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_systemglobal_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-NSGetAuthenticationwebauthpolicySystemglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnglobal that can be bound to authenticationwebauthpolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy_vpnglobal_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy_vpnglobal_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-NSGetAuthenticationwebauthpolicyVpnglobalBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding -GetAll
        Get all authenticationwebauthpolicy_vpnglobal_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding -Count
        Get the number of authenticationwebauthpolicy_vpnglobal_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding -name <string>
        Get authenticationwebauthpolicy_vpnglobal_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy_vpnglobal_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicyVpnglobalBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_vpnglobal_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-NSGetAuthenticationwebauthpolicyVpnglobalBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationwebauthpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnglobal_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 authenticationwebauthpolicy_vpnglobal_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnglobal_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnglobal_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnglobal_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnglobal_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-NSGetAuthenticationwebauthpolicyVpnglobalBinding: Ended"
    }
}

function Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding {
    <#
    .SYNOPSIS
        Get Authentication configuration. config object(s).
    .DESCRIPTION
        Binding object showing the vpnvserver that can be bound to authenticationwebauthpolicy.
    .PARAMETER Name
        Name of the WebAuth policy.
    .PARAMETER GetAll
        Retrieve all authenticationwebauthpolicy_vpnvserver_binding object(s).
    .PARAMETER Count
        If specified, the count of the authenticationwebauthpolicy_vpnvserver_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-NSGetAuthenticationwebauthpolicyVpnvserverBinding
        Get data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding -GetAll
        Get all authenticationwebauthpolicy_vpnvserver_binding data.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding -Count
        Get the number of authenticationwebauthpolicy_vpnvserver_binding objects.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding -name <string>
        Get authenticationwebauthpolicy_vpnvserver_binding object by specifying for example the name.
    .EXAMPLE
        PS C:\>Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding -Filter @{ 'name'='<value>' }
        Get authenticationwebauthpolicy_vpnvserver_binding data with a filter.
    .NOTES
        File Name : Invoke-NSGetAuthenticationwebauthpolicyVpnvserverBinding
        Version : v2311.2021
        Author : John Billekens
        Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_vpnvserver_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-NSGetAuthenticationwebauthpolicyVpnvserverBinding: Beginning"
    }
    process {
        try {
            if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) {
                $query = @{  bulkbindings = 'yes' }
                Write-Verbose "Retrieving all authenticationwebauthpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnvserver_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 authenticationwebauthpolicy_vpnvserver_binding objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnvserver_binding objects by arguments"
                $arguments = @{ } 
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning
            } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnvserver_binding configuration for property 'name'"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning
            } else {
                Write-Verbose "Retrieving authenticationwebauthpolicy_vpnvserver_binding configuration objects"
                $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type authenticationwebauthpolicy_vpnvserver_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-NSGetAuthenticationwebauthpolicyVpnvserverBinding: Ended"
    }
}

# SIG # Begin signature block
# MIIkmgYJKoZIhvcNAQcCoIIkizCCJIcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDSqyFzm4NkK5oz
# v77aiXC3NPU0/GcO1K/usQHpn55h86CCHl4wggTzMIID26ADAgECAhAsJ03zZBC0
# 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
# hkiG9w0BCQQxIgQgdzQsi1IFlHlgWHPPg9EUzbHoe3wKgkkQP56kv43SRz8wDQYJ
# KoZIhvcNAQEBBQAEggEAjQJYTOCU0oJoFbANjYB/kLKhvQGPbRFu7M0TqaDUYNBt
# Qc5MKdxxgpqD0bHA4iuGSfaXDfKIk0FxdsojVYdFzvHnDFKniofVALxDCgDWtpt3
# m8ycC+1EbpSvh0t35PgiyCCcIGIHgYhieWQccrRCITmmsMkvKqfWmobpJqBSeyzp
# S9nWExkGJXuwjh1jcTofuAR24CHjMtbJvQj93I07o0hnOEDme1xXVq9NdQBtU9Vm
# /Bu8Di08DpqSPJr0JefGQOE0riTJj8LwPHphed0I9F1cEYQy784MgiN7XvO7+m0r
# euCd+VuWjcvY3ZIDn501mwtaehDlgUcI6nRxe2XmGaGCA0swggNHBgkqhkiG9w0B
# CQYxggM4MIIDNAIBATCBkTB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRl
# ciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdv
# IExpbWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EC
# EDlMJeF8oG0nqGXiO9kdItQwDQYJYIZIAWUDBAICBQCgeTAYBgkqhkiG9w0BCQMx
# CwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzExMjAyMDQxMzFaMD8GCSqG
# SIb3DQEJBDEyBDBQyy/+f0yjS+hYHYcjcoA68JOsztRQNgGob381C9S8QjTzJM5u
# qaTvAq1Io9sl9WkwDQYJKoZIhvcNAQEBBQAEggIAluUUOPBDe4tJtbQT8sps/Nl/
# 4eT3n1Yzhtc7NSdQGQSNwp32iRMTVoDOEbAwNEDB936Yxw21jEveLRtz5SqzaVH4
# reySmWGLqZ5t7Mh3ogsr2R1kN4R/kTtcaau/YPs33om56MQ1TH5/vhlgrPFAIcYl
# dSNPj685217o4SdOKqE/zx2EMTMcfV45laFEHgj9qFda6j8ImUYHMP3lZsCbz7yj
# a2esCBYEvUaShVtOpVnULHlNu7jTOOQHvxpLor/YePhcBg6o4S8bI0OvY4neoJWo
# RDo92qVahtU8Ti0wsht8RdxCcldFDuhYEW9Yu2DP8UkJZdJhQVHOg2E6z1cPY5yp
# GiCPTnnW5cihdRF0ZZ1s02Kal/+F2zN3KDeR/GVWuJ0i67N3Hrdeg7UXk74bqeWA
# n/UGKYoqPc9ERNdyvhKvI5IBa6zZac71c69hHTf75TFBdAjjAq/2D5DmKobahRxG
# XwsmIwmGyFUwAlrXLdTAiJM93Bh7ptpWUKP8/q4o3RIq9hBScnqWTGBqfqYej8pe
# nZUi+bVWswOtQ7CE4tZxTbkvo4dPMFVKiljyV3i4XS5ur9y1+lIW51iKwhpi4ppr
# H43g7318cyZNLj+f/4dsgfdQtUpQDmuZODHGmRjflqogHDeYMR5LCHCs9MzIEvzB
# me5DkGyOWgtlJhz2fHk=
# SIG # End signature block