Initial Commit to Dedicated Repo
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
function Get-ZertoServiceProfile {
|
||||
[cmdletbinding( DefaultParameterSetName = "main" )]
|
||||
param (
|
||||
[Parameter( ParameterSetName = "siteIdentifier" )]
|
||||
[string]$siteIdentifier,
|
||||
[Parameter( ParameterSetName = "serviceProfileId" )]
|
||||
[string[]]$serviceProfileId
|
||||
)
|
||||
|
||||
begin {
|
||||
$baseUri = "serviceprofiles"
|
||||
$returnObject = [System.Collections.ArrayList]@()
|
||||
}
|
||||
|
||||
process {
|
||||
switch ( $PSCmdlet.ParameterSetName ) {
|
||||
"siteIdentifier" {
|
||||
$uri = "{0}?site={1}" -f $baseUri, $siteIdentifier
|
||||
$results = Invoke-ZertoRestRequest -uri $uri
|
||||
$returnObject.Add($results) | Out-Null
|
||||
}
|
||||
|
||||
"serviceProfileId" {
|
||||
foreach ( $id in $serviceProfileId ) {
|
||||
$uri = "{0}/{1}" -f $baseUri, $id
|
||||
$results = Invoke-ZertoRestRequest -uri $uri
|
||||
$returnObject.Add($results)
|
||||
}
|
||||
}
|
||||
|
||||
default {
|
||||
$results = Invoke-ZertoRestRequest -uri $baseUri
|
||||
$returnObject.Add($results) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end {
|
||||
return $returnObject
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user