Files
ZertoApiWrapper/ZertoApiWrapper/Public/Set-ZertoLicense.ps1
T
2019-04-16 22:46:21 -04:00

27 lines
659 B
PowerShell

<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
function Set-ZertoLicense {
[cmdletbinding( SupportsShouldProcess = $true )]
param (
[Parameter(
Mandatory = $true,
HelpMessage = "License Key to apply to the Zerto Virtual Manager"
)]
[ValidateNotNullOrEmpty()]
[string]$licenseKey
)
begin {
$baseUri = "license"
$body = @{"LicenseKey" = $licenseKey}
}
process {
if ($PSCmdlet.ShouldProcess()) {
Invoke-ZertoRestRequest -uri $baseUri -body $($body | ConvertTo-Json) -method "PUT"
}
}
end {
# Nothing to do
}
}