diff --git a/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 new file mode 100644 index 0000000..b79fa34 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAProtectedVmReport { + [cmdletbinding()] + param( + [Parameter( + ParameterSetName = "GenerateReport", + Mandatory, + HelpMessage = "A list of VM identifiers to include in the report." + )] + [string[]]$VMIdentifier + ) + + Begin { + + } + + Process { + $BaseUri = "monitoring/protected-vms" + $Body = @{ + vmsIdentifiers = $VMIdentifier + } + $reportId = Invoke-ZARestRequest -uri $BaseUri -method POST -body ($Body | ConvertTo-Json) + Start-Sleep 1 + $Uri = "{0}?reportId={1}" -f $BaseUri, $reportId.reportId + Invoke-ZARestRequest -uri $Uri + } + + End { + + } +}