Private/Set-ADCGSLBvServerBackup.ps1

function Set-ADCGSLBvServerBackup {
    <#
.SYNOPSIS
    Sets (Binds) a backup GSLB Virtual Server to a Primary GSLB Virtual Server.
.DESCRIPTION
    Sets (Binds) a backup GSLB Virtual Server to a Primary GSLB Virtual Server.
.PARAMETER Session
    The Citrix ADC Session to execute the function against.
.PARAMETER vServerName
    The GSLB Virtual Server Name.
.PARAMETER BackupvServerName
    The Backup GSLB Virtual Server Name.
.NOTES
    Creation Date: 20/06/2018
.CHANGE CONTROL
    Name Version Date Change Detail
    David Brett 1.0 29/03/2018 Function Creation
.EXAMPLE
    Set-ADCGSLBvServerBackup -vServerName "gslb_vsvr_citrix_storefront_london" -BackupvServerName "gslb_vsvr_citrix_storefront_kansas_city" -Verbose
#>


    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
    Param (
        $Session = $script:session,
        [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName)]
        [string[]]$vServerName = (Read-Host -Prompt 'Enter Primary GSLB Virtual Server Name'),
        [string[]]$BackupvServerName = (Read-Host -Prompt 'Enter Backup GSLB Virtual Server Name')
    )

    begin {
        $PayLoad = @{
            name          = "$vServerName"
            backupvserver = "$BackupvServerName"
        }
    }

    process {
        try {
            if ($Force -or $PSCmdlet.ShouldProcess("ShouldProcess?")) {
                Invoke-ADCRestAPI -Session $Session -Method PUT -Type "gslbvserver" -Payload $PayLoad
                write-verbose "GSLB Backup vServer ($BackupvServerName) bound to GSLB Primary vServer ($vServerName)"
            }
        }
        catch {
            write-verbose "GSLB Backup vServer ($BackupvServerName) could not be bound to GSLB Primary vServer ($vServerName)"
        }
    }

    end {
    }

}