diff --git a/src/StackHCI/StackHCIVm.Autorest/.gitattributes b/src/StackHCI/StackHCIVm.Autorest/.gitattributes
new file mode 100644
index 000000000000..2125666142eb
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/.gitattributes
@@ -0,0 +1 @@
+* text=auto
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/.gitignore b/src/StackHCI/StackHCIVm.Autorest/.gitignore
new file mode 100644
index 000000000000..aa1432babfa4
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/.gitignore
@@ -0,0 +1,15 @@
+bin
+obj
+.vs
+generated
+internal
+exports
+tools
+custom/*.psm1
+test/*-TestResults.xml
+/*.ps1
+/*.ps1xml
+/*.psm1
+/*.snk
+/*.csproj
+/*.nuspec
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/Az.StackHCIVm.psd1 b/src/StackHCI/StackHCIVm.Autorest/Az.StackHCIVm.psd1
new file mode 100644
index 000000000000..ce9f05d34861
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/Az.StackHCIVm.psd1
@@ -0,0 +1,24 @@
+@{
+ GUID = '7389f67c-ec9d-4c13-9c9a-308834413af6'
+ RootModule = './Az.StackHCIVm.psm1'
+ ModuleVersion = '1.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: StackHciVM cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.StackHCIVm.private.dll'
+ FormatsToProcess = './Az.StackHCIVm.format.ps1xml'
+ FunctionsToExport = 'Add-AzStackHCIVmVirtualMachineDataDisk', 'Add-AzStackHCIVmVirtualMachineNetworkInterface', 'Get-AzStackHCIVmImage', 'Get-AzStackHCIVmLogicalNetwork', 'Get-AzStackHCIVmNetworkInterface', 'Get-AzStackHCIVmStoragePath', 'Get-AzStackHCIVmVirtualHardDisk', 'Get-AzStackHCIVmVirtualMachine', 'New-AzStackHCIVmImage', 'New-AzStackHCIVmLogicalNetwork', 'New-AzStackHCIVmNetworkInterface', 'New-AzStackHCIVmStoragePath', 'New-AzStackHCIVmVirtualHardDisk', 'New-AzStackHCIVmVirtualMachine', 'Remove-AzStackHCIVmImage', 'Remove-AzStackHCIVmLogicalNetwork', 'Remove-AzStackHCIVmNetworkInterface', 'Remove-AzStackHCIVmStoragePath', 'Remove-AzStackHCIVmVirtualHardDisk', 'Remove-AzStackHCIVmVirtualMachine', 'Remove-AzStackHCIVmVirtualMachineDataDisk', 'Remove-AzStackHCIVmVirtualMachineNetworkInterface', 'Restart-AzStackHCIVmVirtualMachine', 'Start-AzStackHCIVmVirtualMachine', 'Stop-AzStackHCIVmVirtualMachine', 'Update-AzStackHCIVmImage', 'Update-AzStackHCIVmLogicalNetwork', 'Update-AzStackHCIVmNetworkInterface', 'Update-AzStackHCIVmStoragePath', 'Update-AzStackHCIVmVirtualHardDisk', 'Update-AzStackHCIVmVirtualMachine', '*'
+ AliasesToExport = '*'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'StackHciVM'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/README.md b/src/StackHCI/StackHCIVm.Autorest/README.md
new file mode 100644
index 000000000000..337193648434
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/README.md
@@ -0,0 +1,647 @@
+
+# Az.StackHCIVm
+This directory contains the PowerShell module for the StackHciVM service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.StackHCIVm/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.StackHCIVm`, see [how-to.md](how-to.md).
+
+
+---
+
+## Generation Requirements
+
+Use of the beta version of `autorest.powershell` generator requires the following:
+
+- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred)
+ - **Note**: It _will not work_ with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes.
+ > If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended.
+- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@autorest`
+- PowerShell 6.0 or greater
+ - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
+- .NET Core SDK 2.0 or greater
+ - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
+
+## Run Generation
+
+In this directory, run AutoRest:
+
+> `autorest-beta`
+
+---
+
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+```yaml
+require:
+ - $(this-folder)/../../readme.azure.noprofile.md
+repo: azure-rest-api-specs
+# lock the commit
+input-file:
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/common.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/galleryImages.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/marketplaceGalleryImages.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/networkInterfaces.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/storageContainers.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/virtualHardDisks.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/virtualMachineInstances.json
+ - $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/logicalNetworks.json
+ - $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-03-15-preview/HybridCompute.json
+
+module-version: 1.1.0
+title: StackHCIVm
+service-name: StackHCIVm
+subject-prefix: $(service-name)
+root-module-name: $(prefix).StackHCI
+
+inlining-threshold: 50
+resourcegroup-append: true
+directive:
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}"].get
+ transform: >-
+ $["description"] = "Gets a logical network"
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}"].delete.responses
+ transform: >-
+ return {
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
+ }
+ },
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Accepted"
+ },
+ "204": {
+ "description": "No content"
+ }
+ }
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}"].delete
+ transform: >-
+ $["x-ms-long-running-operation"] = true
+
+
+ # Remove the unexpanded parameter set
+ - where:
+ variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^GetViaIdentity$
+ remove: true
+ - where:
+ parameter-name: DefaultProfile
+ hide: true
+ - where:
+ parameter-name: Break
+ hide: true
+ - where:
+ parameter-name: HttpPipelineAppend
+ hide: true
+ - where:
+ parameter-name: HttpPipelinePrepend
+ hide: true
+ - where:
+ parameter-name: Proxy
+ hide: true
+ - where:
+ parameter-name: ProxyCredential
+ hide: true
+ - where:
+ parameter-name: ProxyUseDefaultCredentials
+ hide: true
+ - where:
+ verb: New
+ parameter-name: ExtendedLocationName
+ set:
+ parameter-name: CustomLocationId
+ - where:
+ verb: New
+ parameter-name: ExtendedLocationType
+ hide: true
+ set:
+ default:
+ script: '"CustomLocation"'
+ - where:
+ parameter-name: SubscriptionId
+ set:
+ default:
+ name: SubscriptionId Default
+ description: Gets the SubscriptionId from the current context.
+ script: '(Get-AzContext).Subscription.Id'
+ - where:
+ verb: New
+ parameter-name: IdentifierOffer
+ set:
+ parameter-name: Offer
+ - where:
+ verb: New
+ parameter-name: IdentifierPublisher
+ set:
+ parameter-name: Publisher
+ - where:
+ verb: New
+ parameter-name: IdentifierSku
+ set:
+ parameter-name: Sku
+ - where:
+ verb: New
+ parameter-name: VersionName
+ set:
+ parameter-name: Version
+ - where:
+ verb: New
+ subject: GalleryImage
+ hide: true
+ - where:
+ verb: New
+ subject: MarketplaceGalleryImage
+ hide: true
+ - where:
+ verb: Get
+ subject: GalleryImage
+ hide: true
+ - where:
+ verb: Get
+ subject: MarketplaceGalleryImage
+ hide: true
+ - where:
+ verb: Remove
+ subject: GalleryImage
+ hide: true
+ - where:
+ verb: Remove
+ subject: MarketplaceGalleryImage
+ hide: true
+ - where:
+ verb: Update
+ subject: GalleryImage
+ hide: true
+ - where:
+ verb: Update
+ subject: MarketplaceGalleryImage
+ hide: true
+ - where:
+ verb: New
+ subject: VirtualHardDisk
+ hide: true
+ - where:
+ verb: New
+ subject: NetworkInterface
+ hide: true
+ - where:
+ verb: New
+ subject: LogicalNetwork
+ hide: true
+ - where:
+ verb: New
+ subject: VirtualHardDisk
+ parameter-name: DiskSizeGb
+ set:
+ parameter-name: SizeGb
+ - where:
+ verb: New
+ subject: VirtualHardDisk
+ parameter-name: ContainerId
+ set:
+ parameter-name: StoragePathId
+ - where:
+ verb: New
+ subject: GalleryImage
+ parameter-name: ContainerId
+ set:
+ parameter-name: StoragePathId
+ - where:
+ verb: New
+ subject: MarketplaceGalleryImage
+ parameter-name: ContainerId
+ set:
+ parameter-name: StoragePathId
+ - where:
+ verb: New
+ subject: LogicalNetwork
+ parameter-name: DhcpOptionDnsServer
+ set:
+ parameter-name: DnsServer
+ - where:
+ model-name: Subnet
+ property-name: PropertiesAddressPrefixes
+ set:
+ property-name: AddressPrefixes
+ - where:
+ verb: New
+ subject: NetworkInterface
+ parameter-name: DnsSettingDnsServer
+ set:
+ parameter-name: DnsServer
+ - where:
+ model-name: IPConfiguration
+ property-name: PrivateIPAddress
+ set:
+ property-name: IPAddress
+ - where:
+ model-name: IPConfiguration
+ property-name: PrivateIPAllocationMethod
+ set:
+ property-name: IPAllocationMethod
+ - where:
+ subject: VirtualMachineInstance
+ parameter-name: DynamicMemoryConfigMaximumMemoryMb
+ set:
+ parameter-name: DynamicMemoryMaximumMemoryInMb
+ - where:
+ subject: VirtualMachineInstance
+ parameter-name: DynamicMemoryConfigMinimumMemoryMb
+ set:
+ parameter-name: DynamicMemoryMinimumMemoryInMb
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: DynamicMemoryConfigTargetMemoryBuffer
+ set:
+ parameter-name: DynamicMemoryTargetBuffer
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: HardwareProfileProcessor
+ set:
+ parameter-name: VmProcessor
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: HardwareProfileMemoryMb
+ set:
+ parameter-name: VmMemory
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: HardwareProfileVMSize
+ set:
+ parameter-name: VmSize
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: ImageReferenceId
+ set:
+ parameter-name: ImageId
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: OSProfileAdminPassword
+ set:
+ parameter-name: AdminPassword
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: OSProfileAdminUsername
+ set:
+ parameter-name: AdminUsername
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: OSProfileComputerName
+ set:
+ parameter-name: ComputerName
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: OSProfileAdminPassword
+ set:
+ parameter-name: AdminPassword
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: OSProfileAdminUsername
+ set:
+ parameter-name: AdminUsername
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: LinuxConfigurationDisablePasswordAuthentication
+ set:
+ parameter-name: DisablePasswordAuthentication
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: WindowConfigurationEnableAutomaticUpdate
+ set:
+ parameter-name: EnableAutomaticUpdate
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: WindowConfigurationTimeZone
+ set:
+ parameter-name: TimeZone
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: SecurityProfileEnableTpm
+ set:
+ parameter-name: EnableTpm
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: UefiSettingSecureBootEnabled
+ set:
+ parameter-name: SecureBootEnabled
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ parameter-name: StorageProfileVMConfigStoragePathId
+ set:
+ parameter-name: StoragePathId
+ - where:
+ verb: New
+ subject: StorageContainer
+ set:
+ subject: StoragePath
+ hide: true
+ - where:
+ verb: Get
+ subject: StorageContainer
+ set:
+ subject: StoragePath
+ - where:
+ verb: Remove
+ subject: StorageContainer
+ set:
+ subject: StoragePath
+ - where:
+ verb: Update
+ subject: StorageContainer
+ set:
+ subject: StoragePath
+ - where:
+ verb: Remove
+ subject: VirtualHardDisk
+ hide: true
+ - where:
+ verb: Remove
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Start
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Stop
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Restart
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Get
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: New
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Update
+ subject: VirtualMachineInstance
+ set:
+ subject: VirtualMachine
+ hide: true
+ - where:
+ verb: Remove
+ subject: NetworkInterface
+ hide: true
+ - where:
+ verb: Remove
+ subject: LogicalNetwork
+ hide: true
+ - where:
+ verb: New
+ subject: LogicalNetwork
+ hide: true
+ - where:
+ verb: Remove
+ subject: StoragePath
+ hide: true
+ - where:
+ model-name: LogicalNetwork
+ property-name: Subnet
+ set:
+ property-name: Subnets
+ - where:
+ subject: AgentVersion
+ hide: true
+ - where:
+ subject: ExtensionMetadata
+ hide: true
+ - where:
+ subject: GuestAgent
+ hide: true
+ - where:
+ subject: HybridIdentityMetadata
+ hide: true
+ - where:
+ subject: MachineExtension
+ hide: true
+ - where:
+ subject: NetworkProfile
+ hide: true
+ - where:
+ verb: Set
+ hide: true
+ - where:
+ subject: Machine
+ hide: true
+ - where:
+ subject: Extension
+ hide: true
+ - where:
+ subject-prefix: StackHciVM
+ set:
+ subject-prefix: StackHCIVm
+
+```
diff --git a/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/logicalNetworks.json b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/logicalNetworks.json
new file mode 100644
index 000000000000..1897be3f7c7a
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/logicalNetworks.json
@@ -0,0 +1,85 @@
+{
+ "resourceType": "logicalNetworks",
+ "apiVersion": "2023-09-01-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci"
+ },
+ "commands": [
+ {
+ "name": "Get-AzStackHCIVmLogicalNetwork",
+ "description": "Gets a logical network",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmlogicalnetwork"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Gets a logical network",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.logicalNetworkName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzStackHCIVmLogicalNetwork",
+ "description": "The operation to delete a logical network.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmlogicalnetwork"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "The operation to delete a logical network.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.logicalNetworkName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/networkInterfaces.json b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/networkInterfaces.json
new file mode 100644
index 000000000000..f4da749e5e5d
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/networkInterfaces.json
@@ -0,0 +1,85 @@
+{
+ "resourceType": "networkInterfaces",
+ "apiVersion": "2023-09-01-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci"
+ },
+ "commands": [
+ {
+ "name": "Get-AzStackHCIVmNetworkInterface",
+ "description": "Gets a network interface",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmnetworkinterface"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Gets a network interface",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.networkInterfaceName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzStackHCIVmNetworkInterface",
+ "description": "The operation to delete a network interface.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmnetworkinterface"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "The operation to delete a network interface.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.networkInterfaceName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/storageContainers.json b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/storageContainers.json
new file mode 100644
index 000000000000..117d5b4d0175
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/storageContainers.json
@@ -0,0 +1,85 @@
+{
+ "resourceType": "storageContainers",
+ "apiVersion": "2023-09-01-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci"
+ },
+ "commands": [
+ {
+ "name": "Get-AzStackHCIVmStoragePath",
+ "description": "Gets a storage container",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmstoragepath"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Gets a storage container",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.storageContainerName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzStackHCIVmStoragePath",
+ "description": "The operation to delete a storage container.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmstoragepath"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "The operation to delete a storage container.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.storageContainerName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/virtualHardDisks.json b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/virtualHardDisks.json
new file mode 100644
index 000000000000..40d9c6ee3aca
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/UX/Microsoft.AzureStackHCI/virtualHardDisks.json
@@ -0,0 +1,85 @@
+{
+ "resourceType": "virtualHardDisks",
+ "apiVersion": "2023-09-01-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci"
+ },
+ "commands": [
+ {
+ "name": "Get-AzStackHCIVmVirtualHardDisk",
+ "description": "Gets a virtual hard disk",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmvirtualharddisk"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Gets a virtual hard disk",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.virtualHardDiskName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzStackHCIVmVirtualHardDisk",
+ "description": "The operation to delete a virtual hard disk.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmvirtualharddisk"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "The operation to delete a virtual hard disk.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.virtualHardDiskName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineDataDisk.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineDataDisk.ps1
new file mode 100644
index 000000000000..46c694499418
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineDataDisk.ps1
@@ -0,0 +1,142 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to add a data disk to a virtual machine.
+.Description
+The operation to add a data disk to a virtual machine.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstances
+
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/add-azstackhcivmvirtualmachinedatadisk
+#>
+
+function Add-AzStackHCIVmVirtualMachineDataDisk {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the VM
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # List of data disks to be attached to the virtual machine passed in Id format
+ ${DataDiskId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # List of data disks to be attached to the virtual machine passed by Name
+ ${DataDiskName},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the Data Disks
+ ${DataDiskResourceGroup}
+ )
+
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+ $StorageProfileDataDisk = [System.Collections.ArrayList]::new()
+
+ if($DataDiskId){
+ foreach ($DiskId in $DataDiskId){
+ if ($DiskId -notmatch $vhdRegex){
+ Write-Error "Invalid Data Disk Id provided: $DiskId." -ErrorAction Stop
+ }
+ $DataDisk = @{Id = $DiskId}
+ [void]$StorageProfileDataDisk.Add($DataDisk)
+ }
+
+ $null = $PSBoundParameters.Remove("DataDiskId")
+
+ } elseif ($DataDiskName){
+ $rg = $ResourceGroupName
+ if($DataDiskResourceGroup){
+ $rg = $DataDiskResourceGroup
+ }
+
+ foreach ($DiskName in $DataDiskName){
+ $DataDiskIdNew = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/virtualharddisks/$DiskName"
+ $DataDisk = @{Id = $DataDiskIdNew}
+ [void]$StorageProfileDataDisk.Add($DataDisk)
+ }
+
+ $null = $PSBoundParameters.Remove("DataDiskName")
+ $null = $PSBoundParameters.Remove("DataDiskResourceGroup")
+ }
+
+ $vm = Az.StackHCIVm.internal\Get-AzStackHCIVmVirtualMachine @PSBoundParameters
+ $disks = $vm.StorageProfileDataDisk
+
+ foreach ($disk in $disks){
+ $DataDisk = @{Id = $disk.Id}
+ [void]$StorageProfileDataDisk.Add($DataDisk)
+ }
+
+ $PSBoundParameters.Add('StorageProfileDataDisk', $StorageProfileDataDisk)
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmVirtualMachine @PSBoundParameters
+ }
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineNetworkInterface.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineNetworkInterface.ps1
new file mode 100644
index 000000000000..87687eddcb49
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Add-AzStackHCIVMVirtualMachineNetworkInterface.ps1
@@ -0,0 +1,126 @@
+<#
+.Synopsis
+The operation to add a network interface to a virtual machine.
+
+.Description
+The operation to add a network interface to a virtual machine.
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/add-azstackhcivmvirtualmachinenetworkinterface
+#>
+
+function Add-AzStackHCIVmVirtualMachineNetworkInterface {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHciVM.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Id of the Virtual Machine
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be attached to the virtual machine in id format
+ ${NicId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be attached to the virtual machine in name format
+ ${NicName},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the Network Interfaces
+ ${NicResourceGroup}
+ )
+
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+
+ $NetworkProfileNetworkInterface = [System.Collections.ArrayList]::new()
+ if ($NicId){
+ foreach ($NId in $NicId){
+ if ($NId -notmatch $nicRegex){
+ Write-Error "Invalid Nic Id provided: $NId." -ErrorAction Stop
+ }
+ $Nic = @{Id = $NId}
+ [void]$NetworkProfileNetworkInterface.Add($Nic)
+ }
+
+ $null = $PSBoundParameters.Remove("NicId")
+
+ } elseif ($NicName){
+ $rg = $ResourceGroupName
+ if($NicResourceGroup){
+ $rg = $NicResourceGroup
+ }
+
+ foreach ($NName in $NicName){
+ $NicIdNew = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/networkinterfaces/$NName"
+ $Nic = @{Id = $NicIdNew}
+ [void]$NetworkProfileNetworkInterface.Add($Nic)
+ }
+
+ $null = $PSBoundParameters.Remove("NicName")
+ $null = $PSBoundParameters.Remove("NicResourceGroup")
+
+ }
+
+ $vm = Az.StackHCIVm.internal\Get-AzStackHCIVmVirtualMachine @PSBoundParameters
+ $nics = $vm.NetworkProfileNetworkInterface
+
+ foreach ($nic in $nics){
+ $Nic= @{Id = $nic.Id}
+ [void]$NetworkProfileNetworkInterface.Add($Nic)
+ }
+
+ $PSBoundParameters.Add('NetworkProfileNetworkInterface', $NetworkProfileNetworkInterface)
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmVirtualMachine @PSBoundParameters
+ }
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMNetworkInterface_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMNetworkInterface_ByResourceId.ps1
new file mode 100644
index 000000000000..f6921df42b6c
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMNetworkInterface_ByResourceId.ps1
@@ -0,0 +1,115 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a network interface
+.Description
+Gets a network interface
+
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmnetworkinterface
+#>
+function Get-AzStackHCIVmNetworkInterface_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces])]
+[CmdletBinding( PositionalBinding=$false)]
+param(
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Id of the network interface.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+
+
+)
+ process {
+
+ if ($ResourceId -match $nicRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['nicName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Get-AzStackHCIVmNetworkInterface @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMStoragePath_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMStoragePath_ByResourceId.ps1
new file mode 100644
index 000000000000..8f22d9802142
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMStoragePath_ByResourceId.ps1
@@ -0,0 +1,115 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a storage path blah
+.Description
+Gets a storage path blah
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmstoragepath
+#>
+function Get-AzStackHCIVmStoragePath_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers])]
+[CmdletBinding(PositionalBinding=$false)]
+
+param(
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM ID of the storage path.
+ ${ResourceId},
+
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+
+
+)
+ process {
+
+ if ($ResourceId -match $storagePathRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['storagePathName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Get-AzStackHCIVmStoragePath @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1
new file mode 100644
index 000000000000..a4299e5249b0
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1
@@ -0,0 +1,113 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a virtual hard disk
+.Description
+Gets a virtual hard disk
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmvirtualharddisk
+#>
+function Get-AzStackHCIVmVirtualHardDisk_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks])]
+[CmdletBinding( PositionalBinding=$false)]
+
+param(
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM ID of the virtual hard disk.
+ ${ResourceId},
+
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+
+
+)
+ process {
+
+ if ($ResourceId -match $vhdRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['vhdName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Get-AzStackHCIVmVirtualHardDisk @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualMachine.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualMachine.ps1
new file mode 100644
index 000000000000..fe1e22515910
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVMVirtualMachine.ps1
@@ -0,0 +1,158 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a virtual machine
+.Description
+Gets a virtual machine
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmvirtualmachine
+#>
+function Get-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230315Preview.Machine],ParameterSetName='ByResourceGroup' )]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance],ParameterSetName='ByName' )]
+ [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Parameter(ParameterSetName='ByResourceGroup', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceGroup')]
+ [Parameter(ParameterSetName='BySubscription')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+
+ )
+ process {
+ if ($PSCmdlet.ParameterSetName -eq "ByName" -or $PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ return Az.StackHCIVm.internal\Get-AzStackHCIVmVirtualMachine @PSBoundParameters
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByResourceGroup") {
+ $allHCIMachines = [System.Collections.ArrayList]::new()
+ $machines = Az.StackHCIVm.internal\Get-AzStackHCIVmMachine -ResourceGroupName $ResourceGroupName
+ foreach ($machine in $machines){
+ if ($machine.Kind.ToString() -eq "HCI"){
+ [void]$allHCIMachines.Add($machine)
+ }
+ }
+ return $allHCIMachines
+
+ } else {
+ $allHCIMachines = [System.Collections.ArrayList]::new()
+ $machines = Az.StackHCIVm.internal\Get-AzStackHCIVmMachine -SubscriptionId $SubscriptionId
+ foreach ($machine in $machines){
+ if ($machine.Kind.ToString() -eq "HCI"){
+ [void]$allHCIMachines.Add($machine)
+ }
+ }
+ return $allHCIMachines
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmImage.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmImage.ps1
new file mode 100644
index 000000000000..9f1f99fa083f
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmImage.ps1
@@ -0,0 +1,194 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a gallery image
+.Description
+Gets a gallery image
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmimage
+#>
+
+function Get-AzStackHCIVmImage{
+ [CmdletBinding(DefaultParameterSetName='BySubscription', PositionalBinding=$false)]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages])]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages])]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the image
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Parameter(ParameterSetName='ByResourceGroup', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceGroup')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='BySubscription')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource Id of the Image
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+)
+
+ process {
+
+ if ($PSCmdlet.ParameterSetName -eq "ByName"){
+ $isGalleryImage = $false
+ $isMarketplaceGalleryImage = $false
+
+
+ $galImage = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage @PSBoundParameters -ErrorAction SilentlyContinue
+ if ($galImage -ne $null){
+ $isGalleryImage = $true
+ } else {
+ $marketplaceGalImage = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters -ErrorAction SilentlyContinue
+ if ($marketplaceGalImage -ne $null){
+ $isMarketplaceGalleryImage = $true
+ }
+ }
+
+ if ($isGalleryImage){
+ return $galImage
+ }
+
+ if ($isMarketplaceGalleryImage){
+ return $marketplaceGalImage
+ }
+
+ Write-Error "An Image with name: $Name does not exist in Resource Group: $ResourceGroupName" -ErrorAction Stop
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+
+ if ($ResourceId -match $galImageRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage @PSBoundParameters
+ } elseif ($ResourceId -match $marketplaceGalImageRegex){
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByResourceGroup"){
+ $allImages = @()
+ $galImages = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage @PSBoundParameters
+ $marketplaceGalImages = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+ $allImages = $allImages + $galImages
+ $allImages = $allImages + $marketplaceGalImages
+ return $allImages
+ }
+
+ $allImages = @()
+ $galImages = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage @PSBoundParameters
+ $marketplaceGalImages = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+ $allImages = $allImages + $galImages
+ $allImages = $allImages + $marketplaceGalImages
+ return $allImages
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmLogicalNetwork_ByResourceId2.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmLogicalNetwork_ByResourceId2.ps1
new file mode 100644
index 000000000000..6bac5804f7fe
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Get-AzStackHCIVmLogicalNetwork_ByResourceId2.ps1
@@ -0,0 +1,114 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a logical network
+.Description
+Gets a logical network
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmlogicalnetwork
+#>
+function Get-AzStackHCIVmLogicalNetwork_ByResourceId {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHciVM.Models.Api20230901Preview.ILogicalNetworks])]
+ [CmdletBinding(PositionalBinding=$false)]
+
+ param(
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHciVM.Category('Path')]
+ [System.String]
+ # The ARM ID of the logical network.
+ ${ResourceId},
+
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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}
+
+ )
+ process {
+
+ if ($ResourceId -match $lnetRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['logicalNetworkName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Get-AzStackHCIVmLogicalNetwork @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+ }
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMImage.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMImage.ps1
new file mode 100644
index 000000000000..51d99679f0d3
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMImage.ps1
@@ -0,0 +1,337 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to create an image.
+Please note some properties can be set only during image creation.
+.Description
+The operation to create an image.
+Please note some properties can be set only during image creation.
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmimage
+#>
+function New-AzStackHCIVmImage{
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages],ParameterSetName='Marketplace' )]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages],ParameterSetName='MarketplaceURN' )]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages],ParameterSetName='GalleryImage' )]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Parameter(ParameterSetName='MarketplaceURN',Mandatory)]
+ [Alias('ImageName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the Image
+ #The name must start and end with an alphanumeric character and must contain all alphanumeric characters or ‘-‘, ‘.’, or ‘_’. The max length can be 80 characters and the minimum length is 1 character.
+ ${Name},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Parameter(ParameterSetName='MarketplaceURN', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Marketplace')]
+ [Parameter(ParameterSetName='GalleryImage')]
+ [Parameter(ParameterSetName='MarketplaceURN')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Parameter(ParameterSetName='MarketplaceURN', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter(ParameterSetName='Marketplace')]
+ [Parameter(ParameterSetName='GalleryImage')]
+ [Parameter(ParameterSetName='MarketplaceURN')]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.CloudInitDataSource])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.CloudInitDataSource]
+ # Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
+ ${CloudInitDataSource},
+
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Parameter(ParameterSetName='MarketplaceURN', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The ARM Id of the extended location to create image resource in.
+ ${CustomLocationId},
+
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Local path of image that the image should be created from.
+ # This parameter is required for non marketplace images.
+ ${ImagePath},
+
+ [Parameter(ParameterSetName='GalleryImage', Mandatory)]
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Parameter(ParameterSetName='MarketplaceURN', Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.OperatingSystemTypes])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.OperatingSystemTypes]
+ # Operating system type that the gallery image uses [Windows, Linux]
+ ${OSType},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the marketplae gallery image definition offer.
+ ${Offer},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the marketplace gallery image definition publisher.
+ ${Publisher},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the marketplace gallery image definition SKU.
+ ${Sku},
+
+ [Parameter(ParameterSetName='Marketplace')]
+ [Parameter(ParameterSetName='GalleryImage')]
+ [Parameter(ParameterSetName='MarketplaceURN')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage Container Name of the storage container to be used for gallery image
+ ${StoragePathName},
+
+ [Parameter(ParameterSetName='Marketplace')]
+ [Parameter(ParameterSetName='GalleryImage')]
+ [Parameter(ParameterSetName='MarketplaceURN')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the Storage Path. The Default value is the Resource Group of the Image.
+ ${StoragePathResourceGroup},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage ContainerID of the storage container to be used for gallery image
+ ${StoragePathId},
+
+ [Parameter(ParameterSetName='GalleryImage')]
+ [Parameter(ParameterSetName='Marketplace')]
+ [Parameter(ParameterSetName='MarketplaceURN')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter(ParameterSetName='MarketplaceURN', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The URN of the marketplace gallery image.
+ ${URN},
+
+ [Parameter(ParameterSetName='Marketplace', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The version of the marketplace gallery image.
+ ${Version},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+
+ if (-Not ($name -match $imageNameRegex )) {
+ Write-Error "Invalid Name for image provided: $name" -ErrorAction Stop
+ }
+
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+ if ($OSType){
+ if ($OSType.ToString().ToLower() -eq "windows"){
+ $PSBoundParameters['OSType'] = 'Windows'
+
+ }
+ elseif ($OSType.ToString().ToLower() -eq "linux"){
+ $PSBoundParameters['OSType'] = 'Linux'
+ }
+ else {
+ Write-Error "Invalid OSType provided: $OSType. Expected values are 'Windows' or 'Linux'." -ErrorAction Stop
+ }
+ }
+
+ #cloudinitdatassouce
+ if ($CloudInitDataSource){
+ if ($CloudInitDataSource.ToString().ToLower() -eq "nocloud"){
+ $PSBoundParameters['CloudInitDataSource'] = 'NoCloud'
+
+ }
+ elseif ($CloudInitDataSource.ToString().ToLower() -eq "azure"){
+ $PSBoundParameters['CloudInitDataSource'] = 'Azure'
+ }
+ else {
+ Write-Error "Invalid CloudInitDataSource provided: $CloudInitDataSource. Expected values are 'NoCloud' or 'Azure'." -ErrorAction Stop
+ }
+
+ }
+
+ if ($HyperVGeneration){
+ if ($HyperVGeneration.ToString().ToLower() -eq "v1"){
+ $PSBoundParameters['HyperVGeneration'] = 'V1'
+
+ }
+ elseif ($HyperVGeneration.ToString().ToLower() -eq "v2"){
+ $PSBoundParameters['HyperVGeneration'] = 'V2'
+ }
+ else {
+ Write-Error "Invalid HyperVGeneration provided: $HyperVGeneration. Expected values are 'V1' or 'V2'." -ErrorAction Stop
+ }
+
+ }
+
+ if ($StoragePathName){
+ if ($StoragePathResourceGroup){
+ $StoragePathId = "/subscriptions/$SubscriptionId/resourceGroups/$StoragePathResourceGroup/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ } else {
+ $StoragePathId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ }
+
+ $PSBoundParameters.Add('StoragePathId', $StoragePathId)
+ $null = $PSBoundParameters.Remove("StoragePathName")
+ $null = $PSBoundParameters.Remove("StoragePathResourceGroup")
+ }
+
+
+ if ($PSCmdlet.ParameterSetName -eq "Marketplace")
+ {
+ return Az.StackHCIVm.internal\New-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "MarketplaceURN") {
+ if ($URN -match $urnRegex){
+ $publisher = $Matches.publisher.ToLower()
+ $offer = $Matches.offer.ToLower()
+ $sku = $Matches.sku.ToLower()
+ $version = $Matches.version.ToLower()
+
+ $null = $PSBoundParameters.Remove("URN")
+ $PSBoundParameters.Add('Publisher', $publisher)
+ $PSBoundParameters.Add('Offer', $offer)
+ $PSBoundParameters.Add('Sku', $sku)
+ $PSBoundParameters.Add('Version', $version)
+ } else {
+ Write-Error "Invalid URN provided: $URN. Valid URN format is Publisher:Offer:Sku:Version ." -ErrorAction Stop
+ }
+
+ return Az.StackHCIVm.internal\New-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+
+ }
+
+ if ($PSCmdlet.ParameterSetName -eq "GalleryImage")
+ {
+
+ return Az.StackHCIVm.internal\New-AzStackHCIVmGalleryImage @PSBoundParameters
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMLogicalNetwork_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMLogicalNetwork_New.ps1
new file mode 100644
index 000000000000..ba641646d458
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMLogicalNetwork_New.ps1
@@ -0,0 +1,346 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to create or update a logical network.
+Please note some properties can be set only during logical network creation.
+.Description
+The operation to create or update a logical network.
+Please note some properties can be set only during logical network creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks
+.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.
+
+SUBNET : Subnet - list of subnets under the logical network
+ [AddressPrefix ]: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6.
+ [IPAllocationMethod ]: IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic'
+ [IPConfigurationReference ]: IPConfigurationReferences - list of IPConfigurationReferences
+ [Id ]: IPConfigurationID
+ [IPPool ]: network associated pool of IP Addresses
+ [End ]: End of the IP address pool
+ [Name ]: Name of the IP-Pool
+ [Start ]: Start of the IP address pool
+ [Type ]: Type of the IP Pool [vm, vippool]
+ [Name ]: Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
+ [PropertiesAddressPrefixes ]: List of address prefixes for the subnet.
+ [Route ]: Collection of routes contained within a route table.
+ [AddressPrefix ]: The destination CIDR to which the route applies.
+ [Name ]: Name - name of the subnet
+ [NextHopIPAddress ]: The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
+ [Vlan ]: Vlan to use for the subnet
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmlogicalnetwork
+#>
+
+function New-AzStackHCIVmLogicalNetwork {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks])]
+ [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Alias('LogicalNetworkName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual network
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the extended location.
+ ${CustomLocationId},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # The list of DNS servers IP addresses.
+ ${DnsServer},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Name of the network switch to be used for VMs
+ ${VMSwitchName},
+
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # List of address prefixes for the subnet.
+ $AddressPrefix,
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.IPAllocationMethodEnum])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The IP address allocation method. Possible values include: 'Static', 'Dynamic'
+ $IpAllocationMethod,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # End of the ip address pool
+ $IpPoolEnd,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Start of the ip address pool
+ $IpPoolStart,
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.IPPoolTypeEnum])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Ip pool type
+ $IpPoolType,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Collections.Hashtable[]]
+ # Network associated pool of IP Addresses
+ $IpPool,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Collections.Hashtable[]]
+ # Collection of routes contained within a route table.
+ $Route,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Name of the subnet
+ $SubnetName,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Collections.Hashtable[]]
+ # List of subnets under the virtual network
+ $Subnet,
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # Vlan to use for the subnet
+ $Vlan ,
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+
+ if ($Name -notmatch $vnetNameRegex){
+ Write-Error "Invalid Name: $Name. The name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character or '_'. The max length is 64 characters." -ErrorAction Stop
+ }
+
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+
+ if ($DnsServer){
+ foreach ($DnsServ in $DnsServer){
+ if ($DnsServ -notmatch $ipv4Regex){
+ Write-Error "Invalid ipaddress provided for Dns Servers : $DnsServ." -ErrorAction Stop
+ }
+ }
+ }
+
+ if ($Subnet){
+ Confirm-Subnets -Subnets $Subnet
+
+ } else{
+ $SubnetNew = @{}
+ if ($IpAllocationMethod){
+ if ($IpAllocationMethod.ToLower() -ne "dynamic" -and $IpAllocationMethod.ToLower() -ne "static"){
+ Write-Error "Invalid Ip Allocation method provided: $IpAllocationMethod. Accepted values are 'dynamic' or 'static'" -ErrorAction Stop
+ }
+ $IpAllocationMethod = $IpAllocationMethod.ToLower()
+
+ if ($IpAllocationMethod -eq "static"){
+ $SubnetNew["IPAllocationMethod"] = 'Static'
+ if (-Not $AddressPrefix){
+ Write-Error "Invalid Configuration for Static IpAllocationMethod. AddressPrefix are required for Static IpAllocationMethod." -ErrorAction Stop
+ }
+ }
+ } else {
+ $SubnetNew["IPAllocationMethod"] = 'Dynamic'
+ }
+
+ if ($IpPoolStart -and $IpPoolEnd){
+ if($IpPoolStart -notmatch $ipv4Regex){
+ Write-Error "Invalid Ip Address provided : $IpPoolStart" -ErrorAction Stop
+ }
+
+ if($IpPoolEnd -notmatch $ipv4Regex){
+ Write-Error "Invalid Ip Address provided : $IpPoolEnd" -ErrorAction Stop
+ }
+ $IpPoolNew = @{End = $IpPoolEnd; Start = $IpPoolStart}
+ if ($IpPoolType){
+ $IpPoolType = $IpPoolType.ToLower()
+ if ($IpPoolType -ne "vm" -and $IpPoolType -ne "vippool"){
+ Write-Error "Invalid IpPoolType provided: $IpPoolType. Accepted values are 'vm' and 'vippool'." -ErrorAction Stop
+ }
+ $IpPoolNew['Type'] = $IpPoolType
+ }
+ $SubnetNew["IPPool"] = @($IpPoolNew)
+ } elseif ($IpPoolStart -or $IpPoolEnd){
+ Write-Error "Both IpPoolStart and IpPoolEnd must be specified together." -ErrorAction Stop
+ }
+
+ if ($IpPool){
+ Confirm-IpPools -IpPools $IpPool
+ $SubnetNew["IPPool"] = $IpPool
+ }
+
+ if($Vlan){
+ if ($Vlan -gt 4094 -or $Vlan -lt 1){
+ Write-Error "Invalid value for Vlan : $Vlan. Valid range is 1-4094" -ErrorAction Stop
+ }
+ $SubnetNew["Vlan"] = $Vlan
+ }
+
+ if ($SubnetName){
+ if ($SubnetName -notmatch $subnetNameRegex){
+ Write-Error "Invalid SubnetName: $SubnetName. The name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character or '_'. The max length is 80 characters." -ErrorAction Stop
+ }
+ $SubnetNew["Name"] = $SubnetName
+ }
+
+ if ($AddressPrefix){
+ foreach ($addPrefix in $AddressPrefix){
+ if ($addPrefix -notmatch $cidrRegex){
+ Write-Error "Invalid AddressPrefix: $addPrefix. Please use valid CIDR format." -ErrorAction Stop
+ }
+ }
+
+ if ($AddressPrefix.length -eq 1){
+ $SubnetNew["AddressPrefix"] = $AddressPrefix[0]
+ } else {
+ $SubnetNew["AddressPrefixes"] = $AddressPrefix
+ }
+
+ }
+
+ if ($Route){
+ Confirm-Routes -Routes $Route
+ $SubnetNew["Route"] = $Route
+
+ }
+
+ $null = $PSBoundParameters.Remove("IpAllocationMethod")
+ $null = $PSBoundParameters.Remove("IpPoolStart")
+ $null = $PSBoundParameters.Remove("IpPoolEnd")
+ $null = $PSBoundParameters.Remove("IpPoolType")
+ $null = $PSBoundParameters.Remove("AddressPrefix")
+ $null = $PSBoundParameters.Remove("Vlan")
+ $null = $PSBoundParameters.Remove("SubnetName")
+ $null = $PSBoundParameters.Remove("IpPool")
+ $null = $PSBoundParameters.Remove("Route")
+ $PSBoundParameters.Add("Subnet", $SubnetNew)
+
+ }
+
+ return Az.StackHCIVm.internal\New-AzStackHCIVmLogicalNetwork @PSBoundParameters
+ }
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMNetworkInterface_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMNetworkInterface_New.ps1
new file mode 100644
index 000000000000..3d61249bf5b4
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMNetworkInterface_New.ps1
@@ -0,0 +1,278 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to create or update a network interface.
+Please note some properties can be set only during network interface creation.
+.Description
+The operation to create or update a network interface.
+Please note some properties can be set only during network interface creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces
+.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.
+
+IPCONFIGURATION : IPConfigurations - A list of IPConfigurations of the network interface.
+ [IPAddress ]: PrivateIPAddress - Private IP address of the IP configuration.
+ [Name ]: Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
+ [SubnetId ]: ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmnetworkinterface
+#>
+function New-AzStackHCIVmNetworkInterface {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('NetworkInterfaceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the Network Interface
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the extended location.
+ ${CustomLocationId},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # List of DNS server IP Addresses for the interface
+ ${DnsServer},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # PrivateIPAddress - Private IP address of the IP configuration.
+ ${IpAddress},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # MacAddress - The MAC address of the network interface.
+ ${MacAddress},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The ARM resource id of the Subnet.
+ ${SubnetId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the Subnet.
+ ${SubnetName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the Subnet.
+ ${SubnetResourceGroup},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Collections.Hashtable[]]
+ # A list of IPConfigurations of the network interface.
+ ${IpConfiguration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+)
+
+ if ($Name -notmatch $nicNameRegex){
+ Write-Error "Invalid Name: $Name. The name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character or '_'. The max length is 80 characters." -ErrorAction Stop
+ }
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+
+ $null = $PSBoundParameters.Remove("MacAddress")
+ $null = $PSBoundParameters.Remove("DnsServer")
+ $null = $PSBoundParameters.Remove("Tag")
+
+
+ if (-Not $IpConfiguration){
+ $IpConfig = @{}
+ if ($SubnetName){
+ $rg = $ResourceGroupName
+ if ($SubnetResourceGroup){
+ $rg = $SubnetResourceGroup
+ }
+ $SubnetId = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/logicalNetworks/$SubnetName"
+ $null = $PSBoundParameters.Remove("SubnetName")
+ $null = $PSBoundParameters.Remove("SubnetResourceGroup")
+ }
+
+ if (-Not $SubnetId){
+ Write-Error "No Subnet provided. Either IpConfigurations or SubnetId or SubnetName is required." -ErrorAction Stop
+ } else {
+ if ($SubnetId -notmatch $vnetRegex){
+ Write-Error "Invalid SubnetId: $SubnetId" -ErrorAction Stop
+ }
+ }
+
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("Location")
+ $null = $PSBoundParameters.Remove("CustomLocationId")
+ $null = $PSBoundParameters.Remove("SubnetId")
+ $null = $PSBoundParameters.Remove("IpAddress")
+
+ $PSBoundParameters.Add("ResourceId", $SubnetId)
+ $subnet = Az.StackHCIVm\Get-AzStackHCIVmLogicalNetwork @PSBoundParameters
+
+
+ if ($subnet -eq $null) {
+ Write-Error "A Logical Network with id : $SubnetId does not exist." -ErrorAction Stop
+ }
+
+ $IpConfig["SubnetId"] = $SubnetId
+
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $Name)
+ $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $PSBoundParameters.Add("SubscriptionId", $SubscriptionId)
+ $PSBoundParameters.Add("Location", $Location)
+ $PSBoundParameters.Add("CustomLocationId", $CustomLocationId)
+
+
+
+ if ($IpAddress){
+ if ($IpAddress -notmatch $ipv4Regex){
+ Write-Error "Invalid Ip Address provided : $IpAddress" -ErrorAction Stop
+ }
+ $IpConfig["IPAddress"] = $IpAddress
+ }
+
+
+ $PSBoundParameters.Add("IPConfiguration", $IpConfig)
+
+ }
+
+ if ($MacAddress){
+ if ($MacAddress -notmatch $macAddressRegex){
+ Write-Error "Invalid MacAddress: $MacAddress." -ErrorAction Stop
+ }
+ $PSBoundParameters.Add("MacAddress", $MacAddress)
+ }
+
+ if ($DnsServer){
+ foreach ($DnsServ in $DnsServer){
+ if ($DnsServ -notmatch $ipv4Regex){
+ Write-Error "Invalid ipaddress provided for Dns Servers : $DnsServ." -ErrorAction Stop
+ }
+ }
+ $PSBoundParameters.Add("DnsServer", $DnsServer)
+ }
+
+ if ($Tag){
+ $PSBoundParameters.Add("Tag", $Tag)
+ }
+ return Az.StackHCIVm.internal\New-AzStackHCIVmNetworkInterface @PSBoundParameters
+
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMStoragePath_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMStoragePath_New.ps1
new file mode 100644
index 000000000000..996285931ba9
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMStoragePath_New.ps1
@@ -0,0 +1,151 @@
+
+# ----------------------------------------------------------------------------------
+# 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 storage container.
+Please note some properties can be set only during storage container creation.
+.Description
+The operation to create or update a storage container.
+Please note some properties can be set only during storage container creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmstoragepath
+#>
+function New-AzStackHCIVmStoragePath{
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('StorageContainerName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the storage container
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the extended location.
+ ${CustomLocationId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Path of the storage container on the disk
+ ${Path},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+)
+ if ($Name -notmatch $storagePathNameRegex){
+ Write-Error "Invalid Name: $Name. The Storage Path name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character or '_'. The max length is 80 characters." -ErrorAction Stop
+ }
+
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+
+
+ return Az.StackHCIVm.internal\New-AzStackHCIVmStoragePath @PSBoundParameters
+
+}
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualHardDisk_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualHardDisk_New.ps1
new file mode 100644
index 000000000000..1d6f25b9043d
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualHardDisk_New.ps1
@@ -0,0 +1,249 @@
+
+# ----------------------------------------------------------------------------------
+# 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 hard disk.
+Please note some properties can be set only during virtual hard disk creation.
+.Description
+The operation to create or update a virtual hard disk.
+Please note some properties can be set only during virtual hard disk creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmvirtualharddisk
+#>
+function New-AzStackHCIVmVirtualHardDisk {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks])]
+[CmdletBinding(PositionalBinding=$false,SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('VirtualHardDiskName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual hard disk.
+ # Must contain all alphanumeric characters or ‘-’ or ‘_’. Max length is 80 characters, and min length is 1 character.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # The block size, in bytes, of the virtual hard disk.
+ ${BlockSizeByte},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage ContainerID of the storage container to be used for VHD
+ ${StoragePathId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage Container Name to be used for the VHD
+ ${StoragePathName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage Container resource group. The resource group of the virtual hard disk will be used if this value is not provided.
+ ${StoragePathResourceGroup},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The ARM Id of the extended location to create virtual hard disk resource in.
+ ${CustomLocationId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.DiskFileFormat])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.DiskFileFormat]
+ # The format of the actual VHD file [vhd, vhdx]
+ ${DiskFileFormat},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int64]
+ # Size of the disk in GB
+ ${SizeGb},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Boolean for enabling dynamic sizing on the virtual hard disk
+ ${Dynamic},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.HyperVGeneration])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.HyperVGeneration]
+ # The hypervisor generation of the Virtual Machine [V1, V2]
+ ${HyperVGeneration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # Logical Sector Bytes of the Disk
+ ${LogicalSectorByte},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # Physical Sector Bytes of the Disk
+ ${PhysicalSectorByte},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+ if (-Not ($Name -match $vhdNameRegex)){
+ Write-Error "Invalid Name: $Name. The name must contain all alphanumeric characters or '-' or '_'. The max length is 80 characters." -ErrorAction Stop
+ }
+
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+
+ if ($DiskFileFormat){
+ if ($DiskFileFormat.ToString().ToLower() -ne "vhd" -and $DiskFileFormat.ToString().ToLower() -ne "vhdx"){
+ Write-Error "Invalid disk file format provided. Allowed values are 'vhd' and 'vhdx'. " -ErrorAction Stop
+ }
+ }
+
+
+ if ($LogicalSectorByte){
+ if ($LogicalSectorByte -ne 512 -and $LogicalSectorByte -ne 4096){
+ Write-Error "Invalid value for logical sector bytes provided. Allowed values are 512 and 4096. " -ErrorAction Stop
+ }
+ }
+
+
+ if ($PhysicalSectorByte){
+ if ($PhysicalSectorByte -ne 512 -and $PhysicalSectorByte -ne 4096){
+ Write-Error "Invalid value for physical sector bytes provided. Allowed values are 512 and 4096'. " -ErrorAction Stop
+ }
+ }
+
+ if ($SizeGb){
+ if ($SizeGb -gt 4095){
+ Write-Error "Maximum value for $SizeGb is 4095." -ErrorAction Stop
+ }
+ }
+
+ if($StoragePathId){
+ if (-Not ($StoragePathId -match $storagePathRegex)){
+ Write-Error "Invalid resource ID provided for storage path $StoragePathId " -ErrorAction Stop
+ }
+ } elseif ($StoragePathName){
+ if ($StoragePathResourceGroup){
+ $StoragePathId = "/subscriptions/$SubscriptionId/resourceGroups/$StoragePathResourceGroup/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ } else {
+ $StoragePathId= "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ }
+ $PSBoundParameters.Add('StoragePathId', $StoragePathId)
+ $null = $PSBoundParameters.Remove("StoragePathName")
+ $null = $PSBoundParameters.Remove("StoragePathResourceGroup")
+ }
+
+ return Az.StackHCIVm.internal\New-AzStackHCIVmVirtualHardDisk @PSBoundParameters
+
+}
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
new file mode 100644
index 000000000000..eaeb7510a5f7
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
@@ -0,0 +1,694 @@
+
+# ----------------------------------------------------------------------------------
+# 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.
+Please note some properties can be set only during virtual machine creation.
+.Description
+The operation to create or update a virtual machine.
+Please note some properties can be set only during virtual machine creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.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 : PublicKeys - The list of SSH public keys used to authenticate with linux based VMs.
+ [KeyData ]: KeyData - 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 Li nux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
+ [Path ]: Path - 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 : NetworkInterfaces - list of network interfaces to be attached to the virtual machine
+ [Id ]: ID - Resource Id of the network interface
+
+STORAGEPROFILEDATADISK : adds data disks to the virtual machine
+ [Id ]: Resource ID of the data disk
+
+WINDOWSCONFIGURATIONSSHPUBLICKEY : PublicKeys - The list of SSH public keys used to authenticate with linux based VMs.
+ [KeyData ]: KeyData - 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 Li nux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
+ [Path ]: Path - 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/az.stackhci/new-azstackhcivmvirtualmachine
+#>
+function New-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # The name of the extended location.
+ ${CustomLocationId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int64]
+ # Maximum Dynamic Memory
+ ${DynamicMemoryMaximumMemoryInMb},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int64]
+ # Minimum Dynamic Memory
+ ${DynamicMemoryMinimumMemoryInMb},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # Defines the amount of extra memory that should be reserved for a virtual machine at runtime, as a percentage of the total memory that the virtual machine 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.
+ ${DynamicMemoryTargetBuffer},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int64]
+ # RAM in MB for the virtual machine
+ ${VmMemoryInMB},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # Number of processors for the virtual machine
+ ${VmProcessor},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.VMSizeEnum]
+ # Size of the VM. Can be a Predefined size or Custom. Possible Predefined Sizes include - Custom,Standard_A2_v2,Standard_A4_v2,Standard_D16s_v3,Standard_D2s_v3,Standard_D32s_v3,Standard_D4s_v3,Standard_D8s_v3,Standard_DS13_v2,Standard_DS2_v2,Standard_DS3_v2,Standard_DS4_v2,Standard_DS5_v2,Standard_K8S2_v1,Standard_K8S3_v1,Standard_K8S4_v1,Standard_K8S5_v1,Standard_K8S_v1,Standard_NK12,Standard_NK6,Standard_NV12, StandardNv6
+
+ ${VmSize},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.ResourceIdentityType])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.ResourceIdentityType]
+ # The identity type.
+ ${IdentityType},
+
+ [Parameter(ParameterSetName='ByImageId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource ID of the image to create the VM with.
+ ${ImageId},
+
+ [Parameter(ParameterSetName='ByImageName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Name of the image to create the VM with.
+ ${ImageName},
+
+ [Parameter(ParameterSetName='ByImageName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource group of the image to create the VM from.
+ ${ImageResourceGroup},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # DisablePasswordAuthentication - whether password authentication should be disabled
+ ${DisablePasswordAuthentication},
+
+ [Parameter()]
+ [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 creation process. VM Agent is provsioned by default. Please pass -ProvisionVMAgent:$false to disable.
+ ${ProvisionVMAgent},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Indicates whether virtual machine configuration agent should be provisioned on the virtual machine. When this property is not specified, default behavior is to set it to true. VM Config Agent is provisioned by default. Please pass -ProvisionVMConfigAgent:$false to disable.
+ ${ProvisionVMConfigAgent},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be attached to the virtual machine in ARM Id format.
+ ${NicId},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be attached to the virtual machine in name format.
+ ${NicName},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # NetworkInterfaces - Resource Group of Network Interfaces.
+ ${NicResourceGroup},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # Data Disks - List of data disks to be attached to the virtual machine in id format.
+ ${DataDiskId},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # Data Disks - List of data disks to be attached to the virtual machine in name format .
+ ${DataDiskName},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Data Disks - Resource Group of Data Disks.
+ ${DataDiskResourceGroup},
+
+ [Parameter(ParameterSetName='ByOsDiskId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource ID of the OS disk
+ ${OSDiskId},
+
+ [Parameter(ParameterSetName='ByOsDiskName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Name of the OS disk
+ ${OSDiskName},
+
+ [Parameter(ParameterSetName='ByOsDiskName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the OS disk
+ ${OSDiskResourceGroup},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # AdminPassword - admin password
+ ${AdminPassword},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # AdminUsername - admin username
+ ${AdminUsername},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # ComputerName - name of the computer
+ ${ComputerName},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.OperatingSystemTypes])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # OsType - string specifying whether the OS is Linux or Windows
+ ${OsType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Used to indicate whether or not to enable TPM
+ ${EnableTpm},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # PublicKeys - The list of SSH public keys used to authenticate with VMs
+ ${SshPublicKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Id of the storage container that hosts the VM configuration file
+ ${StoragePathId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Name of the storage container that hosts the VM configuration file
+ ${StoragePathName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Storage Container resource group. The resource group of the virtual machine will be used if this value is not provided.
+ ${StoragePathResourceGroup},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api30.ITrackedResourceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Specifies whether secure boot should be enabled on the virtual machine.
+ ${SecureBootEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Specifies Whether to EnableAutomaticUpdates on the machine.
+ ${EnableAutomaticUpdate},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # TimeZone for the virtual machine
+ ${TimeZone},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+ )
+
+ #name
+ if ($Name -notmatch $machineNameRegex){
+ Write-Error "Invalid Name: $Name. The name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character. The max length is 64 characters." -ErrorAction Stop
+ }
+
+ if ($CustomLocationId -notmatch $customLocationRegex){
+ Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
+ }
+
+ $PSBoundParameters.Add("Kind", "HCI")
+ $PSBoundParameters.Add("IdentityType", "SystemAssigned")
+ $null = $PSBoundParameters.Remove("DynamicMemoryMaximumMemory")
+ $null = $PSBoundParameters.Remove("DynamicMemoryMinimumMemory")
+ $null = $PSBoundParameters.Remove("DynamicMemoryTargetBuffer")
+ $null = $PSBoundParameters.Remove("VmMemoryInMB")
+ $null = $PSBoundParameters.Remove("VmProcessor")
+ $null = $PSBoundParameters.Remove("VmSize")
+ $null = $PSBoundParameters.Remove("NicId")
+ $null = $PSBoundParameters.Remove("NicName")
+ $null = $PSBoundParameters.Remove("NicResourceGroup")
+ $null = $PSBoundParameters.Remove("CustomLocationId")
+ $null = $PSBoundParameters.Remove("ImageId")
+ $null = $PSBoundParameters.Remove("ImageName")
+ $null = $PSBoundParameters.Remove("ImageResourceGroup")
+ $null = $PSBoundParameters.Remove("DisablePasswordAuthentication")
+ $null = $PSBoundParameters.Remove("ProvisionVMAgent")
+ $null = $PSBoundParameters.Remove("ProvisionVMConfigAgent")
+ $null = $PSBoundParameters.Remove("DataDiskId")
+ $null = $PSBoundParameters.Remove("DataDiskName")
+ $null = $PSBoundParameters.Remove("DataDiskResourceGroup")
+ $null = $PSBoundParameters.Remove("OSDiskId")
+ $null = $PSBoundParameters.Remove("OSDiskName")
+ $null = $PSBoundParameters.Remove("OSDiskResourceGroup")
+ $null = $PSBoundParameters.Remove("AdminPassword")
+ $null = $PSBoundParameters.Remove("AdminUsername")
+ $null = $PSBoundParameters.Remove("ComputerName")
+ $null = $PSBoundParameters.Remove("EnableTpm")
+ $null = $PSBoundParameters.Remove("SshPublicKey")
+ $null = $PSBoundParameters.Remove("SecureBootEnabled")
+ $null = $PSBoundParameters.Remove("StoragePathResourceGroup")
+ $null = $PSBoundParameters.Remove("StoragePathName")
+ $null = $PSBoundParameters.Remove("StoragePathId")
+ $null = $PSBoundParameters.Remove("EnableAutomaticUpdate")
+ $null = $PSBoundParameters.Remove("TimeZone")
+ $null = $PSBoundParameters.Remove("NoWait")
+ $null = $PSBoundParameters.Remove("AsJob")
+
+ if ($OsType.ToString().ToLower() -eq "windows"){
+ $null = $PSBoundParameters.Remove("OsType")
+ $PSBoundParameters.Add('OSType', "Windows")
+ } elseif ($OsType.ToString().ToLower() -eq "linux"){
+ $null = $PSBoundParameters.Remove("OsType")
+ $PSBoundParameters.Add('OSType', "Linux")
+ } else {
+ Write-Error "Invalid OSType provided: $OsType. Accepted Values are 'Windows' and 'Linux'" -ErrorAction Stop
+ }
+
+
+ Az.StackHCIVm.internal\New-AzStackHCIVmMachine @PSBoundParameters | Out-Null
+
+ if ($PSCmdlet.ParameterSetName -eq "ByImageId"){
+ if($ImageId -notmatch $marketplaceGalImageRegex -and $ImageId -notmatch $galImageRegex){
+ Write-Error "Invalid ImageId: $ImageId" -ErrorAction Stop
+ }
+ $PSBoundParameters.Add('ImageId', $ImageId)
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByImageName"){
+ $rg = $ResourceGroupName
+ if($ImageResourceGroup){
+ $rg = $ImageResourceGroup
+ }
+ $isGalleryImage = $false
+ $isMarketplaceGalleryImage = $false
+
+ $galImage = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage -Name $ImageName -ResourceGroupName $rg -SubscriptionId $SubscriptionId -ErrorAction SilentlyContinue
+ if($galImage -eq $null){
+ $marketplaceGalImage = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage -Name $ImageName -ResourceGroupName $rg -SubscriptionId $SubscriptionId -ErrorAction SilentlyContinue
+ if ($marketplacegalImage -eq $null){
+ Write-Error "An Image with name: $ImageName does not exist in Resource Group: $rg" -ErrorAction Stop
+ } else {
+ $isMarketplaceGalleryImage = $true
+ }
+
+ } else{
+ $isGalleryImage = $true
+ }
+
+ if ($isGalleryImage){
+ $ImageId = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/galleryimages/$ImageName"
+ } else {
+ $ImageId = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/$ImageName"
+ }
+
+ $null = $PSBoundParameters.Remove("ImageResourceGroup")
+ $null = $PSBoundParameters.Remove("ImageName")
+ $PSBoundParameters.Add('ImageId', $ImageId)
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByOsDiskId"){
+ if($OSDiskId -notmatch $vhdRegex){
+ Write-Error "Invalid OSDiskId : $OSDiskId" -ErrorAction Stop
+ }
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByOsDiskName"){
+ if ($OSDiskResourceGroup){
+ $OSDiskId = "/subscriptions/$SubscriptionId/resourceGroups/$OSDiskResourceGroup/providers/Microsoft.AzureStackHCI/virtualharddisks/$OSDiskName"
+ } else {
+ $OSDiskId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/virtualharddisks/$OSDiskName"
+ }
+ $PSBoundParameters.Add('OSDiskId', $OSDiskId)
+ $null = $PSBoundParameters.Remove("OSDiskResourceGroup")
+ $null = $PSBoundParameters.Remove("OSDiskName")
+
+ } else {
+ Write-Error "Either Image or OS Disk is required. " -ErrorAction Stop
+ }
+
+ if ($VmSize){
+ if($VmSize.ToString().ToLower() -eq "default"){
+ Write-Error "Invalid VM Size provided. 'Default' is not a supported VmSize." -ErrorAction Stop
+ }
+ if($VmSize.ToString().ToLower() -eq "custom"){
+ if (-Not ($VmProcessor -and $VmMemoryInMB)){
+ Write-Error "VmMemory and VmProcessor required for Custom VmSize" -ErrorAction Stop
+ }
+ $PSBoundParameters.Add("VmMemory", $VmMemoryInMB)
+ $PSBoundParameters.Add("VmProcessor", $VmProcessor)
+ } else {
+ if ($VmProcessor -or $VmMemoryInMB){
+ Write-Error "VmMemory and VmProcessor will be ignored. Please specify Custom for VMSize." -ErrorAction Continue
+ $null = $PSBoundParameters.Remove("VmProcessor")
+ $null = $PSBoundParameters.Remove("VmMemoryInMB")
+ }
+ }
+ }
+
+ if ($NicId){
+ $NetworkProfileNetworkInterface = [System.Collections.ArrayList]::new()
+ foreach ($NId in $NicId){
+ if ($NId -notmatch $nicRegex){
+ Write-Error "Invalid Nic Id provided: $NId." -ErrorAction Stop
+ }
+
+ $nic = Az.StackHCIVm\Get-AzStackHCIVmNetworkInterface -ResourceId $NId -ErrorAction SilentlyContinue
+ if ($nic -eq $null){
+ Write-Error "A Network Interface with id: $NId does not exist." -ErrorAction Stop
+ }
+
+ $NetworkInterface = @{Id = $NId}
+ [void]$NetworkProfileNetworkInterface.Add($NetworkInterface)
+ }
+ $null = $PSBoundParameters.Remove("NicId")
+ $PSBoundParameters.Add('NetworkProfileNetworkInterface', $NetworkProfileNetworkInterface)
+ } elseif ($NicName){
+ $rg = $ResourceGroupName
+ if($NicResourceGroup){
+ $rg = $NicResourceGroup
+ }
+
+ $NetworkProfileNetworkInterface = [System.Collections.ArrayList]::new()
+ foreach ($NName in $NicName){
+ $NicIdNew = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/networkinterfaces/$NName"
+ $nic = Az.StackHCIVm\Get-AzStackHCIVmNetworkInterface -ResourceId $NicIdNew -ErrorAction SilentlyContinue
+
+ if ($nic -eq $null){
+ Write-Error "A Network Interface with id: $NicIdNew does not exist." -ErrorAction Stop
+ }
+
+ $NetworkInterface = @{Id = $NicIdNew}
+ [void]$NetworkProfileNetworkInterface.Add($NetworkInterface)
+ }
+ $null = $PSBoundParameters.Remove("NicName")
+ $null = $PSBoundParameters.Remove("NicResourceGroup")
+
+ $PSBoundParameters.Add('NetworkProfileNetworkInterface', $NetworkProfileNetworkInterface)
+ }
+ if ($OsType.ToString().ToLower() -eq "windows"){
+ $OsType = "Windows"
+ if($ComputerName){
+ if ($ComputerName.length -gt 15 -or $ComputerName -match $allDigitsRegex -or $ComputerName -match $invalidCharactersComputerName){
+ Write-Error "Invalid Computer Name : $ComputerName." -ErrorAction Stop
+ }
+ }
+ if ($DisablePasswordAuthentication.IsPresent){
+ $null = $PSBoundParameters.Remove('DisablePasswordAuthentication')
+ }
+
+ $PSBoundParameters.Add("WindowConfigurationProvisionVMAgent", $true)
+ $PSBoundParameters.Add("WindowConfigurationProvisionVMConfigAgent", $true)
+ if(-not $ProvisionVMAgent){
+ $null = $PSBoundParameters.Remove("WindowConfigurationProvisionVMAgent")
+ }
+ if (-not $ProvisionVMConfigAgent){
+ $null = $PSBoundParameters.Remove("WindowConfigurationProvisionVMConfigAgent")
+ }
+ $null = $PSBoundParameters.Remove("ProvisionVMAgent")
+ $null = $PSBoundParameters.Remove("ProvisionVMConfigAgent")
+
+
+ if ($SshPublicKey){
+ $WindowsConfigurationSshPublicKey = [System.Collections.ArrayList]::new()
+ foreach ($key in $SshPublicKey){
+ $keyData = Get-Content -Path $key
+ $WindowsKey = @{KeyData = $keyData}
+ [void]$WindowsConfigurationSshPublicKey.Add($WindowsKey)
+ }
+ $null = $PSBoundParameters.Remove('SshPublicKey')
+ $PSBoundParameters.Add("WindowsConfigurationSshPublicKey", $WindowsConfigurationSshPublicKey)
+ }
+ } elseif ($OsType.ToString().ToLower() -eq "linux"){
+ $OsType = "Linux"
+ if ($ComputerName.length -gt 64 -or $ComputerName -match $allDigitsRegex -or $ComputerName -match $invalidCharactersComputerName){
+ Write-Error "Invalid Computer Name : $ComputerName." -ErrorAction Stop
+ }
+ if ($EnableAutomaticUpdates.IsPresent){
+ $null = $PSBoundParameters.Remove('EnableAutomaticUpdates')
+ }
+ if ($TimeZone){
+ $null = $PSBoundParameters.Remove('TimeZone')
+ }
+ $PSBoundParameters.Add("LinuxConfigurationProvisionVMAgent", $true)
+ $PSBoundParameters.Add("LinuxConfigurationProvisionVMConfigAgent", $true)
+ if(-not $ProvisionVMAgent){
+ $null = $PSBoundParameters.Remove("LinuxConfigurationProvisionVMAgent")
+ }
+ if (-not $ProvisionVMConfigAgent){
+ $null = $PSBoundParameters.Remove("LinuxConfigurationProvisionVMConfigAgent")
+ }
+ $null = $PSBoundParameters.Remove("ProvisionVMAgent")
+ $null = $PSBoundParameters.Remove("ProvisionVMConfigAgent")
+
+
+ if ($SshPublicKey){
+ $LinuxConfigurationSshPublicKey = [System.Collections.ArrayList]::new()
+ foreach ($key in $SshPublicKey){
+ $keyData = Get-Content -Path $key
+ $LinuxKey = @{KeyData = $keyData}
+ [void]$LinuxConfigurationSshPublicKey.Add($LinuxKey)
+ }
+ $null = $PSBoundParameters.Remove('SshPublicKey')
+ $PSBoundParameters.Add("LinuxConfigurationSshPublicKey", $LinuxConfigurationSshPublicKey)
+ }
+ } else {
+ Write-Error "Invalid OSType provided: $OsType. Accepted Values are 'Windows' and 'Linux'" -ErrorAction Stop
+ }
+
+ if($StoragePathId){
+ if($StoragePathId -notmatch $storagePathRegex){
+ Write-Error "Invalid StoragePathId: $StoragePathId" -ErrorAction Stop
+ }
+ } elseif ($StoragePathName){
+ if ($StoragePathResourceGroup){
+ $ContainerId = "/subscriptions/$SubscriptionId/resourceGroups/$StoragePathResourceGroup/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ } else {
+ $ContainerId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/storagecontainers/$StoragePathName"
+ }
+ $PSBoundParameters.Add('StoragePathId', $ContainerId)
+ $null = $PSBoundParameters.Remove("StoragePathName")
+ $null = $PSBoundParameters.Remove("StoragePathReourceGroup")
+ }
+
+
+ if ($DataDiskId){
+ $StorageProfileDataDisk = [System.Collections.ArrayList]::new()
+ foreach ($DiskId in $DataDiskId){
+ if ($DiskId -notmatch $vhdRegex){
+ Write-Error "Invalid Data Disk Id provided: $DiskId." -ErrorAction Stop
+ }
+ $DataDisk = @{Id = $DiskId}
+ [void]$StorageProfileDataDisk.Add($DataDisk)
+ }
+ $null = $PSBoundParameters.Remove("DataDiskId")
+ $PSBoundParameters.Add('StorageProfileDataDisk', $StorageProfileDataDisk)
+ } elseif ($DataDiskName){
+ $rg = $ResourceGroupName
+ if($DataDiskResourceGroup){
+ $rg = $DataDiskResourceGroup
+ }
+
+ $StorageProfileDataDisk = [System.Collections.ArrayList]::new()
+ foreach ($DiskName in $DataDiskName){
+ $DataDiskIdNew = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/virtualharddisks/$DiskName"
+ $DataDisk = @{Id = $DataDiskIdNew}
+ [void]$StorageProfileDataDisk.Add($DataDisk)
+ }
+ $null = $PSBoundParameters.Remove("DataDiskName")
+ $null = $PSBoundParameters.Remove("DataDiskResourceGroup")
+ $PSBoundParameters.Add('StorageProfileDataDisk', $StorageProfileDataDisk)
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ $PSBoundParameters.Add("CustomLocationId", $CustomLocationId)
+ $PSBoundParameters.Add("OSDiskOstype", $OsType)
+ $PSBoundParameters.Add('VmSize', $VmSize)
+ if ($ComputerName){
+ $PSBoundParameters.Add('ComputerName', $ComputerName)
+ }
+ if ($AdminUsername){
+ $PSBoundParameters.Add('AdminUsername', $AdminUsername)
+ }
+ if ($AdminPassword){
+ $PSBoundParameters.Add('AdminPassword', $AdminPassword)
+ }
+ if ($DynamicMemoryMaximumMemory){
+ $PSBoundParameters.Add('DynamicMemoryMaximumMemory', $DynamicMemoryMaximumMemory)
+ }
+ if ($DynamicMemoryMinimumMemory){
+ $PSBoundParameters.Add('DynamicMemoryMinimumMemory', $DynamicMemoryMinimumMemory)
+ }
+ if ($DynamicMemoryTargetBuffer){
+ $PSBoundParameters.Add('DynamicMemoryTargetBuffer', $DynamicMemoryTargetBuffer)
+ }
+ if ($EnableTpm.IsPresent){
+ $PSBoundParameters.Add('EnableTpm', $EnableTpm)
+ }
+ IF($SecureBootEnabled.IsPresent){
+ $PSBoundParameters.Add('SecureBootEnabled', $SecureBootEnabled)
+ }
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("NicResourceGroup")
+ $null = $PSBoundParameters.Remove("NicName")
+ $null = $PSBoundParameters.Remove("Kind")
+ $null = $PSBoundParameters.Remove("Location")
+ $null = $PSBoundParameters.Remove("OSType")
+ $null = $PSBoundParameters.Remove("IdentityType")
+ return Az.StackHCIVm.internal\New-AzStackHCIVmVirtualMachine @PSBoundParameters
+}
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/README.md b/src/StackHCI/StackHCIVm.Autorest/custom/README.md
new file mode 100644
index 000000000000..49765a5e4af0
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.StackHCIVm` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.StackHCIVm.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.StackHCIVm` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.StackHCIVm.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.StackHCIVm.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.StackHCIVm`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.StackHCIVm`.
+- `Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.StackHCIVm`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMImage.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMImage.ps1
new file mode 100644
index 000000000000..2d6c96f344ba
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMImage.ps1
@@ -0,0 +1,141 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete an image.
+.Description
+The operation to delete an image.
+
+.Outputs
+System.Boolean
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmimage
+#>
+
+function Remove-AzStackHCIVmImage{
+ [OutputType([System.Boolean])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the gallery image
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the image.
+ ${ResourceId},
+
+ [Parameter(HelpMessage='Forces the cmdlet to remove the network interface without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force}
+ )
+
+
+ Write-Warning("Running this command will delete the image.")
+ $isGalleryImage = $false
+ $isMarketplaceGalleryImage = $false
+
+ if ($PSCmdlet.ParameterSetName -eq "ByName"){
+ $isGalleryImage = $false
+ $isMarketplaceGalleryImage = $false
+
+
+ $galImage = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage -Name $Name -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue
+ if ($galImage -ne $null){
+ $isGalleryImage = $true
+ } else {
+ $marketplaceGalImage = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage -Name $Name -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue
+ if ($marketplaceGalImage -ne $null){
+ $isMarketplaceGalleryImage = $true
+ }
+ }
+
+ if (!$isGalleryImage -and !$isMarketplaceGalleryImage ){
+ Write-Error "An Image with name: $Name does not exist in Resource Group: $ResourceGroupName" -ErrorAction Stop
+ }
+
+
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+
+ if ($ResourceId -match $galImageRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ $isGalleryImage = $true
+
+ } elseif ($ResourceId -match $marketplaceGalImageRegex){
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ $isMarketplaceGalleryImage = $true
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId" -ErrorAction Stop
+ }
+ }
+
+ if ($PSCmdlet.ShouldProcess($PSBoundParameters['Name']) -and ($Force -or $PSCmdlet.ShouldContinue("Delete this image?", "Confirm")))
+ {
+ if ($PSBoundParameters.ContainsKey("Force")) {
+ $null = $PSBoundParameters.Remove("Force")
+ }
+
+ if ($isMarketplaceGalleryImage)
+ {
+ return Az.StackHCIVm.internal\Remove-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+ }
+
+ if ($isGalleryImage)
+ {
+ return Az.StackHCIVm.internal\Remove-AzStackHCIVmGalleryImage @PSBoundParameters
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineDataDisk.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineDataDisk.ps1
new file mode 100644
index 000000000000..86106e649bfe
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineDataDisk.ps1
@@ -0,0 +1,158 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a data disk from a virtual machine.
+.Description
+The operation to delete a data disk from a virtual machine.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmvirtualmachinedatadisk
+#>
+
+function Remove-AzStackHCIVmVirtualMachineDataDisk {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # Data Disks - list of data disks to be removed from the virtual machine in id format.
+ ${DataDiskId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # Data Disks - list of data disks to be removed from the virtual machine in name format.
+ ${DataDiskName},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # Resource Group of the Data Disks.
+ ${DataDiskResourceGroup}
+ )
+
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid" -ErrorAction Stop
+ }
+
+
+ $NewStorageProfileDataDisk = [System.Collections.ArrayList]::new()
+ $diskList = [System.Collections.ArrayList]::new()
+ $VM = Az.StackHCIVm.internal\Get-AzStackHCIVmVirtualMachine -ResourceUri $resourceUri
+ if ($VM.StorageProfileDataDisk.Id.GetType() -eq [System.String]){
+ [void]$diskList.add($VM.StorageProfileDataDisk.Id)
+ } else {
+ $diskList = [System.Collections.ArrayList]$VM.StorageProfileDataDisk.Id
+ }
+
+ if ($DataDiskId){
+ $DataDisks = $PSBoundParameters['DataDiskId']
+ $null = $PSBoundParameters.Remove("DataDiskId")
+
+ foreach ($DataDisk in $DataDisks){
+ $diskName = ($DataDisk -split "/")[8]
+ if ($DataDisk -in $diskList) {
+ [void]$diskList.Remove($DataDisk)
+ } elseif ( $diskName -in $diskList){
+ [void]$diskList.Remove($diskName)
+ } else {
+ Write-Error "Data Disk is not currently attached: $DataDisk"
+ }
+ }
+
+ $PSBoundParameters.Add('StorageProfileDataDisk', $StorageProfileDataDisk)
+
+ } elseif ($DataDiskName){
+ $rg = $ResourceGroupName
+ if($DataDiskResourceGroup){
+ $rg = $DataDiskResourceGroup
+ }
+
+ $null = $PSBoundParameters.Remove("DataDiskName")
+ $null = $PSBoundParameters.Remove("DataDiskResourceGroup")
+
+ foreach ($DiskName in $DataDiskName){
+ $DiskId = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/virtualHardDisks/$DiskName"
+ if ($DiskId -in $diskList) {
+ [void]$diskList.Remove($DiskId)
+ } elseif ($DiskName -in $diskList) {
+ [void]$diskList.Remove($DiskName)
+ } else {
+ Write-Error "Data Disk is not currently attached: $DiskName"
+ }
+ }
+
+ }
+
+ foreach ($disk in $diskList){
+ $DataDisk = @{Id = $disk}
+ [void]$NewStorageProfileDataDisk.Add($DataDisk)
+ }
+
+ $PSBoundParameters.Add('StorageProfileDataDisk', $NewStorageProfileDataDisk)
+
+
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmVirtualMachine @PSBoundParameters
+ }
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineNetworkInterface.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineNetworkInterface.ps1
new file mode 100644
index 000000000000..87078da7089c
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVMVirtualMachineNetworkInterface.ps1
@@ -0,0 +1,157 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a network interface from a virtual machine.
+.Description
+The operation to delete a network interface from a virtual machine.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmvirtualmachinenetworkinterface
+#>
+
+function Remove-AzStackHCIVmVirtualMachineNetworkInterface {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be attached from the virtual machine in id format.
+ ${NicId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String[]]
+ # NetworkInterfaces - list of network interfaces to be removed from the virtual machine in name format.
+ ${NicName},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='ByName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.String]
+ # NetworkInterfaces - resource group of the network interfaces
+ ${NicResourceGroup}
+ )
+
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+
+ $NewNetworkProfileNetworkInterface = [System.Collections.ArrayList]::new()
+ $nicList = [System.Collections.ArrayList]::new()
+ $VM = Az.StackHCIVm.internal\Get-AzStackHCIVmVirtualMachine -ResourceUri $resourceUri
+
+ if ($VM.NetworkProfileNetworkInterface.Id.GetType() -eq [System.String]){
+ [void]$nicList.add($VM.NetworkProfileNetworkInterface.Id)
+ } else {
+ $nicList = [System.Collections.ArrayList]$VM.NetworkProfileNetworkInterface.Id
+ }
+
+ if ($NicId){
+ $NicId = $PSBoundParameters['NicId']
+ $null = $PSBoundParameters.Remove("NicId")
+
+ foreach ($NId in $NicId){
+ $nicName = ($NId -split "/")[8]
+ if ($NId -in $nicList){
+ $nicList.Remove($NId)
+ } elseif ($nicName -in $nicList){
+ $nicList.Remove($nicName)
+ } else {
+ Write-Error "Network Interface not currently attached: $NId"
+ }
+ }
+
+ } elseif ($NicName){
+ $rg = $ResourceGroupName
+ if($NicResourceGroup){
+ $rg = $NicResourceGroup
+ }
+
+ $null = $PSBoundParameters.Remove("NicName")
+ $null = $PSBoundParameters.Remove("NicResourceGroup")
+
+
+ foreach ($NName in $NicName){
+ $NId = "/subscriptions/$SubscriptionId/resourceGroups/$rg/providers/Microsoft.AzureStackHCI/networkInterfaces/$NName"
+ if ($NId -in $nicList){
+ [void]$nicList.Remove($NId)
+ } elseif ($NName -in $nicList) {
+ $nicList.Remove($NName)
+ } else {
+ Write-Error "Network Interface not currently attached: $NName"
+ }
+ }
+
+ }
+
+ foreach ($nic in $nicList){
+ $Nic = @{Id = $nic}
+ [void]$NewNetworkProfileNetworkInterface.Add($Nic)
+ }
+
+
+ $PSBoundParameters.Add('NetworkProfileNetworkInterface', $NewNetworkProfileNetworkInterface)
+
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmVirtualMachine @PSBoundParameters
+ }
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualHardDisk_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualHardDisk_New.ps1
new file mode 100644
index 000000000000..8771493f8a76
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualHardDisk_New.ps1
@@ -0,0 +1,104 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a virtual hard disk.
+.Description
+The operation to delete a virtual hard disk.
+
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmvirtualharddisk
+#>
+function Remove-AzStackHCIVmVirtualHardDisk {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess=$true, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Alias('VirtualHardDiskName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual hard disk
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual hard disk.
+ ${ResourceId},
+
+ [Parameter(HelpMessage='Forces the cmdlet to remove the virtual hard disk without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force}
+
+ )
+
+
+
+ process {
+
+ Write-Warning("Running this command will delete the virtual hard disk.")
+
+ if ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if ($ResourceId -match $vhdRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['vhdName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId" -ErrorAction Stop
+ }
+ }
+ if ($PSCmdlet.ShouldProcess($PSBoundParameters['Name']) -and ($Force -or $PSCmdlet.ShouldContinue("Delete this virtual hard disk?", "Confirm")))
+ {
+ if ($PSBoundParameters.ContainsKey("Force")) {
+ $null = $PSBoundParameters.Remove("Force")
+ }
+
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmVirtualHardDisk @PSBoundParameters
+ }
+
+ }
+
+
+
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualMachine_New.ps1
new file mode 100644
index 000000000000..c5fc706950c3
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHCIVmVirtualMachine_New.ps1
@@ -0,0 +1,191 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a virtual machine.
+.Description
+The operation to delete a virtual machine.
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity
+.Outputs
+System.Boolean
+.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.
+
+INPUTOBJECT : Identity Parameter
+ [ExtensionName ]: The name of the machine extension.
+ [GalleryImageName ]: Name of the gallery image
+ [Id ]: Resource identity path
+ [MarketplaceGalleryImageName ]: Name of the marketplace gallery image
+ [MetadataName ]: Name of the hybridIdentityMetadata.
+ [Name ]: The name of the machine where the extension should be created or updated.
+ [NetworkInterfaceName ]: Name of the network interface
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [StorageContainerName ]: Name of the storage container
+ [SubscriptionId ]: The ID of the target subscription.
+ [VirtualHardDiskName ]: Name of the virtual hard disk
+ [VirtualMachineName ]: Name of the virtual machine
+ [VirtualNetworkName ]: Name of the virtual network
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmvirtualmachine
+#>
+function Remove-AzStackHCIVmVirtualMachine {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='ByResourceId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter(HelpMessage='Forces the cmdlet to remove the virtual machine without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+
+ process {
+ Write-Warning("Running this command will delete the virtual machine.")
+ if ($Force -or $PSCmdlet.ShouldContinue("Delete this virtual machine?", "Confirm"))
+ {
+ if ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if ($ResourceId -match $vmRegex) {
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId" -ErrorAction Stop
+ }
+ }
+ if ($PSCmdlet.ParameterSetName -eq "ByName"){
+ if ($SubscriptionId -and $ResourceGroupName -and $Name){
+ $resourceUri = "/subscriptions/" + $SubscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ } else {
+ Write-Error "One or more input parameters are invalid. Name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+ }
+
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("Force")
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmVirtualMachine @PSBoundParameters
+
+ $PSBoundParameters.Add("SubscriptionId", $SubscriptionId)
+ $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $PSBoundParameters.Add("Name", $Name)
+ $null = $PSBoundParameters.Remove("ResourceUri")
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmMachine @PSBoundParameters
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMLogicalNetwork_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMLogicalNetwork_New.ps1
new file mode 100644
index 000000000000..86c12cd4d811
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMLogicalNetwork_New.ps1
@@ -0,0 +1,96 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a logical network.
+.Description
+The operation to delete a logical network.
+
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmlogicalnetwork
+#>
+function Remove-AzStackHCIVmLogicalNetwork {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('LogicalNetworkName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual network
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual network.
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(ParameterSetName='Delete')]
+ [Parameter(HelpMessage='Forces the cmdlet to remove the virtual network without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force}
+ )
+
+ Write-Warning("Running this command will delete the logical network.")
+ if ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if ($ResourceId -match $lnetRegex){
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['logicalNetworkName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId" -ErrorAction Stop
+ }
+ }
+ if ($PSCmdlet.ShouldProcess($PSBoundParameters['Name']) -and ($Force -or $PSCmdlet.ShouldContinue("Delete this logical network?", "Confirm")))
+ {
+ if ($PSBoundParameters.ContainsKey("Force")) {
+ $null = $PSBoundParameters.Remove("Force")
+ }
+
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmLogicalNetwork @PSBoundParameters
+ }
+
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMNetworkInterface_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMNetworkInterface_New.ps1
new file mode 100644
index 000000000000..29206c4ae062
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMNetworkInterface_New.ps1
@@ -0,0 +1,114 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a network interface.
+.Description
+The operation to delete a network interface.
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity
+.Outputs
+System.Boolean
+.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.
+
+INPUTOBJECT : Identity Parameter
+ [ExtensionName ]: The name of the machine extension.
+ [GalleryImageName ]: Name of the gallery image
+ [Id ]: Resource identity path
+ [MarketplaceGalleryImageName ]: Name of the marketplace gallery image
+ [MetadataName ]: Name of the hybridIdentityMetadata.
+ [Name ]: The name of the machine where the extension should be created or updated.
+ [NetworkInterfaceName ]: Name of the network interface
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [StorageContainerName ]: Name of the storage container
+ [SubscriptionId ]: The ID of the target subscription.
+ [VirtualHardDiskName ]: Name of the virtual hard disk
+ [VirtualMachineName ]: Name of the virtual machine
+ [VirtualNetworkName ]: Name of the virtual network
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmnetworkinterface
+#>
+function Remove-AzStackHCIVmNetworkInterface {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(DefaultParameterSetName='ByResourceId', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Alias('NetworkInterfaceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the network interface
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the network interface.
+ ${ResourceId},
+
+ [Parameter(HelpMessage='Forces the cmdlet to remove the network interface without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force}
+ )
+
+ Write-Warning("Running this command will delete the network interface.")
+ if ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if ($ResourceId -match $nicRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['nicName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId" -ErrorAction Stop
+ }
+ }
+ if ($PSCmdlet.ShouldProcess($PSBoundParameters['Name']) -and ($Force -or $PSCmdlet.ShouldContinue("Delete this network interface?", "Confirm")))
+ {
+ if ($PSBoundParameters.ContainsKey("Force")) {
+ $null = $PSBoundParameters.Remove("Force")
+ }
+
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmNetworkInterface @PSBoundParameters
+ }
+
+
+
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMStoragePath_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMStoragePath_New.ps1
new file mode 100644
index 000000000000..3aa2c11dad7c
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Remove-AzStackHciVMStoragePath_New.ps1
@@ -0,0 +1,200 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to delete a storage container.
+.Description
+The operation to delete a storage container.
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity
+.Outputs
+System.Boolean
+.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.
+
+INPUTOBJECT : Identity Parameter
+ [ExtensionName ]: The name of the machine extension.
+ [GalleryImageName ]: Name of the gallery image
+ [Id ]: Resource identity path
+ [MarketplaceGalleryImageName ]: Name of the marketplace gallery image
+ [MetadataName ]: Name of the hybridIdentityMetadata.
+ [Name ]: The name of the machine where the extension should be created or updated.
+ [NetworkInterfaceName ]: Name of the network interface
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [StorageContainerName ]: Name of the storage container
+ [SubscriptionId ]: The ID of the target subscription.
+ [VirtualHardDiskName ]: Name of the virtual hard disk
+ [VirtualMachineName ]: Name of the virtual machine
+ [VirtualNetworkName ]: Name of the virtual network
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/remove-azstackhcivmstoragepath
+#>
+function Remove-AzStackHCIVmStoragePath {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Alias('StorageContainerName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the storage container
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='ByResourceId',Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the storage path.
+ ${ResourceId},
+
+ [Parameter(HelpMessage='Forces the cmdlet to remove the storage path without prompting for confirmation.')]
+ [System.Management.Automation.SwitchParameter]
+ ${Force},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [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(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [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(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [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(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [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(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ Write-Warning("Running this command will delete the storage path.")
+
+ if ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+ if ($ResourceId -match $storagePathRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['storagePathName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+ }
+
+ if ($PSCmdlet.ShouldProcess($PSBoundParameters['Name']) -and ($Force -or $PSCmdlet.ShouldContinue("Delete this storage path?", "Confirm")))
+ {
+ if ($PSBoundParameters.ContainsKey("Force")) {
+ $null = $PSBoundParameters.Remove("Force")
+ }
+
+ Az.StackHCIVm.internal\Remove-AzStackHCIVmStoragePath @PSBoundParameters
+ }
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Restart-AzStackHCIVMVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Restart-AzStackHCIVMVirtualMachine_New.ps1
new file mode 100644
index 000000000000..bf354ea4b1b8
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Restart-AzStackHCIVMVirtualMachine_New.ps1
@@ -0,0 +1,139 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to restart a virtual machine instance.
+.Description
+The operation to restart a virtual machine instance.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/restart-azstackhcivmvirtualmachine
+#>
+function Restart-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ return Az.StackHCIVm.internal\Restart-AzStackHCIVmVirtualMachine @PSBoundParameters
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+}
+
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Start-AzStackHCIVMVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Start-AzStackHCIVMVirtualMachine_New.ps1
new file mode 100644
index 000000000000..60e7bb6974de
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Start-AzStackHCIVMVirtualMachine_New.ps1
@@ -0,0 +1,139 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to start a virtual machine instance.
+.Description
+The operation to start a virtual machine instance.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/start-azstackhcivmvirtualmachine
+#>
+function Start-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ return Az.StackHCIVm.internal\Start-AzStackHCIVmVirtualMachine @PSBoundParameters
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Stop-AzStackHCIVMVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Stop-AzStackHCIVMVirtualMachine_New.ps1
new file mode 100644
index 000000000000..2afd2e19c7e6
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Stop-AzStackHCIVMVirtualMachine_New.ps1
@@ -0,0 +1,141 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to stop a virtual machine instance.
+.Description
+The operation to stop a virtual machine instance.
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.IStackHCIVmIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.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.
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/stop-azstackhcivmvirtualmachine
+#>
+function Stop-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual machine.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+ )
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ return Az.StackHCIVm.internal\Stop-AzStackHCIVmVirtualMachine @PSBoundParameters
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMImage.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMImage.ps1
new file mode 100644
index 000000000000..cd9d10a8ceaf
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMImage.ps1
@@ -0,0 +1,119 @@
+<#
+.Synopsis
+The operation to update an image.
+
+.Description
+The operation to update an image.
+Please note some properties can be set only during image creation.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20221215Preview.IGalleryImages
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20221215Preview.IMarketplaceGalleryImages
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmimage
+#>
+
+function Update-AzStackHCIVmImage{
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages],ParameterSetName='Marketplace' )]
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages],ParameterSetName='GalleryImage' )]
+ [CmdletBinding(DefaultParameterSetName='GalleryImage', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+
+ param(
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the gallery image
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the image.
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName')]
+ [Parameter(ParameterSetName='ByResourceId')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImagesUpdateRequestTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag}
+
+)
+
+ process {
+ if ($PSCmdlet.ParameterSetName -eq "ByName"){
+
+ $isGalleryImage = $false
+ $isMarketplaceGalleryImage = $false
+
+
+ $galImage = Az.StackHCIVm.internal\Get-AzStackHCIVmGalleryImage -Name $Name -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId -ErrorAction SilentlyContinue
+ if ($galImage -ne $null){
+ $isGalleryImage = $true
+ } else {
+ $marketplaceGalImage = Az.StackHCIVm.internal\Get-AzStackHCIVmMarketplaceGalleryImage -Name $Name -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId -ErrorAction SilentlyContinue
+ if ($marketplaceGalImage -ne $null){
+ $isMarketplaceGalleryImage = $true
+ }else{
+ Write-Error "An Image with name: $Name does not exist in Resource Group: $ResourceGroupName" -ErrorAction Stop
+ }
+ }
+
+
+ if ($isGalleryImage){
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmGalleryImage @PSBoundParameters
+ }
+
+ if ($isMarketplaceGalleryImage){
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+ }
+
+ } elseif ($PSCmdlet.ParameterSetName -eq "ByResourceId"){
+
+ if ($ResourceId -match $galImageRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmGalleryImage @PSBoundParameters
+
+ } elseif ($ResourceId -match $marketplaceGalImageRegex){
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['imageName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmMarketplaceGalleryImage @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMLogicalNetwork_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMLogicalNetwork_ByResourceId.ps1
new file mode 100644
index 000000000000..a01ffd01211d
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMLogicalNetwork_ByResourceId.ps1
@@ -0,0 +1,70 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to update a logical network.
+.Description
+The operation to update a logical network.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmlogicalnetwork
+#>
+function Update-AzStackHCIVmLogicalNetwork_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks])]
+[CmdletBinding(PositionalBinding=$false)]
+
+param(
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual network.
+ ${ResourceId},
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworksUpdateRequestTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag}
+
+
+
+)
+ process {
+
+ if ($ResourceId -match $lnetRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['logicalNetworkName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Update-AzStackHCIVmLogicalNetwork @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMNetworkInterface_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMNetworkInterface_ByResourceId.ps1
new file mode 100644
index 000000000000..0cb6800df3cb
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMNetworkInterface_ByResourceId.ps1
@@ -0,0 +1,68 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to update a network interface.
+.Description
+The operation to update a network interface.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmnetworkinterface
+#>
+function Update-AzStackHCIVmNetworkInterface_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces])]
+[CmdletBinding(PositionalBinding=$false)]
+
+param(
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the network interface.
+ ${ResourceId},
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfacesUpdateRequestTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag}
+
+)
+ process {
+
+ if ($ResourceId -match $nicRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['nicName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Update-AzStackHCIVmNetworkInterface @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMStoragePath_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMStoragePath_ByResourceId.ps1
new file mode 100644
index 000000000000..834e78fa355b
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMStoragePath_ByResourceId.ps1
@@ -0,0 +1,70 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to update a storage path.
+.Description
+The operation to update a storage path.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVStorageContainers
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmstoragepath
+#>
+function Update-AzStackHCIVmStoragePath_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers])]
+[CmdletBinding(PositionalBinding=$false)]
+
+param(
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the storage path.
+ ${ResourceId},
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainersUpdateRequestTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag}
+
+
+
+)
+ process {
+
+ if ($ResourceId -match $storagePathRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['storagePathName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Update-AzStackHCIVmStoragePath @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1
new file mode 100644
index 000000000000..bca2d9810845
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1
@@ -0,0 +1,68 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to update a virtual hard disk.
+.Description
+The operation to update a virtual hard disk.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks
+
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmvirtualharddisks
+#>
+function Update-AzStackHCIVmVirtualHardDisk_ByResourceId {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks])]
+[CmdletBinding(PositionalBinding=$false)]
+
+param(
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual hard disk .
+ ${ResourceId},
+
+
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisksUpdateRequestTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag}
+
+)
+ process {
+
+ if ($ResourceId -match $vhdRegex){
+
+ $subscriptionId = $($Matches['subscriptionId'])
+ $resourceGroupName = $($Matches['resourceGroupName'])
+ $resourceName = $($Matches['vhdName'])
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $PSBoundParameters.Add("Name", $resourceName)
+ $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $PSBoundParameters.Add("SubscriptionId", $subscriptionId)
+
+ return Az.StackHCIVm\Update-AzStackHCIVmVirtualHardDisk @PSBoundParameters
+
+ } else {
+ Write-Error "Resource ID is invalid: $ResourceId"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualMachine_New.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualMachine_New.ps1
new file mode 100644
index 000000000000..ca7bfddbf832
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/Update-AzStackHCIVMVirtualMachine_New.ps1
@@ -0,0 +1,209 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to update a virtual machine instance.
+.Description
+The operation to update a virtual machine instance.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+
+
+NETWORKPROFILENETWORKINTERFACE : NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance
+ [Id ]: ID - Resource ID of the network interface
+
+STORAGEPROFILEDATADISK : adds data disks to the virtual machine instance for the update call
+ [Id ]:
+.Link
+https://learn.microsoft.com/powershell/module/az.stackhci/update-azstackhcivmvirtualmachine
+#>
+function Update-AzStackHCIVmVirtualMachine {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance])]
+ [CmdletBinding(DefaultParameterSetName='ByName', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+
+ param(
+ [Parameter(ParameterSetName='ByResourceId', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The ARM Resource ID of the virtual network.
+ ${ResourceId},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Alias('VirtualMachineName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # Name of the virtual machine
+ ${Name},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Indicates whether virtual machine agent should be provisioned on the virtual machine.
+ ${ProvisionVMAgent},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Indicates whether virtual machine configuration agent should be provisioned on the virtual machine.
+ ${ProvisionVMConfigAgent},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int64]
+ # RAM in MB for the virtual machine instance
+ ${VmMemoryInMB},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [System.Int32]
+ # number of processors for the virtual machine instance
+ ${VmProcessor},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.VMSizeEnum])]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Support.VMSizeEnum]
+ # .
+ ${VmSize},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+
+
+ )
+ process {
+
+ if (($ResourceId -match $vmRegex) -or ($Name -and $ResourceGroupName -and $SubscriptionId)){
+ if ($ResourceId -match $vmRegex){
+ $SubscriptionId = $($Matches['subscriptionId'])
+ $ResourceGroupName = $($Matches['resourceGroupName'])
+ $Name = $($Matches['machineName'])
+ }
+ $resourceUri = "/subscriptions/" + $subscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + $Name
+ $PSBoundParameters.Add("ResourceUri", $resourceUri)
+ if ($VmMemoryInMB)
+ {
+ $PSBoundParameters.Add("HardwareProfileMemoryMb", $VmMemoryInMB)
+ $null = $PSBoundParameters.Remove("VmMemoryInMB")
+ }
+ if ($VmProcessor)
+ {
+ $PSBoundParameters.Add("HardwareProfileProcessor", $VmProcessor)
+ $null = $PSBoundParameters.Remove("VmProcessor")
+ }
+ if ($VmSize)
+ {
+ $PSBoundParameters.Add("HardwareProfileVMSize", $VmSize)
+ $null = $PSBoundParameters.Remove("VmSize")
+ }
+
+ if ($ProvisionVMAgent){
+ $PSBoundParameters.Add("LinuxConfigurationProvisionVMAgent", $true)
+ $PSBoundParameters.Add("WindowConfigurationProvisionVMAgent", $true)
+ }
+ if ($ProvisionVMConfigAgent){
+ $PSBoundParameters.Add("LinuxConfigurationProvisionVMConfigAgent", $true)
+ $PSBoundParameters.Add("WindowConfigurationProvisionVMConfigAgent", $true)
+ }
+
+ $null = $PSBoundParameters.Remove("ProvisionVMAgent")
+ $null = $PSBoundParameters.Remove("ProvisionVMConfigAgent")
+
+
+ $null = $PSBoundParameters.Remove("SubscriptionId")
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("ResourceId")
+ $null = $PSBoundParameters.Remove("Name")
+ return Az.StackHCIVm.internal\Update-AzStackHCIVmVirtualMachine @PSBoundParameters
+ } else {
+ Write-Error "One or more input parameters are invalid. Resource ID is: $ResourceId, name is $name, resource group name is $resourcegroupname, subscription id is $subscriptionid"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/utilities/NetworkInterfaceValidations.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/NetworkInterfaceValidations.ps1
new file mode 100644
index 000000000000..a08f692e3555
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/NetworkInterfaceValidations.ps1
@@ -0,0 +1,39 @@
+function Confirm-IpConfigrations{
+[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DoNotExportAttribute()]
+param(
+ [Parameter()]
+ [System.Collections.Hashtable[]]
+ $IpConfigurations
+)
+ foreach ($IpConfig in $IpConfigurations){
+ foreach ($Key in $IpConfig.Keys){
+ if($Key.ToLower() -eq "gateway"){
+ if ($IpConfig[$Key] -notmatch $ipv4Regex){
+ Write-Error "Invalid Gateway Address : $IpConfig[$Key]" -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "name"){
+
+ } elseif ($Key.ToLower() -eq "prefixlength"){
+ if ($IpConfig[$Key] -gt 32 -and $IpConfig[$Key] -lt 0){
+ Write-Error "Invalid Prefix Length : $IpConfig[$Key] " -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "ipaddress") {
+ if ($IpConfig[$Key] -notmatch $ipv4Regex){
+ Write-Error "Invalid Ip Address provided : $IpConfig[$Key]" -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "ipallocationmethod"){
+ if ($IpConfig[$Key].ToLower() -ne "dynamic" -and $IpConfig[$Key].ToLower() -ne "static"){
+ Write-Error "Invalid Ip Allocation method provided: $IpConfig[$Key]. Accepted values are 'Dynamic' or 'Static'" -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "subnetid"){
+ if ($IpConfig[$Key]-notmatch $vnetRegex){
+ Write-Error "Invalid SubnetId: $IpConfig[$Key]" -ErrorAction Stop
+ }
+ } else {
+ Write-Error "Invalid Key specified in IpConfigurations object: $IpConfig[$Key]" -ErrorAction Stop
+ }
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/utilities/RegExValidations.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/RegExValidations.ps1
new file mode 100644
index 000000000000..5350b75b5998
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/RegExValidations.ps1
@@ -0,0 +1,26 @@
+$lnetRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/logicalnetworks/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9])$"
+$galImageRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/galleryimages/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9])$"
+$marketplaceGalImageRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9])$"
+$vhdRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/virtualharddisks/(?[-_a-zA-Z0-9]{1,80})$"
+$nicRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/networkinterfaces/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9])$"
+$vmRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.HybridCompute/machines/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9])/providers/Microsoft.AzureStackHCI/VirtualMachineInstances/default$"
+$storagePathRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/storagecontainers/(?[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9])$"
+$customLocationRegex = "(?i)^/?subscriptions/(?[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?[-\w\._\(\)]{1,90})/providers/Microsoft.ExtendedLocation/customLocations/(?[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])$"
+
+$imageNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$"
+$nicNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"
+$storagePathNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"
+$vhdNameRegex = "^[-_a-zA-Z0-9]{1,80}$"
+$machineNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$"
+$vnetNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9]$"
+$subnetNameRegex = "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"
+
+$ipv4Regex = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
+$cidrRegex = "^([0-9]{1,3}\.){3}[0-9]{1,3}\/\b(([0-9]|[1-2][0-9]|3[0-2]))?$"
+$macAddressRegex = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9a-fA-F]{4}\\.[0-9a-fA-F]{4}\\.[0-9a-fA-F]{4})$"
+
+$allDigitsRegex = "^[0-9]$"
+$invalidCharactersComputerName = "[`~!@#$%^&*()=+_\[\]\{\}\\|;:.'`"<>/?]"
+
+
+$urnRegex = "(?i)^(?[-._a-zA-Z0-9]+):(?[-._a-zA-Z0-9]+):(?[-._a-zA-Z0-9]+):(?[-._a-zA-Z0-9]+)$"
diff --git a/src/StackHCI/StackHCIVm.Autorest/custom/utilities/VirtualNetworkValidations.ps1 b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/VirtualNetworkValidations.ps1
new file mode 100644
index 000000000000..e0ff796856e5
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/custom/utilities/VirtualNetworkValidations.ps1
@@ -0,0 +1,104 @@
+function Confirm-IpPools{
+[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DoNotExportAttribute()]
+param(
+ [Parameter()]
+ [System.Collections.Hashtable[]]
+ $IpPools
+)
+
+ foreach ($IpPool in $IpPools){
+ foreach ($Key in $IpPool.Keys){
+ if($Key.ToLower() -eq "end"){
+ if ($IpPool[$Key] -notmatch $ipv4Regex){
+ Write-Error "Invalid ipaddress provided for IpPoolEnd : $IpPool[$Key]." -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "start"){
+ if ($IpPool[$Key] -notmatch $ipv4Regex){
+ Write-Error "Invalid ipaddress provided for IpPoolStart : $IpPool[$Key]." -ErrorAction Stop
+ }
+
+ } elseif($Key.ToLower() -eq "type"){
+ if ($IpPool[$Key] -ne "vm" -and $IpPool[$Key] -ne "vippool"){
+ Write-Error "Invalid IpPoolType provided: $IpPool[$Key]. Accepted values are 'vm' and 'vippool'." -ErrorAction Stop
+ }
+
+ } else {
+ Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'Start', 'End', and 'Type'." -ErrorAction Stop
+ }
+ }
+ }
+}
+
+function Confirm-Routes{
+[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DoNotExportAttribute()]
+param(
+ [Parameter()]
+ [System.Collections.Hashtable[]]
+ $Routes
+)
+
+ foreach ($Route in $Routes){
+ foreach ($Key in $Route.Keys){
+ if($Key.ToLower() -eq "addressprefix"){
+ if ($Route[$Key] -notmatch $cidrRegex){
+ Write-Error "Invalid ipaddress provided for AddressPrefix for route : $Route[$Key]." -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "name"){
+ if ($Route[$Key] -notmatch $subnetNameRegex){
+ Write-Error "Invalid subnet name provided for route: $Route[$Key]." -ErrorAction Stop
+ }
+
+ } elseif($Key.ToLower() -eq "nexthopipaddress"){
+ if ($Route[$Key] -notmatch $ipv4Regex){
+ Write-Error "Invalid ipaddress provided for NextHopIPAddress for route: $Route[$Key]." -ErrorAction Stop
+ }
+
+ } else {
+ Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop
+ }
+ }
+ }
+}
+
+function Confirm-Subnets{
+[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.DoNotExportAttribute()]
+param(
+ [Parameter()]
+ [System.Collections.Hashtable[]]
+ $Subnets
+)
+ foreach ($Subnet in $Subnets){
+ foreach ($Key in $Subnet.Keys){
+ if($Key.ToLower() -eq "addressprefix"){
+ if ($Subnet[$Key] -notmatch $cidrRegex){
+ Write-Error "Invalid ipaddress provided for AddressPrefix for subnet : $Subnet[$Key]." -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "ipallocationmethod"){
+ if ($Subnet[$Key] -ne "Dynamic" -and $Subnet[$Key] -ne "Static"){
+ Write-Error "Invalid Ip Allocation method provided: $IpAllocationMethod. Accepted values are 'Dynamic' or 'Static'" -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "ippool"){
+ Confirm-IpPools -IpPools $Subnet[$Key]
+ } elseif ($Key.ToLower() -eq "addressprefixes"){
+ foreach ($addressPrefix in $Subnet[$Key]){
+ if ($addressPrefix -notmatch $cidrRegex){
+ Write-Error "Invalid AddressPrefix: $addressPrefix. Please use valid CIDR format." -ErrorAction Stop
+ }
+ }
+ } elseif ($Key.ToLower() -eq "name"){
+ if ($Subnet[$Key] -notmatch $subnetNameRegex){
+ Write-Error "Invalid SubnetName: $Subnet[$Key]. The name must start with an alphanumeric character, contain all alphanumeric characters or '-' or '_' or '.' and end with an alphanumeric character or '_'. The max length is 80 characters." -ErrorAction Stop
+ }
+ } elseif ($Key.ToLower() -eq "route"){
+ Confirm-Routes -Routes $Subnet[$Key]
+ } elseif ($Key.ToLower() -eq "vlan"){
+ if ($Subnet[$Key] -gt 4094 -or $Subnet[$Key] -lt 1){
+ Write-Error "Invalid value for Vlan : $Subnet[$Key]. Valid range is 1-4094"
+ }
+ } else {
+ Write-Error "Invalid Key specified in Subnet object: $Subnet."
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineDataDisk.md b/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineDataDisk.md
new file mode 100644
index 000000000000..34ef6d5e12fe
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineDataDisk.md
@@ -0,0 +1,198 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/add-azstackhcivmvirtualmachinedatadisk
+schema: 2.0.0
+---
+
+# Add-AzStackHCIVmVirtualMachineDataDisk
+
+## SYNOPSIS
+The operation to add a data disk to a virtual machine.
+
+## SYNTAX
+
+### ByResourceId (Default)
+```
+Add-AzStackHCIVmVirtualMachineDataDisk -ResourceId [-DataDiskId ]
+ [-DataDiskName ] [-DataDiskResourceGroup ] [-Confirm] [-WhatIf] []
+```
+
+### ByName
+```
+Add-AzStackHCIVmVirtualMachineDataDisk -Name -ResourceGroupName [-SubscriptionId ]
+ [-DataDiskId ] [-DataDiskName ] [-DataDiskResourceGroup ] [-Confirm] [-WhatIf]
+ []
+```
+
+## DESCRIPTION
+The operation to add a data disk to a virtual machine.
+
+## EXAMPLES
+
+### Example 1: Add a Data Disk to a Virtual Machine
+```powershell
+ Add-AzStackHCIVmVirtualMachineDataDisk -Name 'testVm' -ResourceGroupName 'test-rg' -DataDiskName 'testVhd'
+
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVm test-rg
+```
+
+This command attaches a data disk to the virtual machine in the specified resource group.
+
+## PARAMETERS
+
+### -DataDiskId
+List of data disks to be attached to the virtual machine passed in Id format
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -DataDiskName
+List of data disks to be attached to the virtual machine passed by Name
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -DataDiskResourceGroup
+Resource Group of the Data Disks
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the virtual machine
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases: VirtualMachineName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM Resource ID of the VM
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineNetworkInterface.md b/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineNetworkInterface.md
new file mode 100644
index 000000000000..7e03806e9abc
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Add-AzStackHCIVmVirtualMachineNetworkInterface.md
@@ -0,0 +1,198 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/add-azstackhcivmvirtualmachinenetworkinterface
+schema: 2.0.0
+---
+
+# Add-AzStackHCIVmVirtualMachineNetworkInterface
+
+## SYNOPSIS
+The operation to add a network interface to a virtual machine.
+
+## SYNTAX
+
+### ByResourceId (Default)
+```
+Add-AzStackHCIVmVirtualMachineNetworkInterface -ResourceId [-NicId ] [-NicName ]
+ [-NicResourceGroup ] [-Confirm] [-WhatIf] []
+```
+
+### ByName
+```
+Add-AzStackHCIVmVirtualMachineNetworkInterface -Name -ResourceGroupName
+ [-SubscriptionId ] [-NicId ] [-NicName ] [-NicResourceGroup ] [-Confirm]
+ [-WhatIf] []
+```
+
+## DESCRIPTION
+The operation to add a network interface to a virtual machine.
+
+## EXAMPLES
+
+### Example 1: Add a Network Interface to a Virtual Machine
+```powershell
+Add-AzStackHCIVmVirtualMachineNetworkInterface -Name 'testVm' -ResourceGroupName 'test-rg' -NicName 'testNic'
+
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVm test-rg
+```
+
+This command attaches a network interface to the virtual machine in the specified resource group.
+
+## PARAMETERS
+
+### -Name
+Name of the virtual machine
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases: VirtualMachineName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NicId
+NetworkInterfaces - list of network interfaces to be attached to the virtual machine in id format
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NicName
+NetworkInterfaces - list of network interfaces to be attached to the virtual machine in name format
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NicResourceGroup
+Resource Group of the Network Interfaces
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM Id of the Virtual Machine
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Az.StackHCIVm.md b/src/StackHCI/StackHCIVm.Autorest/docs/Az.StackHCIVm.md
new file mode 100644
index 000000000000..025d869882d2
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Az.StackHCIVm.md
@@ -0,0 +1,112 @@
+---
+Module Name: Az.StackHCIVm
+Module Guid: 7389f67c-ec9d-4c13-9c9a-308834413af6
+Download Help Link: https://learn.microsoft.com/powershell/module/az.stackhcivm
+Help Version: 1.0.0.0
+Locale: en-US
+---
+
+# Az.StackHCIVm Module
+## Description
+Microsoft Azure PowerShell: StackHciVM cmdlets
+
+## Az.StackHCIVm Cmdlets
+### [Add-AzStackHCIVmVirtualMachineDataDisk](Add-AzStackHCIVmVirtualMachineDataDisk.md)
+The operation to add a data disk to a virtual machine.
+
+### [Add-AzStackHCIVmVirtualMachineNetworkInterface](Add-AzStackHCIVmVirtualMachineNetworkInterface.md)
+The operation to add a network interface to a virtual machine.
+
+### [Get-AzStackHCIVmImage](Get-AzStackHCIVmImage.md)
+Gets a gallery image
+
+### [Get-AzStackHCIVmLogicalNetwork](Get-AzStackHCIVmLogicalNetwork.md)
+Gets a logical network
+
+### [Get-AzStackHCIVmNetworkInterface](Get-AzStackHCIVmNetworkInterface.md)
+Gets a network interface
+
+### [Get-AzStackHCIVmStoragePath](Get-AzStackHCIVmStoragePath.md)
+Gets a storage container
+
+### [Get-AzStackHCIVmVirtualHardDisk](Get-AzStackHCIVmVirtualHardDisk.md)
+Gets a virtual hard disk
+
+### [Get-AzStackHCIVmVirtualMachine](Get-AzStackHCIVmVirtualMachine.md)
+Gets a virtual machine
+
+### [New-AzStackHCIVmImage](New-AzStackHCIVmImage.md)
+The operation to create an image.
+Please note some properties can be set only during image creation.
+
+### [New-AzStackHCIVmLogicalNetwork](New-AzStackHCIVmLogicalNetwork.md)
+The operation to create or update a logical network.
+Please note some properties can be set only during logical network creation.
+
+### [New-AzStackHCIVmNetworkInterface](New-AzStackHCIVmNetworkInterface.md)
+The operation to create or update a network interface.
+Please note some properties can be set only during network interface creation.
+
+### [New-AzStackHCIVmStoragePath](New-AzStackHCIVmStoragePath.md)
+The operation to create or update a storage container.
+Please note some properties can be set only during storage container creation.
+
+### [New-AzStackHCIVmVirtualHardDisk](New-AzStackHCIVmVirtualHardDisk.md)
+The operation to create or update a virtual hard disk.
+Please note some properties can be set only during virtual hard disk creation.
+
+### [New-AzStackHCIVmVirtualMachine](New-AzStackHCIVmVirtualMachine.md)
+The operation to create or update a virtual machine.
+Please note some properties can be set only during virtual machine creation.
+
+### [Remove-AzStackHCIVmImage](Remove-AzStackHCIVmImage.md)
+The operation to delete an image.
+
+### [Remove-AzStackHCIVmLogicalNetwork](Remove-AzStackHCIVmLogicalNetwork.md)
+The operation to delete a logical network.
+
+### [Remove-AzStackHCIVmNetworkInterface](Remove-AzStackHCIVmNetworkInterface.md)
+The operation to delete a network interface.
+
+### [Remove-AzStackHCIVmStoragePath](Remove-AzStackHCIVmStoragePath.md)
+The operation to delete a storage container.
+
+### [Remove-AzStackHCIVmVirtualHardDisk](Remove-AzStackHCIVmVirtualHardDisk.md)
+The operation to delete a virtual hard disk.
+
+### [Remove-AzStackHCIVmVirtualMachine](Remove-AzStackHCIVmVirtualMachine.md)
+The operation to delete a virtual machine.
+
+### [Remove-AzStackHCIVmVirtualMachineDataDisk](Remove-AzStackHCIVmVirtualMachineDataDisk.md)
+The operation to delete a data disk from a virtual machine.
+
+### [Remove-AzStackHCIVmVirtualMachineNetworkInterface](Remove-AzStackHCIVmVirtualMachineNetworkInterface.md)
+The operation to delete a network interface from a virtual machine.
+
+### [Restart-AzStackHCIVmVirtualMachine](Restart-AzStackHCIVmVirtualMachine.md)
+The operation to restart a virtual machine instance.
+
+### [Start-AzStackHCIVmVirtualMachine](Start-AzStackHCIVmVirtualMachine.md)
+The operation to start a virtual machine instance.
+
+### [Stop-AzStackHCIVmVirtualMachine](Stop-AzStackHCIVmVirtualMachine.md)
+The operation to stop a virtual machine instance.
+
+### [Update-AzStackHCIVmImage](Update-AzStackHCIVmImage.md)
+The operation to update an image.
+
+### [Update-AzStackHCIVmLogicalNetwork](Update-AzStackHCIVmLogicalNetwork.md)
+The operation to update a logical network.
+
+### [Update-AzStackHCIVmNetworkInterface](Update-AzStackHCIVmNetworkInterface.md)
+The operation to update a network interface.
+
+### [Update-AzStackHCIVmStoragePath](Update-AzStackHCIVmStoragePath.md)
+The operation to update a storage container.
+
+### [Update-AzStackHCIVmVirtualHardDisk](Update-AzStackHCIVmVirtualHardDisk.md)
+The operation to update a virtual hard disk.
+
+### [Update-AzStackHCIVmVirtualMachine](Update-AzStackHCIVmVirtualMachine.md)
+The operation to update a virtual machine instance.
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmImage.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmImage.md
new file mode 100644
index 000000000000..4bc21fef371c
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmImage.md
@@ -0,0 +1,176 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmimage
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmImage
+
+## SYNOPSIS
+Gets a gallery image
+
+## SYNTAX
+
+### BySubscription (Default)
+```
+Get-AzStackHCIVmImage [-SubscriptionId ] [-DefaultProfile ] [-NoWait] []
+```
+
+### ByName
+```
+Get-AzStackHCIVmImage -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] [-NoWait] []
+```
+
+### ByResourceGroup
+```
+Get-AzStackHCIVmImage -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ]
+ [-NoWait] []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmImage -ResourceId [-SubscriptionId ] [-DefaultProfile ] [-NoWait]
+ []
+```
+
+## DESCRIPTION
+Gets a gallery image
+
+## EXAMPLES
+
+### Example 1: Get an Image
+```powershell
+Get-AzStackHCIVmImage -Name "testimage" -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testImage test-rg
+```
+
+This command gets a specific image in the specified resource group.
+
+### Example 2: List all Images in a Resource Group
+```powershell
+Get-AzStackHCIVmImage -ResourceGroupName 'test-rg'
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testImage test-rg
+```
+
+This command lists all images in the specified resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The credentials, account, tenant, and subscription used for communication with Azure.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the image
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName, ByResourceGroup
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM Resource Id of the Image
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IGalleryImages
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IMarketplaceGalleryImages
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmLogicalNetwork.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmLogicalNetwork.md
new file mode 100644
index 000000000000..9502cb624488
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmLogicalNetwork.md
@@ -0,0 +1,175 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmlogicalnetwork
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmLogicalNetwork
+
+## SYNOPSIS
+Gets a logical network
+
+## SYNTAX
+
+### List1 (Default)
+```
+Get-AzStackHCIVmLogicalNetwork [-SubscriptionId ] [-DefaultProfile ] []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmLogicalNetwork [-ResourceId ] [-DefaultProfile ] [-NoWait]
+ []
+```
+
+### Get
+```
+Get-AzStackHCIVmLogicalNetwork -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+### List
+```
+Get-AzStackHCIVmLogicalNetwork -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+## DESCRIPTION
+Gets a logical network
+
+## EXAMPLES
+
+### Example 1: Get a Logical Network
+```powershell
+Get-AzStackHCIVmLogicalNetwork -Name 'testLnet' -ResourceGroupName 'test-rg'
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testLnet test-rg
+```
+
+This command gets a specific logical network in the specified resource group.
+
+### Example 2: List all Logical Networks in a Resource Group
+```powershell
+Get-AzStackHCIVmLogicalNetwork -ResourceGroupName 'test-rg'
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testLnet test-rg
+```
+
+This command lists all logical networks in the specified resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the logical network
+
+```yaml
+Type: System.String
+Parameter Sets: Get
+Aliases: LogicalNetworkName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: Get, List
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM ID of the logical network.
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String[]
+Parameter Sets: Get, List, List1
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.ILogicalNetworks
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmNetworkInterface.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmNetworkInterface.md
new file mode 100644
index 000000000000..4fa11cb78325
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmNetworkInterface.md
@@ -0,0 +1,176 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmnetworkinterface
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmNetworkInterface
+
+## SYNOPSIS
+Gets a network interface
+
+## SYNTAX
+
+### List1 (Default)
+```
+Get-AzStackHCIVmNetworkInterface [-SubscriptionId ] [-DefaultProfile ]
+ []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmNetworkInterface [-ResourceId ] [-DefaultProfile ] [-NoWait]
+ []
+```
+
+### Get
+```
+Get-AzStackHCIVmNetworkInterface -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+### List
+```
+Get-AzStackHCIVmNetworkInterface -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+## DESCRIPTION
+Gets a network interface
+
+## EXAMPLES
+
+### Example 1: Get a Network Interface
+```powershell
+Get-AzStackHCIVmNetworkInterface -Name 'testNic' -ResourceGroupName 'test-rg'
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testNic test-rg
+```
+
+This command gets a specific network interface in the specified resource group.
+
+### Example 2: List all Logical Networks in a Resource Group
+```powershell
+Get-AzStackHCIVmNetworkInterface -ResourceGroupName 'test-rg'
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testNic test-rg
+```
+
+This command lists all network interfaces in the specified resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the network interface
+
+```yaml
+Type: System.String
+Parameter Sets: Get
+Aliases: NetworkInterfaceName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: Get, List
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM Id of the network interface.
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String[]
+Parameter Sets: Get, List, List1
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.INetworkInterfaces
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmStoragePath.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmStoragePath.md
new file mode 100644
index 000000000000..57cb41eaa88a
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmStoragePath.md
@@ -0,0 +1,174 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmstoragepath
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmStoragePath
+
+## SYNOPSIS
+Gets a storage container
+
+## SYNTAX
+
+### List1 (Default)
+```
+Get-AzStackHCIVmStoragePath [-SubscriptionId ] [-DefaultProfile ] []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmStoragePath [-ResourceId ] [-DefaultProfile ] [-NoWait] []
+```
+
+### Get
+```
+Get-AzStackHCIVmStoragePath -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+### List
+```
+Get-AzStackHCIVmStoragePath -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+## DESCRIPTION
+Gets a storage container
+
+## EXAMPLES
+
+### Example 1: Get a Storage Path
+```powershell
+Get-AzStackHCIVmStoragePath -Name "testStoragePath" -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testStoragePath test-rg
+```
+
+This command gets a specific storage path in the specified resource group.
+
+### Example 2: List all Storage Paths in a Resource Group
+```powershell
+Get-AzStackHCIVmStoragePath -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testStoragePath test-rg
+```
+
+This command lists all storage paths in the specified resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the storage container
+
+```yaml
+Type: System.String
+Parameter Sets: Get
+Aliases: StorageContainerName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: Get, List
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM ID of the storage path.
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String[]
+Parameter Sets: Get, List, List1
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IStorageContainers
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualHardDisk.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualHardDisk.md
new file mode 100644
index 000000000000..b506623e8a78
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualHardDisk.md
@@ -0,0 +1,175 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmvirtualharddisk
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmVirtualHardDisk
+
+## SYNOPSIS
+Gets a virtual hard disk
+
+## SYNTAX
+
+### List1 (Default)
+```
+Get-AzStackHCIVmVirtualHardDisk [-SubscriptionId ] [-DefaultProfile ] []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmVirtualHardDisk [-ResourceId ] [-DefaultProfile ] [-NoWait]
+ []
+```
+
+### Get
+```
+Get-AzStackHCIVmVirtualHardDisk -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+### List
+```
+Get-AzStackHCIVmVirtualHardDisk -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+## DESCRIPTION
+Gets a virtual hard disk
+
+## EXAMPLES
+
+### Example 1: Get a Virtual Hard Disk
+```powershell
+Get-AzStackHCIVmVirtualHardDisk -Name "testVhd" -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVhd test-rg
+```
+
+This command gets a specific virtual hard disk in the specified resource group.
+
+### Example 2: List all Virtual Hard Disks in a Resource Group
+```powershell
+Get-AzStackHCIVmVirtualHardDisk -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVhd test-rg
+```
+
+This command lists all virtual hard disks in the specified resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the virtual hard disk
+
+```yaml
+Type: System.String
+Parameter Sets: Get
+Aliases: VirtualHardDiskName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: Get, List
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM ID of the virtual hard disk.
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String[]
+Parameter Sets: Get, List, List1
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualHardDisks
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualMachine.md b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualMachine.md
new file mode 100644
index 000000000000..40691bf8978e
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/Get-AzStackHCIVmVirtualMachine.md
@@ -0,0 +1,208 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/get-azstackhcivmvirtualmachine
+schema: 2.0.0
+---
+
+# Get-AzStackHCIVmVirtualMachine
+
+## SYNOPSIS
+Gets a virtual machine
+
+## SYNTAX
+
+### BySubscription (Default)
+```
+Get-AzStackHCIVmVirtualMachine [-SubscriptionId ] [-DefaultProfile ] [-NoWait] [-Confirm]
+ [-WhatIf] []
+```
+
+### ByName
+```
+Get-AzStackHCIVmVirtualMachine -Name -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] [-NoWait] [-Confirm] [-WhatIf] []
+```
+
+### ByResourceGroup
+```
+Get-AzStackHCIVmVirtualMachine -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] [-NoWait] [-Confirm] [-WhatIf] []
+```
+
+### ByResourceId
+```
+Get-AzStackHCIVmVirtualMachine -ResourceId [-DefaultProfile ] [-NoWait] [-Confirm]
+ [-WhatIf] []
+```
+
+## DESCRIPTION
+Gets a virtual machine
+
+## EXAMPLES
+
+### Example 2: Get a Virtual Machine.
+```powershell
+Get-AzStackHCIVmVirtualMachine -Name "testVm" -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVm test-rg
+```
+
+This commnad gets a virtual machine in a specified resource group.
+
+### Example 2: List Virtual Machines in a Resource Group
+```powershell
+Get-AzStackHCIVmVirtualMachine -ResourceGroupName "test-rg"
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+testVm test-rg
+```
+
+This command lists all virtual machines in a resource group.
+
+## PARAMETERS
+
+### -DefaultProfile
+The credentials, account, tenant, and subscription used for communication with Azure.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+Name of the virtual machine
+
+```yaml
+Type: System.String
+Parameter Sets: ByName
+Aliases: VirtualMachineName
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -NoWait
+Run the command asynchronously
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+The name of the resource group.
+The name is case insensitive.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName, ByResourceGroup
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceId
+The ARM ID of the virtual machine.
+
+```yaml
+Type: System.String
+Parameter Sets: ByResourceId
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+The ID of the target subscription.
+
+```yaml
+Type: System.String
+Parameter Sets: ByName, ByResourceGroup, BySubscription
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230315Preview.Machine
+
+### Microsoft.Azure.PowerShell.Cmdlets.StackHCIVm.Models.Api20230901Preview.IVirtualMachineInstance
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/StackHCI/StackHCIVm.Autorest/docs/New-AzStackHCIVmImage.md b/src/StackHCI/StackHCIVm.Autorest/docs/New-AzStackHCIVmImage.md
new file mode 100644
index 000000000000..71d74836c56f
--- /dev/null
+++ b/src/StackHCI/StackHCIVm.Autorest/docs/New-AzStackHCIVmImage.md
@@ -0,0 +1,441 @@
+---
+external help file:
+Module Name: Az.StackHCI
+online version: https://learn.microsoft.com/powershell/module/az.stackhci/new-azstackhcivmimage
+schema: 2.0.0
+---
+
+# New-AzStackHCIVmImage
+
+## SYNOPSIS
+The operation to create an image.
+Please note some properties can be set only during image creation.
+
+## SYNTAX
+
+### MarketplaceURN (Default)
+```
+New-AzStackHCIVmImage -Name -ResourceGroupName -CustomLocationId -Location
+ -OSType -URN [-SubscriptionId ]
+ [-CloudInitDataSource ] [-StoragePathId ] [-StoragePathName ]
+ [-StoragePathResourceGroup