|
| 1 | + |
| 2 | +# ---------------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code |
| 14 | +# is regenerated. |
| 15 | +# ---------------------------------------------------------------------------------- |
| 16 | + |
| 17 | +<# |
| 18 | +.Synopsis |
| 19 | +Create an in-memory object for Vcf5License. |
| 20 | +.Description |
| 21 | +Create an in-memory object for a VMware Cloud Foundation (VCF) 5.0 license, to be passed to New-AzVMwarePrivateCloud via the -VcfLicense parameter. |
| 22 | +.Example |
| 23 | +$license = New-AzVMwareVcf5LicenseObject -Core 16 -EndDate (Get-Date "2027-01-01") -LicenseKey "12345-12345-12345-12345-12345" -BroadcomSiteId "site123" -BroadcomContractNumber "contract123" |
| 24 | +New-AzVMwarePrivateCloud -Name mycloud -ResourceGroupName myrg -Location eastus -Sku av36 -ManagementClusterSize 3 -NetworkBlock 192.168.48.0/22 -VcfLicense $license -AcceptEULA |
| 25 | +
|
| 26 | +.Outputs |
| 27 | +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Vcf5License |
| 28 | +.Link |
| 29 | +https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwarevcf5licenseobject |
| 30 | +#> |
| 31 | +function New-AzVMwareVcf5LicenseObject { |
| 32 | + [Microsoft.Azure.PowerShell.Cmdlets.VMware.ModelCmdletAttribute()] |
| 33 | + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Vcf5License')] |
| 34 | + [CmdletBinding(PositionalBinding=$false)] |
| 35 | + Param( |
| 36 | + [Parameter(Mandatory, HelpMessage="Number of cores included in the license.")] |
| 37 | + [int] |
| 38 | + $Core, |
| 39 | + |
| 40 | + [Parameter(Mandatory, HelpMessage="UTC datetime when the license expires.")] |
| 41 | + [System.DateTime] |
| 42 | + $EndDate, |
| 43 | + |
| 44 | + [Parameter(HelpMessage="License key.")] |
| 45 | + [System.Security.SecureString] |
| 46 | + $LicenseKey, |
| 47 | + |
| 48 | + [Parameter(HelpMessage="The Broadcom site ID associated with the license.")] |
| 49 | + [string] |
| 50 | + $BroadcomSiteId, |
| 51 | + |
| 52 | + [Parameter(HelpMessage="The Broadcom contract number associated with the license.")] |
| 53 | + [string] |
| 54 | + $BroadcomContractNumber |
| 55 | + ) |
| 56 | + |
| 57 | + process { |
| 58 | + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Vcf5License]::New() |
| 59 | + |
| 60 | + $Object.Core = $Core |
| 61 | + $Object.EndDate = $EndDate |
| 62 | + |
| 63 | + if ($PSBoundParameters.ContainsKey('LicenseKey')) { |
| 64 | + $Object.LicenseKey = $LicenseKey |
| 65 | + } |
| 66 | + if ($PSBoundParameters.ContainsKey('BroadcomSiteId')) { |
| 67 | + $Object.BroadcomSiteId = $BroadcomSiteId |
| 68 | + } |
| 69 | + if ($PSBoundParameters.ContainsKey('BroadcomContractNumber')) { |
| 70 | + $Object.BroadcomContractNumber = $BroadcomContractNumber |
| 71 | + } |
| 72 | + return $Object |
| 73 | + } |
| 74 | +} |
0 commit comments