Create Get-ZAProtectedVmReport.ps1

This commit is contained in:
Wes Carroll
2020-04-02 15:12:52 -04:00
parent 69fb384c89
commit 8e5ced9b87
@@ -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 {
}
}