Create Get-ZATask files and content

This commit is contained in:
Wes Carroll
2019-06-06 13:59:13 -04:00
parent 4fc6c9ebcd
commit 0e148bdb1b
3 changed files with 170 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
function Get-ZATask {
[cmdletbinding( DefaultParameterSetName = "zOrg")]
param(
[Parameter(
HelpMessage = "The ZORG identifier by which to filter the task list. If the ZORG identifier is omitted, a list of all the tasks is retrieved.",
ParameterSetName = "zOrg"
)]
[ValidateNotNullOrEmpty()]
[string]$zOrgIdentifier,
[Parameter(
HelpMessage = "The maximum number of tasks to return.",
ParameterSetName = "zOrg"
)]
[ValidateRange(1, 1000000)]
[int]$limitTo,
[Parameter(
HelpMessage = "The task Idnetifier",
ParameterSetName = "taskId",
Mandatory = $true
)]
[ValidateNotNullOrEmpty()]
[string]$taskIdentifier
)
$uri = "monitoring/tasks"
switch ($PSCmdlet.ParameterSetName) {
zOrg {
if ( $PSBoundParameters.Keys.Count -gt 0 ) {
$filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters
$uri = "{0}{1}" -f $uri, $filterString
}
}
taskId {
$uri = "{0}/{1}" -f $uri, $taskIdentifier
}
}
Invoke-ZARestRequest -uri $uri
}