functions/Get-VaoFailoverPlan.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Function Get-VaoFailoverPlan {
    <#
    .DESCRIPTION
        Get Veeam Availability Orchestrator Failover Plans
 
    .NOTES
        File Name : Get-VaoFailoverPlan.psm1
        Author : Markus Kraus
        Version : 1.0
        State : Ready
 
    .LINK
        https://mycloudrevolution.com/
 
    .EXAMPLE
        Get-VaoFailoverPlan | Select-Object name, id, planState, planStateDetails, scheduleEnabled, siteId | ft -AutoSize
 
    .EXAMPLE
        Get-VaoFailoverPlan -SiteID 850316df-d73f-4e8b-b8bc-7b1815fb0a9e | Select-Object name, id, planState, planStateDetails, scheduleEnabled, siteId | ft -AutoSize
 
    .PARAMETER SiteID
        Optional Veeam Availability Orchestrator Site ID
 
    #>

        Param (
            [Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="Optional Veeam Availability Orchestrator Site ID")]
            [ValidateNotNullorEmpty()]
                [String]$SiteID
        )
        Process {
            if ($SiteID) {
                $Return = Invoke-VaoApiCall -Uri "/v1/Sites/$SiteID/FailoverPlans" -Method Get
            }
            else {
                $Return = Invoke-VaoApiCall -Uri "/v1/FailoverPlans" -Method Get
            }

            $Return
        }
    }