internal/Set-AzStackHCIVMVirtualMachineInstance.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. .Description The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. .Example {{ Add code here }} .Example {{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualMachineInstance .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. LINUXCONFIGURATIONSSHPUBLICKEY <ISshPublicKey[]>: The list of SSH public keys used to authenticate with linux based VMs. [KeyData <String>]: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). [Path <String>]: Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys NETWORKPROFILENETWORKINTERFACE <INetworkInterfaceArmReference[]>: NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance [Id <String>]: The ARM ID for a Network Interface. STORAGEPROFILEDATADISK <IVirtualHardDiskArmReference[]>: adds data disks to the virtual machine instance [Id <String>]: The ARM ID for a Virtual Hard Disk. WINDOWSCONFIGURATIONSSHPUBLICKEY <ISshPublicKey[]>: The list of SSH public keys used to authenticate with linux based VMs. [KeyData <String>]: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). [Path <String>]: Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys .Link https://learn.microsoft.com/powershell/module/azstackhci.vm/set-azstackhcivmvirtualmachineinstance #> function Set-AzStackHCIVMVirtualMachineInstance { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualMachineInstance])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Path')] [System.String] # The fully qualified Azure Resource manager identifier of the resource. ${ResourceUri}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Int32] # Defines the amount of extra memory that should be reserved for a virtual machine instance at runtime, as a percentage of the total memory that the virtual machine instance is thought to need. # This only applies to virtual systems with dynamic memory enabled. # This property can be in the range of 5 to 2000. ${DynamicMemoryConfigTargetMemoryBuffer}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Int64] # Maximum memory in MB ${DynamicMemoryMaximumMemoryInMb}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Int64] # Minimum memory in MB ${DynamicMemoryMinimumMemoryInMb}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # The name of the extended location. ${ExtendedLocationName}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.PSArgumentCompleterAttribute("CustomLocation")] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # The type of the extended location. ${ExtendedLocationType}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Int64] # RAM in MB for the virtual machine instance ${HardwareProfileMemoryMb}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Int32] # number of processors for the virtual machine instance ${HardwareProfileProcessor}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.PSArgumentCompleterAttribute("Default", "Standard_A2_v2", "Standard_A4_v2", "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_DS13_v2", "Standard_K8S_v1", "Standard_K8S2_v1", "Standard_K8S3_v1", "Standard_K8S4_v1", "Standard_NK6", "Standard_NK12", "Standard_NV6", "Standard_NV12", "Standard_K8S5_v1", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Enum of VM Sizes ${HardwareProfileVMSize}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Security.SecureString] # The HTTP proxy server endpoint to use. ${HttpProxyConfigHttpProxy}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Security.SecureString] # The HTTPS proxy server endpoint to use. ${HttpProxyConfigHttpsProxy}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String[]] # The endpoints that should not go through proxy. ${HttpProxyConfigNoProxy}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Alternative CA cert to use for connecting to proxy servers. ${HttpProxyConfigTrustedCa}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). ${IdentityType}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # The ARM ID for an image resource used by the virtual machine instance. ${ImageReferenceId}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # DisablePasswordAuthentication - whether password authentication should be disabled ${LinuxConfigurationDisablePasswordAuthentication}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. ${LinuxConfigurationProvisionVMAgent}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. ${LinuxConfigurationProvisionVMConfigAgent}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ISshPublicKey[]] # The list of SSH public keys used to authenticate with linux based VMs. ${LinuxConfigurationSshPublicKey}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterfaceArmReference[]] # NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance ${NetworkProfileNetworkInterface}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # The ARM ID for a Virtual Hard Disk. ${OSDiskId}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.PSArgumentCompleterAttribute("Windows", "Linux")] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. # Possible values are: Windows, Linux. ${OSDiskOstype}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Security.SecureString] # AdminPassword - admin password ${OSProfileAdminPassword}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # AdminUsername - admin username ${OSProfileAdminUsername}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # ComputerName - name of the compute ${OSProfileComputerName}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Unique identifier defined by ARC to identify the guest of the VM. ${ResourceUid}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Enable TPM flag ${SecurityProfileEnableTpm}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.PSArgumentCompleterAttribute("TrustedLaunch", "ConfidentialVM")] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Specifies the SecurityType of the virtual machine. # EnableTPM and SecureBootEnabled must be set to true for SecurityType to function. ${SecurityProfileSecurityType}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualHardDiskArmReference[]] # adds data disks to the virtual machine instance ${StorageProfileDataDisk}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Id of the storage container that hosts the VM configuration file ${StorageProfileVMConfigStoragePathId}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether secure boot should be enabled on the virtual machine instance. ${UefiSettingSecureBootEnabled}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String[]] # The array of user assigned identities associated with the resource. # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' ${UserAssignedIdentity}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether to EnableAutomaticUpdates on the machine ${WindowConfigurationEnableAutomaticUpdate}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. ${WindowConfigurationProvisionVMAgent}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.Management.Automation.SwitchParameter] # Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. ${WindowConfigurationProvisionVMConfigAgent}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # TimeZone for the virtual machine instance ${WindowConfigurationTimeZone}, [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ISshPublicKey[]] # The list of SSH public keys used to authenticate with linux based VMs. ${WindowsConfigurationSshPublicKey}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ UpdateExpanded = 'AzStackHci.VM.private\Set-AzStackHCIVMVirtualMachineInstance_UpdateExpanded'; UpdateViaJsonFilePath = 'AzStackHci.VM.private\Set-AzStackHCIVMVirtualMachineInstance_UpdateViaJsonFilePath'; UpdateViaJsonString = 'AzStackHci.VM.private\Set-AzStackHCIVMVirtualMachineInstance_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } |