Files
ZertoApiWrapper/ZertoApiWrapper/Public/Get-ZertoServiceProfile.ps1
T
Wes Carroll 59a0a53812 Help system (#4)
* Establish a help system

* Continue to update Help System

* Update Get-ZertoAlert.md

* Update Get-ZertoDatastore.md

* Add Link to Zerto API for Datastores

* Update Get-ZertoLicense.md

* Update Links to Zerto API documentation

* Update the Readme Information

* Continue to update README

* Update README

* Update README.md

* Update Help Markdown Files

* Correct API URL

* Update ZertoApiWrapper-help.xml

* Update Get-ZertoProtectedVm.md

* Update Help Markdown files

* Update Get-ZertoVpgSetting.md

* Added online url to each help object.

* Update Help Markdown Files

* Update ZertoApiWrapper-help.xml
2019-03-06 20:50:14 -05:00

46 lines
1.3 KiB
PowerShell

<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
function Get-ZertoServiceProfile {
[cmdletbinding( DefaultParameterSetName = "main" )]
param (
[Parameter(
ParameterSetName = "siteIdentifier",
HelpMessage = "The identifier of the site for which service profiles should be returned."
)]
[string]$siteIdentifier,
[Parameter(
ParameterSetName = "serviceProfileId",
HelpMessage = "The service profile ID for which information should be returned."
)]
[string[]]$serviceProfileId
)
begin {
$baseUri = "serviceprofiles"
$returnObject = [System.Collections.ArrayList]@()
}
process {
switch ( $PSCmdlet.ParameterSetName ) {
"siteIdentifier" {
$uri = "{0}?site={1}" -f $baseUri, $siteIdentifier
$returnObject = Invoke-ZertoRestRequest -uri $uri
}
"serviceProfileId" {
$returnObject = foreach ( $id in $serviceProfileId ) {
$uri = "{0}/{1}" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri
}
}
default {
$returnObject = Invoke-ZertoRestRequest -uri $baseUri
}
}
}
end {
return $returnObject
}
}