Create Set-ZertoLicense and Tests

This commit is contained in:
Wes Carroll
2019-02-24 20:35:38 -05:00
parent 89bb9704df
commit ddc940f7a6
2 changed files with 47 additions and 0 deletions
@@ -0,0 +1,25 @@
function Set-ZertoLicense {
[cmdletbinding( SupportsShouldProcess = $true )]
param (
[Parameter(
Mandatory = $true,
HelpMessage = "License Key to apply to the Zerto Virtual Manager"
)]
[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
}
}