diff --git a/src/Sphere/Sphere.Autorest/Az.Sphere.csproj b/src/Sphere/Sphere.Autorest/Az.Sphere.csproj
new file mode 100644
index 000000000000..e5a582601a8c
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/Az.Sphere.csproj
@@ -0,0 +1,10 @@
+
+
+ Sphere
+ Sphere
+ Sphere.Autorest
+
+
+
+
+
diff --git a/src/Sphere/Sphere.Autorest/Az.Sphere.format.ps1xml b/src/Sphere/Sphere.Autorest/Az.Sphere.format.ps1xml
new file mode 100644
index 000000000000..4a87e14a9eb8
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/Az.Sphere.format.ps1xml
@@ -0,0 +1,1803 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Catalog
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Catalog#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Certificate
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Certificate#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateChainResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateChainResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ CertificateChain
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CertificateProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Certificate
+
+
+ ExpiryUtc
+
+
+ NotBeforeUtc
+
+
+ ProvisioningState
+
+
+ Status
+
+
+ Subject
+
+
+ Thumbprint
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountDeviceResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountDeviceResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountDevicesResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountDevicesResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountElementsResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CountElementsResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Deployment
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Deployment#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeploymentListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeploymentListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeploymentProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeploymentProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DeploymentDateUtc
+
+
+ DeploymentId
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Device
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Device#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroup
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroup#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AllowCrashDumpsCollection
+
+
+ Description
+
+
+ HasDeployment
+
+
+ OSFeedType
+
+
+ ProvisioningState
+
+
+ RegionalDataBoundary
+
+
+ UpdatePolicy
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupUpdateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceGroupUpdateProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AllowCrashDumpsCollection
+
+
+ Description
+
+
+ OSFeedType
+
+
+ RegionalDataBoundary
+
+
+ UpdatePolicy
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceInsight
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceInsight#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ DeviceId
+
+
+ EndTimestampUtc
+
+
+ EventCategory
+
+
+ EventClass
+
+
+ EventCount
+
+
+ EventType
+
+
+ StartTimestampUtc
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DevicePatchProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DevicePatchProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ DeviceGroupId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ChipSku
+
+
+ DeviceId
+
+
+ LastAvailableOSVersion
+
+
+ LastInstalledOSVersion
+
+
+ LastOSUpdateUtc
+
+
+ LastUpdateRequestUtc
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceUpdateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.DeviceUpdateProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ DeviceGroupId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetail#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Image
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Image#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ComponentId
+
+
+ Description
+
+
+ Image
+
+
+ ImageId
+
+
+ ImageName
+
+
+ ImageType
+
+
+ ProvisioningState
+
+
+ RegionalDataBoundary
+
+
+ Uri
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ListDeviceGroupsRequest
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ListDeviceGroupsRequest#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ DeviceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Operation
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Operation#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionType
+
+
+ IsDataAction
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.OperationDisplay
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.OperationDisplay#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.OperationListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.OperationListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.PagedDeviceInsight
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.PagedDeviceInsight#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Product
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Product#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductUpdateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProductUpdateProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProofOfPossessionNonceRequest
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProofOfPossessionNonceRequest#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ ProofOfPossessionNonce
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProofOfPossessionNonceResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProofOfPossessionNonceResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Certificate
+
+
+ ExpiryUtc
+
+
+ NotBeforeUtc
+
+
+ ProvisioningState
+
+
+ Status
+
+
+ Subject
+
+
+ Thumbprint
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProxyResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ProxyResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Resource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SignedCapabilityImageResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SignedCapabilityImageResponse#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Image
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SphereIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SphereIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CatalogName
+
+
+ DeploymentName
+
+
+ DeviceGroupName
+
+
+ DeviceName
+
+
+ ImageName
+
+
+ ProductName
+
+
+ ResourceGroupName
+
+
+ SerialNumber
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.SystemData#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Sphere/Sphere.Autorest/Az.Sphere.psd1 b/src/Sphere/Sphere.Autorest/Az.Sphere.psd1
new file mode 100644
index 000000000000..647fdd3c8b59
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/Az.Sphere.psd1
@@ -0,0 +1,23 @@
+@{
+ GUID = '4855dcb5-d1a4-45e3-b4b2-49d37925ed0b'
+ RootModule = './Az.Sphere.psm1'
+ ModuleVersion = '0.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: Sphere cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.Sphere.private.dll'
+ FormatsToProcess = './Az.Sphere.format.ps1xml'
+ FunctionsToExport = 'Get-AzSphereCatalog', 'Get-AzSphereCatalogDevice', 'Get-AzSphereCatalogDeviceGroup', 'Get-AzSphereCatalogDeviceInsight', 'Get-AzSphereCertificate', 'Get-AzSphereCertificateCertChain', 'Get-AzSphereCertificateProof', 'Get-AzSphereDeployment', 'Get-AzSphereDevice', 'Get-AzSphereDeviceGroup', 'Get-AzSphereImage', 'Get-AzSphereProduct', 'Invoke-AzSphereCountCatalogDevice', 'Invoke-AzSphereCountDeviceGroupDevice', 'Invoke-AzSphereCountProductDevice', 'New-AzSphereCatalog', 'New-AzSphereDeployment', 'New-AzSphereDevice', 'New-AzSphereDeviceCapabilityImage', 'New-AzSphereDeviceGroup', 'New-AzSphereImage', 'New-AzSphereProduct', 'New-AzSphereProductDefaultDeviceGroup', 'Remove-AzSphereCatalog', 'Remove-AzSphereDeviceGroup', 'Remove-AzSphereProduct', 'Update-AzSphereCatalog', 'Update-AzSphereDevice', 'Update-AzSphereDeviceGroup', 'Update-AzSphereProduct'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Sphere'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/src/Sphere/Sphere.Autorest/Az.Sphere.psm1 b/src/Sphere/Sphere.Autorest/Az.Sphere.psm1
new file mode 100644
index 000000000000..0b97da3c6b70
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/Az.Sphere.psm1
@@ -0,0 +1,119 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ # 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.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Sphere.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # Following two delegates are added for telemetry
+ $instance.GetTelemetryId = $VTable.GetTelemetryId
+ $instance.Telemetry = $VTable.Telemetry
+
+ # Delegate to sanitize the output object
+ $instance.SanitizeOutput = $VTable.SanitizerHandler
+
+ # Delegate to get the telemetry info
+ $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.Sphere.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/Sphere/Sphere.Autorest/README.md b/src/Sphere/Sphere.Autorest/README.md
new file mode 100644
index 000000000000..e119fa94af07
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/README.md
@@ -0,0 +1,112 @@
+
+# Az.Sphere
+This directory contains the PowerShell module for the Sphere service.
+
+---
+## 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.7.5 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.Sphere`, see [how-to.md](how-to.md).
+
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+```yaml
+# pin the swagger version by using the commit id instead of branch name
+commit: ebce1c690af6060f0e5a72d875edf752d41d5769
+tag: package-2024-04-01
+require:
+# readme.azure.noprofile.md is the common configuration file
+ - $(this-folder)/../../readme.azure.noprofile.md
+ - $(repo)/specification/sphere/resource-manager/readme.md
+# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
+# - (this-folder)/relative-path-to-your-local-readme.md
+
+try-require:
+ - $(repo)/specification/sphere/resource-manager/readme.powershell.md
+
+# For new RP, the version is 0.1.0
+module-version: 0.1.0
+# Normally, title is the service name
+title: Sphere
+subject-prefix: $(service-name)
+
+directive:
+ # Following are common directives which are normally required in all the RPs
+ # 1. Remove the unexpanded parameter set
+ # 2. For New-* cmdlets, ViaIdentity is not required
+ - where:
+ variant: ^(Create|Update)(?!.*?Expanded|ViaJsonString|ViaJsonFilePath)
+ remove: true
+ - where:
+ variant: ^CreateViaIdentity.*$
+ remove: true
+ # Remove unavailable feature
+ - where:
+ verb: Remove
+ subject: ^Device$|Image|Deployment
+ remove: true
+ - where:
+ verb: Update
+ subject: Image|Deployment
+ remove: true
+ - where:
+ verb: Get
+ subject: CatalogDeployment
+ remove: true
+ # error 'The server responded with an unrecognized response', error message missing in default error response for post path
+ - where:
+ verb: Invoke
+ subject: UploadCatalogImage
+ remove: true
+ - where:
+ verb: Invoke
+ subject: ClaimDeviceGroupDevice
+ remove: true
+ - where:
+ verb: Invoke
+ variant: ^Count(.*)
+ set:
+ variant: CountDevice$1
+ # Remove unexpanded include json parameter set
+ - where:
+ variant: ^List(?!.*?Expanded)
+ subject: CatalogDeviceGroup
+ remove: true
+ - where:
+ variant: ^(Retrieve)(?!.*?Expanded)
+ subject: CertificateProof
+ remove: true
+ - where:
+ variant: ^Claim(?!.*?Expanded)
+ subject: ClaimDeviceGroupDevice
+ hide: true
+ # New-AzSphereDeviceCapabilityImage remove unexpanded parameter set
+ - where:
+ variant: ^(Generate)(?!.*?(Expanded|JsonString|JsonFilePath))
+ subject: DeviceCapabilityImage
+ remove: true
+ - where:
+ variant: GenerateViaIdentityExpanded
+ subject: DeviceCapabilityImage
+ remove: true
+ # Remove the set-* cmdlet
+ - where:
+ verb: Set
+ hide: true
+```
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-certificates.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-certificates.json
new file mode 100644
index 000000000000..c008b89007dc
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-certificates.json
@@ -0,0 +1,95 @@
+{
+ "resourceType": "catalogs/certificates",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereCertificateCertChain",
+ "description": "Retrieves cert chain.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificatecertchain"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-ResourceGroupName ",
+ "-SerialNumber ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Retrieves cert chain.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SerialNumber",
+ "value": "[Path.serialNumber]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Get-AzSphereCertificate",
+ "description": "Get a Certificate",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificate"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-ResourceGroupName ",
+ "-SerialNumber ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Certificate",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SerialNumber",
+ "value": "[Path.serialNumber]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-images.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-images.json
new file mode 100644
index 000000000000..540e415f7fdb
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-images.json
@@ -0,0 +1,52 @@
+{
+ "resourceType": "catalogs/images",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereImage",
+ "description": "Get a Image",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azsphereimage"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Image",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.imageName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-deployments.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-deployments.json
new file mode 100644
index 000000000000..ddde4dc77ba1
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-deployments.json
@@ -0,0 +1,62 @@
+{
+ "resourceType": "catalogs/products/deviceGroups/deployments",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereDeployment",
+ "description": "Get a Deployment.\n'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredeployment"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-DeviceGroupName ",
+ "-Name ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-DeviceGroupName",
+ "value": "[Path.deviceGroupName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.deploymentName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-devices.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-devices.json
new file mode 100644
index 000000000000..eb0cd3bd69e9
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups-devices.json
@@ -0,0 +1,62 @@
+{
+ "resourceType": "catalogs/products/deviceGroups/devices",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereDevice",
+ "description": "Get a Device.\nUse '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredevice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-GroupName ",
+ "-Name ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-GroupName",
+ "value": "[Path.deviceGroupName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.deviceName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups.json
new file mode 100644
index 000000000000..0fa0a30eda38
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products-deviceGroups.json
@@ -0,0 +1,153 @@
+{
+ "resourceType": "catalogs/products/deviceGroups",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereDeviceGroup",
+ "description": "Get a DeviceGroup.\n'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredevicegroup"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-Name ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.deviceGroupName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Invoke-AzSphereCountDeviceGroupDevice",
+ "description": "Counts devices in device group.\n'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/invoke-azspherecountdevicegroupdevice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-DeviceGroupName ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-DeviceGroupName",
+ "value": "[Path.deviceGroupName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzSphereDeviceGroup",
+ "description": "Delete a DeviceGroup.\n'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/remove-azspheredevicegroup"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-Name ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.deviceGroupName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products.json
new file mode 100644
index 000000000000..2fa74aae2175
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs-products.json
@@ -0,0 +1,138 @@
+{
+ "resourceType": "catalogs/products",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereProduct",
+ "description": "Get a Product.\n'.default' and '.unassigned' are system defined values and cannot be used for product name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azsphereproduct"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Invoke-AzSphereCountProductDevice",
+ "description": "Counts devices in product.\n'.default' and '.unassigned' are system defined values and cannot be used for product name.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/countDevices",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/invoke-azspherecountproductdevice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-ProductName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ProductName",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzSphereProduct",
+ "description": "Delete a Product.\n'.default' and '.unassigned' are system defined values and cannot be used for product name'",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/remove-azsphereproduct"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.productName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs.json b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs.json
new file mode 100644
index 000000000000..443729cdc672
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/UX/Microsoft.AzureSphere/catalogs.json
@@ -0,0 +1,123 @@
+{
+ "resourceType": "catalogs",
+ "apiVersion": "2024-04-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere"
+ },
+ "commands": [
+ {
+ "name": "Get-AzSphereCatalog",
+ "description": "Get a Catalog",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecatalog"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Catalog",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Invoke-AzSphereCountCatalogDevice",
+ "description": "Counts devices in catalog.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/invoke-azspherecountcatalogdevice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-CatalogName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Counts devices in catalog.",
+ "parameters": [
+ {
+ "name": "-CatalogName",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzSphereCatalog",
+ "description": "Delete a Catalog",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.sphere/remove-azspherecatalog"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a Catalog",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.catalogName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Sphere/Sphere.Autorest/build-module.ps1 b/src/Sphere/Sphere.Autorest/build-module.ps1
new file mode 100644
index 000000000000..c418982e0d08
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/build-module.ps1
@@ -0,0 +1,180 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $NotIsolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($UX) {
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+ if($LastExitCode -ne 0) {
+ # UX generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Sphere.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.Sphere.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.Sphere.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.Sphere'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @()
+$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
+if (Test-Path $modelCmdletFolder) {
+ $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
+}
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: Sphere cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.Sphere.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
+{
+ Write-Host -ForegroundColor Green 'Creating ux metadata...'
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/Sphere/Sphere.Autorest/check-dependencies.ps1 b/src/Sphere/Sphere.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..90ca9867ae40
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/Sphere/Sphere.Autorest/create-model-cmdlets.ps1 b/src/Sphere/Sphere.Autorest/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..c2ff09afdd32
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/create-model-cmdlets.ps1
@@ -0,0 +1,262 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([Hashtable[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+ if (''.length -gt 0) {
+ $ModuleName = ''
+ } else {
+ $ModuleName = 'Az.Sphere'
+ }
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ $classConstantMember = @{}
+ foreach ($Model in $Models)
+ {
+ $ModelName = $Model.modelName
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$ModelName") }
+ $ClassNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'class') -and ($_.Identifier.value -eq "$ModelName") }
+ $classConstantMember = @()
+ foreach ($class in $ClassNode) {
+ foreach ($member in $class.Members) {
+ $isConstant = $false
+ foreach ($attr in $member.AttributeLists) {
+ $memberName = $attr.Attributes.Name.ToString()
+ if ($memberName.EndsWith('.Constant')) {
+ $isConstant = $true
+ break
+ }
+ }
+ if (($member.Modifiers.ToString() -eq 'public') -and $isConstant) {
+ $classConstantMember += $member.Identifier.Value
+ }
+ }
+ }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$ModelName")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $ModelName
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith('Sphere')) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = 'Sphere'
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ if ($classConstantMember.Contains($Member.Identifier.Value)) {
+ # skip constant member
+ continue
+ }
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ $mutability = @{Read = $true; Create = $true; Update = $true}
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Read")
+ {
+ $mutability.Read = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Create")
+ {
+ $mutability.Create = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Update")
+ {
+ $mutability.Update = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ if ($Type.StartsWith("System.Collections.Generic.List"))
+ {
+ # if the type is a list, we need to convert it to array
+ $matched = $Type -match '\<(?.+)\>$'
+ if ($matched)
+ {
+ $Type = $matches.Name + '[]';
+ }
+ }
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required -and $mutability.Create -and $mutability.Update)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if(IsEnumType($Member)){
+ $completer += GetCompleter($Member)
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $cmdletName = "New-Az${ModulePrefix}${ObjectType}Object"
+ if ('' -ne $Model.cmdletName) {
+ $cmdletName = $Model.cmdletName
+ }
+ $OutputPath = Join-Path -ChildPath "${cmdletName}.ps1" -Path $OutputDir
+ $cmdletNameInLowerCase = $cmdletName.ToLower()
+ $Script = "
+# ----------------------------------------------------------------------------------
+# 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
+Create an in-memory object for ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://learn.microsoft.com/powershell/module/${ModuleName}/${cmdletNameInLowerCase}
+#>
+function ${cmdletName} {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
+
+function IsEnumType {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ $isEnum = $false
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $isEnum = $true
+ break
+ }
+ }
+ return $isEnum;
+}
+
+function GetCompleter {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $attributeName = $attributeName.Split("::")[-1]
+ $possibleValues = [System.String]::Join(", ", $attr.Attributes.ArgumentList.Arguments)
+ $completer += "`n [${attributeName}(${possibleValues})]"
+ return $completer
+ }
+ }
+}
diff --git a/src/Sphere/Sphere.Autorest/custom/Az.Sphere.custom.psm1 b/src/Sphere/Sphere.Autorest/custom/Az.Sphere.custom.psm1
new file mode 100644
index 000000000000..e830a7a230b3
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/custom/Az.Sphere.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Sphere.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Sphere.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/Sphere/Sphere.Autorest/custom/README.md b/src/Sphere/Sphere.Autorest/custom/README.md
new file mode 100644
index 000000000000..dbe666a1e2eb
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.Sphere` 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.Sphere.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.Sphere` 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.Sphere.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.Sphere.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental 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.Sphere`. 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.Sphere.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.Sphere.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Sphere`.
+- `Microsoft.Azure.PowerShell.Cmdlets.Sphere.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Sphere`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.Sphere.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/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalog.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalog.md
new file mode 100644
index 000000000000..5dab743c512f
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalog.md
@@ -0,0 +1,70 @@
+### Example 1: List all catalogs for a given resource group
+```powershell
+Get-AzSphereCatalog -ResourceGroupName test-sataneja-10
+```
+
+```output
+Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
+-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- -----------
+global CAT43 9/24/2022 12:54:16 PM example@microsoft.com User 9/24/2022 12:54:16 PM example@microsoft.com User test-satan…
+global CAT007 9/26/2022 8:58:15 PM example@microsoft.com User 9/26/2022 8:58:15 PM example@microsoft.com User test-satan…
+global CAT10 10/10/2022 4:23:53 PM example@microsoft.com User 10/10/2022 4:23:53 PM example@microsoft.com User test-satan…
+global TCAT01 10/14/2022 12:12:22 AM example@microsoft.com User 10/14/2022 12:12:22 AM example@microsoft.com User test-satan…
+global TestCatalog1x3 4/25/2023 10:00:52 PM example@microsoft.com User 4/25/2023 10:00:52 PM example@microsoft.com User test-satan…
+global TestCatalog1x3_Catalog 5/11/2023 6:12:50 PM example@microsoft.com User 5/11/2023 6:12:50 PM example@microsoft.com User test-satan…
+```
+
+This command lists all catalogs for a given resource group.
+
+### Example 2: Get specific catalog with specified resource group
+```powershell
+Get-AzSphereCatalog -Name "testcat" -ResourceGroupName "goyedokun"
+```
+
+```output
+Id : /subscriptions/82f138e0-1c79-4708-bda1-5e224cd688b2/resourceGroups/goyedokun/providers/Microsoft.AzureSphere/catalogs/testcat
+Location : global
+Name : testcat
+ProvisioningState : Succeeded
+ResourceGroupName : goyedokun
+RetryAfter :
+SystemDataCreatedAt : 6/27/2023 6:49:50 PM
+SystemDataCreatedBy : example@microsoft.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 6/27/2023 6:49:50 PM
+SystemDataLastModifiedBy : example@microsoft.com
+SystemDataLastModifiedByType : User
+Tag : {
+ }
+Type : microsoft.azuresphere/catalogs
+```
+
+This command get specific catalog with specified resource group.
+
+### Example 2: List all catalogs for connected subscription
+```powershell
+Get-AzSphereCatalog
+```
+
+```output
+Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemData
+ LastModifi
+ edBy
+-------- ---- ------------------- ------------------- ----------------------- ------------------------ ----------
+global MyCatalog3 4/21/2021 9:32:32 PM example@microsoft.com User 8/10/2023 3:21:08 PM example@m…
+global MyCatalog2 5/20/2021 4:44:38 PM example@microsoft.com User 5/20/2021 4:44:38 PM example@m…
+global MyCatalog1 5/20/2021 4:45:44 PM example@microsoft.com User 5/20/2021 4:45:44 PM example@m…
+global CatalogARMSetup_39f85f04 8/18/2021 8:28:11 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 8/18/2021 8:28:11 PM 5223a8bc-…
+global CatalogARMSetup_3b15f308 9/17/2021 6:41:41 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 9/17/2021 6:41:41 PM 5223a8bc-…
+global mrarmcatalog1 9/21/2021 7:27:16 PM example@microsoft.com User 9/21/2021 7:27:16 PM example@m…
+global CatalogARMSetup_eb5cca0a 9/21/2021 10:06:28 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 9/21/2021 10:06:28 PM 5223a8bc-…
+global CatalogARMSetup_f8c1fea7 9/21/2021 10:06:31 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 9/21/2021 10:06:31 PM 5223a8bc-…
+global CatalogARMSetup_f2d88f81 9/21/2021 10:06:38 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 9/21/2021 10:06:38 PM 5223a8bc-…
+global CatalogARMSetup_1711d4b8 9/21/2021 10:06:42 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 9/21/2021 10:06:42 PM 5223a8bc-…
+global CatalogARMSetup_04744136 10/1/2021 7:14:04 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 10/1/2021 7:14:04 PM 5223a8bc-…
+global CatalogARMSetup_bff4a3fe 10/5/2021 5:14:48 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 10/5/2021 5:14:48 PM 5223a8bc-…
+global CatalogARMSetup_e05ad6ac 10/5/2021 5:15:05 PM 5223a8bc-448a-411c-bcd4-7d41745ed6ba Application 10/5/2021 5:15:05 PM 5223a8bc-…
+global newCatalog 8/15/2023 3:06:31 AM example@microsoft.com User 8/15/2023 3:10:39 AM example@m…
+```
+
+This command lists all catalogs for current subscription.
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDevice.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDevice.md
new file mode 100644
index 000000000000..c62025e48cb9
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDevice.md
@@ -0,0 +1,19 @@
+### Example 1: List for the specified catalog with resource group
+```powershell
+Get-AzSphereCatalogDevice -CatalogName test2024 -ResourceGroupName joyer-test
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy System
+ DataLa
+ stModi
+ fiedBy
+ Type
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ------
+dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+b15332603ba55fb52b00fec8549fdaa46b7fb6ba35694bc8943131ccb4b302846d224580a27880a2996b9fd4f1b2699400b1627059b6a90d67dd29e2984ee147
+5d257fbcf76a5853832122d9b0e2410daa1438e3c1cde005162a837a7535c08973cc819a50cf8eb724ffc88dada06b40bee6010e82a8f84d2fef0fc263061d67
+```
+
+This command gets list of device resources for the specified catalog with resource group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceGroup.md
new file mode 100644
index 000000000000..b926f5ce23c1
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceGroup.md
@@ -0,0 +1,14 @@
+### Example 1: List for the specified catalog with resource group
+```powershell
+Get-AzSphereCatalogDeviceGroup -CatalogName test2024 -ResourceGroupName joyer-test
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- -----------------
+testdevicegroup joyer-test
+testdevicegroup2 joyer-test
+```
+
+This command gets list of device groups for the specified catalog with resource group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceInsight.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceInsight.md
new file mode 100644
index 000000000000..7acd9a38150e
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCatalogDeviceInsight.md
@@ -0,0 +1,7 @@
+### Example 1: List device insight
+```powershell
+Get-AzSphereCatalogDeviceInsight -CatalogName test2024 -ResourceGroupName joyer-test
+```
+
+This command gets a list of device insights for specified catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificate.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificate.md
new file mode 100644
index 000000000000..ed055d7b2883
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificate.md
@@ -0,0 +1,27 @@
+### Example 1: List for the specified catalog with resource group
+```powershell
+Get-AzSphereCertificate -CatalogName test2024 -ResourceGroupName joyer-test
+```
+
+```output
+ExpiryUtc : 4/30/2024 10:51:54 PM
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/certificates/'serial number'
+Name : 'serial number'
+NotBeforeUtc : 1/31/2024 10:51:54 PM
+PropertiesCertificate : 'certificate information'
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+Status : Active
+Subject : CN=Microsoft Azure Sphere INT 7de8a199-bb33-4eda-9600-583103317243, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Thumbprint : 92C60521BB46C72D66FA72CF59EF701D9269A236
+Type : Microsoft.AzureSphere/catalogs/certificates
+```
+
+This command get a list of certificate for the specified catalog with resource group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateCertChain.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateCertChain.md
new file mode 100644
index 000000000000..932ace3d7391
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateCertChain.md
@@ -0,0 +1,13 @@
+### Example 1: Get a certificate cert chain
+```powershell
+Get-AzSphereCertificateCertChain -CatalogName test2024 -ResourceGroupName joyer-test -SerialNumber 'serial number'
+```
+
+```output
+CertificateChain
+----------------
+'information'
+```
+
+This command gets a certificate cert chain.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateProof.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateProof.md
new file mode 100644
index 000000000000..ea170b188b83
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereCertificateProof.md
@@ -0,0 +1,17 @@
+### Example 1: Get a proof Of Possession Nonce
+```powershell
+Get-AzSphereCertificateProof -CatalogName test2024 -ResourceGroupName joyer-test -SerialNumber 'serial number' -ProofOfPossessionNonce proofOfPossessionNonce
+```
+
+```output
+Certificate : 'information'
+ExpiryUtc :
+NotBeforeUtc :
+ProvisioningState :
+Status :
+Subject :
+Thumbprint :
+```
+
+This command gets a proof Of Possession Nonce for specified catalog and serial number.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeployment.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeployment.md
new file mode 100644
index 000000000000..eff7e4e24782
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeployment.md
@@ -0,0 +1,55 @@
+### Example 1: List by resource group
+```powershell
+Get-AzSphereDeployment -ResourceGroupName joyer-test -DeviceGroupName testdevicegroup -ProductName product2024 -CatalogName test2024
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- -----------------
+009ada36-7515-4ff0-a54c-33b75bfae976 2/28/2024 2:36:04 AM 2/28/2024 2:36:04 AM joyer-test
+2e83ddd9-6297-48df-9c2c-2257e6b3cc71 2/28/2024 2:57:56 AM 2/28/2024 2:57:56 AM joyer-test
+```
+
+This command lists all deployments for specified device group.
+
+### Example 2: Get specific deployment for device group
+```powershell
+Get-AzSphereDeployment -ResourceGroupName joyer-test -DeviceGroupName testdevicegroup -ProductName product2024 -CatalogName test2024 -Name 2e83ddd9-6297-48df-9c2c-2257e6b3cc71
+```
+
+```output
+DateUtc : 2/28/2024 2:57:56 AM
+DeployedImage : {{
+ "id": "/subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/images/a04f0a91-b369-4249-a47d-28c118e2cb3b",
+ "name": "a04f0a91-b369-4249-a47d-28c118e2cb3b",
+ "type": "Microsoft.AzureSphere/catalogs/images",
+ "properties": {
+ "image": "GPIO_HighLevelApp",
+ "imageId": "a04f0a91-b369-4249-a47d-28c118e2cb3b",
+ "regionalDataBoundary": "None",
+ "uri": "https://as3imgptint003.blob.core.windows.net/7de8a199-bb33-4eda-9600-583103317243/imagesaks/a04f0a91-b369-4249-a47d-28c118e2cb3b?skoid=cc6e
+ 3fcf-ab4d-4b0d-b3f9-9769604c1e52\u0026sktid=72f988bf-86f1-41af-91ab-2d7cd011db47\u0026skt=2024-02-28T07%3A31%3A00Z\u0026ske=2024-02-28T08%3A36%3A00Z\u0
+ 026sks=b\u0026skv=2021-12-02\u0026sv=2021-12-02\u0026spr=https,http\u0026se=2024-02-28T15%3A36%3A00Z\u0026sr=b\u0026sp=r\u0026sig=MbkzxZH1VQUGft%2BfXbE
+ DhubAVucDykFSEGgvqZVn5yk%3D",
+ "componentId": "dc7f135c-6074-4d49-aa3a-160e4eed884f",
+ "imageType": "Applications",
+ "provisioningState": "Succeeded"
+ }
+ }}
+DeploymentId : 2e83ddd9-6297-48df-9c2c-2257e6b3cc71
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024/de
+ viceGroups/testdevicegroup/deployments/2e83ddd9-6297-48df-9c2c-2257e6b3cc71
+Name : 2e83ddd9-6297-48df-9c2c-2257e6b3cc71
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt : 2/28/2024 2:57:56 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt : 2/28/2024 2:57:56 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups/deployments
+```
+
+This command gets specific deployment in specified device group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDevice.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDevice.md
new file mode 100644
index 000000000000..dea54823e6e3
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDevice.md
@@ -0,0 +1,46 @@
+### Example 1: List by resource group
+```powershell
+Get-AzSphereDevice -CatalogName test2024 -ResourceGroupName "joyer-test" -GroupName testdevicegroup -ProductName product2024
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy System
+ DataLa
+ stModi
+ fiedBy
+ Type
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ------
+dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+b15332603ba55fb52b00fec8549fdaa46b7fb6ba35694bc8943131ccb4b302846d224580a27880a2996b9fd4f1b2699400b1627059b6a90d67dd29e2984ee147
+5d257fbcf76a5853832122d9b0e2410daa1438e3c1cde005162a837a7535c08973cc819a50cf8eb724ffc88dada06b40bee6010e82a8f84d2fef0fc263061d67
+```
+
+This command gets list of device resources by resource group.
+
+### Example 2: Get specific resource with specified resource group
+```powershell
+Get-AzSphereDevice -CatalogName test2024 -ResourceGroupName "joyer-test" -GroupName testdevicegroup -ProductName product2024 -Name dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+```
+
+```output
+ChipSku : MT3620AN
+DeviceId : dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024/deviceGroups/testdevicegroup/devices/dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+LastAvailableOSVersion :
+LastInstalledOSVersion :
+LastOSUpdateUtc :
+LastUpdateRequestUtc :
+Name : dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups/devices
+```
+
+This command gets specific device resource with specified resource group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeviceGroup.md
new file mode 100644
index 000000000000..3452e14c1feb
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereDeviceGroup.md
@@ -0,0 +1,56 @@
+### Example 1: List device group for specific product with specified catalog and resource group
+```powershell
+Get-AzSphereDeviceGroup -CatalogName NewCatalog -ProductName MyProd815 -ResourceGroupName ps1-test
+```
+
+```output
+AllowCrashDumpsCollection : Disabled
+Description : test device group
+HasDeployment : False
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/ps1-test/providers/Microsoft.AzureSphere/catalogs/NewCatalog/products/MyProd815/deviceGroups/Marketing
+Name : Marketing
+OSFeedType : Retail
+ProvisioningState : Succeeded
+RegionalDataBoundary : None
+ResourceGroupName : ps1-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups
+UpdatePolicy : UpdateAll
+```
+
+This command lists device groups.
+
+### Example 2: Get specific device group of specified product with specified catalog and resource group
+```powershell
+Get-AzSphereDeviceGroup -CatalogName NewCatalog -Name Marketing -ProductName MyProd815 -ResourceGroupName ps1-test
+```
+
+```output
+AllowCrashDumpsCollection : Disabled
+Description : test device group
+HasDeployment :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/ps1-test/providers/Microsoft.AzureSphere/catalogs/NewCatalog/products/MyProd815/deviceGroups/Marketing
+Name : Marketing
+OSFeedType : Retail
+ProvisioningState : Succeeded
+RegionalDataBoundary : None
+ResourceGroupName : ps1-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups
+UpdatePolicy : UpdateAll
+```
+
+This command gets specific device group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereImage.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereImage.md
new file mode 100644
index 000000000000..1624fa483fb9
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereImage.md
@@ -0,0 +1,47 @@
+### Example 1: List images for specific catalog with specified resource group
+```powershell
+Get-AzSphereImage -CatalogName MyCatalog1 -ResourceGroupName ResourceGroup1
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDa
+ taLastMo
+ difiedBy
+ Type
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ --------
+fa0bdab1-42bc-4871-84d5-fa05c8c0c895
+5f05300e-b0e0-47d5-8255-e4bddb2ddd81
+```
+
+This command lists images.
+
+### Example 2: Get specific image with specified catalog and resource group
+```powershell
+Get-AzSphereImage -CatalogName anotherCatalog -Name 14a6729e-5819-4737-8713-37b4798533f8 -ResourceGroupName Sphere-test
+```
+
+```output
+ComponentId : 42257ad6-382d-405f-b7cc-e110fbda2d0b
+Description :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/Sphere-test/providers/Microsoft.AzureSphere/catalogs/anotherCatalog/images/14a6729e-5819-4737-8713-37b4798533f8
+ImageId : 14a6729e-5819-4737-8713-37b4798533f8
+ImageName :
+ImageType : Applications
+Name : 14a6729e-5819-4737-8713-37b4798533f8
+PropertiesImage : AzureSphereBlink1
+ProvisioningState : Succeeded
+RegionalDataBoundary : None
+ResourceGroupName : Sphere-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/images
+Uri : https://as3imgptint003.blob.core.windows.net/9e508310-247c-4bba-add7-39169e9b7482/imagesaks/14a6729e-5819-4737-8713-37b4798533f8?skoid=41781aa8-e455-49b8-8db3-eb9232b581c2&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2024-01-30T08%3A27%3A57Z&ske=2024-01-30T09%3A32%3A57Z&sks=b&skv=2021-12-02&sv=2021-12-02&spr=https,http&se=2024-01-30T16%3A32%3A57Z&sr=b&sp=r&sig=EiMxkiDu6yHzV%2BB2LSqMp27AnJc3lKice%2Fm2AJ63r%2Bg%3D
+```
+
+This command get specific image.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Get-AzSphereProduct.md b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereProduct.md
new file mode 100644
index 000000000000..3a88b982d9bf
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Get-AzSphereProduct.md
@@ -0,0 +1,36 @@
+### Example 1: List with specified catalog by resource group
+```powershell
+Get-AzSphereProduct -ResourceGroupName joyer-test -CatalogName test2024
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- -----------------
+product2024 joyer-test
+product0207 joyer-test
+```
+
+This command gets list of product with specified catalog by resource group.
+
+### Example 2: Get product with specified catalog and resource group
+```powershell
+Get-AzSphereProduct -ResourceGroupName joyer-test -CatalogName test2024 -Name product2024
+```
+
+```output
+Description : 222
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024
+Name : product2024
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products
+```
+
+This command gets specific product with specified catalog and resource group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountCatalogDevice.md b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountCatalogDevice.md
new file mode 100644
index 000000000000..78687d1bd291
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountCatalogDevice.md
@@ -0,0 +1,13 @@
+### Example 1: Get device number
+```powershell
+Invoke-AzSphereCountCatalogDevice -CatalogName test2024 -ResourceGroupName joyer-test
+```
+
+```output
+Value
+-----
+ 3
+```
+
+This command returns a number of device in the catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountDeviceGroupDevice.md b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountDeviceGroupDevice.md
new file mode 100644
index 000000000000..fc67eae55b39
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountDeviceGroupDevice.md
@@ -0,0 +1,13 @@
+### Example 1: Get device number
+```powershell
+Invoke-AzSphereCountDeviceGroupDevice -CatalogName test2024 -ResourceGroupName joyer-test -DeviceGroupName testdevicegroup -ProductName product2024
+```
+
+```output
+Value
+-----
+ 3
+```
+
+This command returns device number for the device group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountProductDevice.md b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountProductDevice.md
new file mode 100644
index 000000000000..df76d405ca3a
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Invoke-AzSphereCountProductDevice.md
@@ -0,0 +1,13 @@
+### Example 1: Get device number
+```powershell
+Invoke-AzSphereCountProductDevice -CatalogName test2024 -ResourceGroupName joyer-test -ProductName product2024
+```
+
+```output
+Value
+-----
+ 3
+```
+
+This command returns device number for the product.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereCatalog.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereCatalog.md
new file mode 100644
index 000000000000..078f9642aa74
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereCatalog.md
@@ -0,0 +1,26 @@
+### Example 1: ### Example 1: Create a catalog
+```powershell
+New-AzSphereCatalog -name test2024 -ResourceGroupName joyer-test -Location global
+```
+
+```output
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024
+Location : global
+Name : test2024
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+TenantId : 7de8a199-bb33-4eda-9600-583103317243
+Type : microsoft.azuresphere/catalogs
+```
+
+This command creates a catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeployment.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeployment.md
new file mode 100644
index 000000000000..a8d085b148fd
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeployment.md
@@ -0,0 +1,42 @@
+### Example 1: Create a deployment with deployed image
+```powershell
+$image1 = Get-AzSphereImage -Name '14a6729e-5819-4737-8713-37b4798533f8' -CatalogName test2024 -ResourceGroupName joyer-test
+New-AzSphereDeployment -Name .default -CatalogName test2024 -DeviceGroupName testdevicegroup -ProductName product2024 -ResourceGroupName joyer-test -DeployedImage $image1
+```
+
+```output
+DateUtc : 3/1/2024 8:08:11 AM
+DeployedImage : {{
+ "id": "/subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/images/14a6729e-5819-4737
+ -8713-37b4798533f8",
+ "name": "14a6729e-5819-4737-8713-37b4798533f8",
+ "type": "Microsoft.AzureSphere/catalogs/images",
+ "properties": {
+ "image": "AzureSphereBlink1",
+ "imageId": "14a6729e-5819-4737-8713-37b4798533f8",
+ "regionalDataBoundary": "None",
+ "uri": "https://as3imgptint003.blob.core.windows.net/7de8a199-bb33-4eda-9600-583103317243/imagesaks/14a6729e-5819-4737-8713-37b4798533f8?skoid=cc6e3fcf-ab4d-4
+ b0d-b3f9-9769604c1e52\u0026sktid=72f988bf-86f1-41af-91ab-2d7cd011db47\u0026skt=2024-03-01T08%3A03%3A45Z\u0026ske=2024-03-01T09%3A08%3A45Z\u0026sks=b\u0026skv=2021
+ -12-02\u0026sv=2021-12-02\u0026spr=https,http\u0026se=2024-03-01T16%3A08%3A45Z\u0026sr=b\u0026sp=r\u0026sig=UviBTlciImOjqw968crarXzXyQ29UMEi4js56AEOPgU%3D",
+ "componentId": "42257ad6-382d-405f-b7cc-e110fbda2d0b",
+ "imageType": "Applications",
+ "provisioningState": "Succeeded"
+ }
+ }}
+DeploymentId : e1e61a75-0629-491c-8f4f-0c054116d71c
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024/deviceGroups/
+ testdevicegroup/deployments/e1e61a75-0629-491c-8f4f-0c054116d71c
+Name : e1e61a75-0629-491c-8f4f-0c054116d71c
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt : 3/1/2024 8:08:11 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt : 3/1/2024 8:08:11 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups/deployments
+```
+
+This command create a deployment with deployed images.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereDevice.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDevice.md
new file mode 100644
index 000000000000..6540634e04f8
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDevice.md
@@ -0,0 +1,29 @@
+### Example 1: Create a device
+```powershell
+New-AzSphereDevice -CatalogName "anotherNewOne" -GroupName ".default" -Name "45ffd2afe82d77b2b70f1daed2054abc64853a27395c6112d9adaf01047bae5a0caa72219f93db02e1a93f2c159ba2090a783077138e7fa542459621e6091e4c" -ProductName ".default" -ResourceGroupName "goyedokun"
+```
+
+```output
+ChipSku : MT3620AN
+DeviceId : fc9085337153e47eca0d42dcae83819f18ae90d916ae3b87d0206fef6acb9ca44f9e21b93c01311e83168393d112841decc5ef6d48c3d1d07be6b0bf8fec6e2b
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/goyedokun/providers/Microsoft.AzureSphere/catalogs/anotherNewOne/products/.default/deviceGroups/.default/devices/FC9085337153E47ECA0D42DCAE83819F18AE90D916AE3B87D0206FEF6ACB9CA44F9E21B93C01311E83168393D112841DECC5EF6D48C3D1D07BE6B0BF8FEC6E2B
+LastAvailableOSVersion :
+LastInstalledOSVersion :
+LastOSUpdateUtc :
+LastUpdateRequestUtc :
+Name : fc9085337153e47eca0d42dcae83819f18ae90d916ae3b87d0206fef6acb9ca44f9e21b93c01311e83168393d112841decc5ef6d48c3d1d07be6b0bf8fec6e2b
+ProvisioningState : Succeeded
+ResourceGroupName : goyedokun
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups/devices
+
+```
+
+This command creates a device.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceCapabilityImage.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceCapabilityImage.md
new file mode 100644
index 000000000000..98e864c5ba5e
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceCapabilityImage.md
@@ -0,0 +1,13 @@
+### Example 1: Generates the capability image for the device.
+```powershell
+New-AzSphereDeviceCapabilityImage -ResourceGroupName joyer-test -CatalogName test2024 -DeviceGroupName testdevicegroup2 -ProductName product2024 -DeviceName DBB0E0CB8BD961A6129096E1E8A1375AC1FA274F030C08161B37AE3BC5A94F443BDB628CF257BC5BC810D8768C03B6F5CA301A35CD0169F56A49624255964560 -Capability 'ApplicationDevelopment' | Format-List
+```
+
+```output
+Image : /Vz9XAEAAADMAAAA27Dgy4vZYaYSkJbh6KE3WsH6J08DDAgWGzeuO8WpT0Q722KM8le8W8gQ2HaMA7b1yjAaNc0BafVqSWJCVZZFYAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANFg0TQMAAABJRCQADQAAANi1KEHCq1VBmjOKHzHtZ+yYQTwYazyNRbRvoHzwyZefU0cYAJZKiVhXTEtr0FMmMLhe+JiQpbh/AQAA
+ AERCKAAAAAAAAAAAAGZ3X2NvbmZpZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAMyzku8X6GdcOC1Sd9Cfozpmsiny2TzmjyXK7IvOhfA1B8nwdf1GoPa6PPVNMnn15TPIFK/P5/S2TD/mQrNh0Nk=
+```
+
+This command generates the capability image for specified device.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceGroup.md
new file mode 100644
index 000000000000..aab2316f0121
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereDeviceGroup.md
@@ -0,0 +1,27 @@
+### Example 1: Create a device group into specified catalog and product
+```powershell
+New-AzSphereDeviceGroup -CatalogName anotherCatalog -Name testgroup -ProductName test -ResourceGroupName Sphere-test
+```
+
+```output
+AllowCrashDumpsCollection : Disabled
+Description :
+HasDeployment :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/Sphere-test/providers/Microsoft.AzureSphere/catalogs/anotherCatalog/products/test/deviceGroups/testgroup
+Name : testgroup
+OSFeedType : Retail
+ProvisioningState : Succeeded
+RegionalDataBoundary : None
+ResourceGroupName : Sphere-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups
+UpdatePolicy : UpdateAll
+```
+
+This command creates a device group into specified catalog and product.
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereImage.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereImage.md
new file mode 100644
index 000000000000..204e3ee851e5
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereImage.md
@@ -0,0 +1,34 @@
+### Example 1: Create a image for device group
+```powershell
+$imagefile1 = 'D:\GitHub\azure-powershell\src\Sphere\Sphere.Autorest\test\imagefile\AzureSphereBlink1.imagepackage'
+$encf1 = [system.io.file]::ReadAllBytes($imagefile1)
+$base64str = [system.convert]::ToBase64String($encf1)
+New-AzSphereImage -CatalogName test2024 -ResourceGroupName joyer-test -Name 14a6729e-5819-4737-8713-37b4798533f8 -Image $base64str
+```
+
+```output
+ComponentId : 42257ad6-382d-405f-b7cc-e110fbda2d0b
+Description :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/images/14a6729e-5819-4737-8713-37b4798533f8
+ImageId : 14a6729e-5819-4737-8713-37b4798533f8
+ImageName :
+ImageType : Applications
+Name : 14a6729e-5819-4737-8713-37b4798533f8
+PropertiesImage : AzureSphereBlink1
+ProvisioningState : Succeeded
+RegionalDataBoundary : None
+ResourceGroupName : joyer-test
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/images
+Uri : https://as3imgptint003.blob.core.windows.net/7de8a199-bb33-4eda-9600-583103317243/imagesaks/14a6729e-5819-4737-8713-37b4798533f8?skoid=cc6e3fcf-ab4d-4b0d-b3f9-9769
+ 604c1e52&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2024-02-23T02%3A31%3A35Z&ske=2024-02-23T03%3A36%3A35Z&sks=b&skv=2021-12-02&sv=2021-12-02&spr=https,http&se=
+ 2024-02-23T10%3A36%3A35Z&sr=b&sp=r&sig=7ZNckgqdazn9Af8fHUfsEEA2JrZO0SjDZpUgbh0jEZI%3D
+```
+
+This command creates a image for the device group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereProduct.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereProduct.md
new file mode 100644
index 000000000000..c30a27f434de
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereProduct.md
@@ -0,0 +1,22 @@
+### Example 1: Create a product into specified catalog
+```powershell
+New-AzSphereProduct -CatalogName test2024 -ResourceGroupName joyer-test -Name product2024
+```
+
+```output
+Description :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024
+Name : product2024
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+RetryAfter :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products
+```
+
+This command create a product into specified catalog.
diff --git a/src/Sphere/Sphere.Autorest/examples/New-AzSphereProductDefaultDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/New-AzSphereProductDefaultDeviceGroup.md
new file mode 100644
index 000000000000..8485fa8b4252
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/New-AzSphereProductDefaultDeviceGroup.md
@@ -0,0 +1,17 @@
+### Example 1: Generate default device groups for the product
+```powershell
+New-AzSphereProductDefaultDeviceGroup -CatalogName test2024 -ProductName product0207 -ResourceGroupName joyer-test
+```
+
+```output
+Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
+---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- -----------------
+Development joyer-test
+Field Test joyer-test
+Production joyer-test
+Production OS Evaluation joyer-test
+Field Test OS Evaluation joyer-test
+```
+
+This command generates default device groups for the product.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereCatalog.md b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereCatalog.md
new file mode 100644
index 000000000000..b8ea82261ed3
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereCatalog.md
@@ -0,0 +1,8 @@
+### Example 1: Delete a catalog
+
+```powershell
+Remove-AzSphereCatalog -Name test2024 -ResourceGroupName joyer-test
+```
+
+This command deletes specified catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereDeviceGroup.md
new file mode 100644
index 000000000000..a4634c940adf
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereDeviceGroup.md
@@ -0,0 +1,6 @@
+### Example 1: Delete specified device group
+```powershell
+Remove-AzSphereDeviceGroup -CatalogName NewCatalog -Name Marketing -ProductName MyProd129 -ResourceGroupName Sphere-test
+```
+
+This command deletes specified device group.
\ No newline at end of file
diff --git a/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereProduct.md b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereProduct.md
new file mode 100644
index 000000000000..d6b852855cd2
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Remove-AzSphereProduct.md
@@ -0,0 +1,7 @@
+### Example 1: Delete a product
+```powershell
+Remove-AzSphereProduct -CatalogName test2024 -ResourceGroupName joyer-test -Name product2024
+```
+
+This command deletes specified product.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Update-AzSphereCatalog.md b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereCatalog.md
new file mode 100644
index 000000000000..93d283222834
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereCatalog.md
@@ -0,0 +1,26 @@
+### Example 1: Update tag
+```powershell
+Update-AzSphereCatalog -Name test2024 -ResourceGroupName joyer-test -Tag @{"123"="abc"}
+```
+
+```output
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024
+Location : global
+Name : test2024
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt : 2/1/2024 1:51:44 AM
+SystemDataCreatedBy : example@microsoft.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2/8/2024 1:54:33 AM
+SystemDataLastModifiedBy : example@microsoft.com
+SystemDataLastModifiedByType : User
+Tag : {
+ "123": "abc"
+ }
+TenantId :
+Type : microsoft.azuresphere/catalogs
+```
+
+This command updates tag for specified catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDevice.md b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDevice.md
new file mode 100644
index 000000000000..79dfd9ceb30f
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDevice.md
@@ -0,0 +1,56 @@
+### Example 1: Assign a device to another device group
+```powershell
+Update-AzSphereDevice -ResourceGroupName joyer-test -CatalogName test2024 -GroupName testdevicegroup -ProductName product2024 -Name DBB0E0CB8BD961A6129096E1E8A1375AC1FA274F030C08161B37AE3BC5A94F443BDB628CF257BC5BC810D8768C03B6F5CA301A35CD0169F56A49624255964560 -DeviceGroupId /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024/deviceGroups/testdevicegroup2
+```
+
+```output
+ChipSku :
+DeviceId :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/providers/Microsoft.AzureSphere/locations/WESTCENTRALUS/operationStatuses/dc3e0b1a-59ae-4b00-bb84-9
+ a7ea253f4e8*648856149066E98CE43CF51B8F3FC827768BFF5C8740097AD36EDFC456E7B110
+LastAvailableOSVersion :
+LastInstalledOSVersion :
+LastOSUpdateUtc :
+LastUpdateRequestUtc :
+Name : dc3e0b1a-59ae-4b00-bb84-9a7ea253f4e8*648856149066E98CE43CF51B8F3FC827768BFF5C8740097AD36EDFC456E7B110
+ProvisioningState :
+ResourceGroupName :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type :
+```
+
+This command assign a device to another device group.
+
+### Example 2: unassign a device
+```powershell
+Update-AzSphereDevice -ResourceGroupName joyer-test -CatalogName test2024 -GroupName testdevicegroup -ProductName product2024 -Name DBB0E0CB8BD961A6129096E1E8A1375AC1FA274F030C08161B37AE3BC5A94F443BDB628CF257BC5BC810D8768C03B6F5CA301A35CD0169F56A49624255964560 -DeviceGroupId /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/.default/deviceGroups/.default
+```
+
+```output
+ChipSku :
+DeviceId :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/providers/Microsoft.AzureSphere/locations/WESTCENTRALUS/operationStatuses/89c583a1-2a79-4f5f-ab4b-7e1cc7fb52e7*
+ 648856149066E98CE43CF51B8F3FC827768BFF5C8740097AD36EDFC456E7B110
+LastAvailableOSVersion :
+LastInstalledOSVersion :
+LastOSUpdateUtc :
+LastUpdateRequestUtc :
+Name : 89c583a1-2a79-4f5f-ab4b-7e1cc7fb52e7*648856149066E98CE43CF51B8F3FC827768BFF5C8740097AD36EDFC456E7B110
+ProvisioningState :
+ResourceGroupName :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type :
+```
+
+This command unassign a device to catalog.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDeviceGroup.md b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDeviceGroup.md
new file mode 100644
index 000000000000..debef0612f3f
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereDeviceGroup.md
@@ -0,0 +1,27 @@
+### Example 1: Update device group
+```powershell
+Update-AzSphereDeviceGroup -ResourceGroupName joyer-test -CatalogName test2024 -ProductName product2024 -Name testdevicegroup -Description test
+```
+
+```output
+AllowCrashDumpsCollection :
+Description : test
+HasDeployment :
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024/deviceGroups/testdevicegroup
+Name : testdevicegroup
+OSFeedType :
+ProvisioningState : Succeeded
+RegionalDataBoundary :
+ResourceGroupName : joyer-test
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products/deviceGroups
+UpdatePolicy :
+```
+
+This command updates device group.
+
diff --git a/src/Sphere/Sphere.Autorest/examples/Update-AzSphereProduct.md b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereProduct.md
new file mode 100644
index 000000000000..6e2969b53807
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/examples/Update-AzSphereProduct.md
@@ -0,0 +1,22 @@
+### Example 1: Update description
+```powershell
+Update-AzSphereProduct -ResourceGroupName joyer-test -CatalogName test2024 -Name product2024 -Description 2222
+```
+
+```output
+Description : 2222
+Id : /subscriptions/d1cd48f9-b94b-4645-9632-634b440db393/resourceGroups/joyer-test/providers/Microsoft.AzureSphere/catalogs/test2024/products/product2024
+Name : product2024
+ProvisioningState : Succeeded
+ResourceGroupName : joyer-test
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.AzureSphere/catalogs/products
+```
+
+This command updates product description.
+
diff --git a/src/Sphere/Sphere.Autorest/export-surface.ps1 b/src/Sphere/Sphere.Autorest/export-surface.ps1
new file mode 100644
index 000000000000..f112dee13630
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Sphere.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.Sphere'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalog.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalog.ps1
new file mode 100644
index 000000000000..b1c4a6e38e6d
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalog.ps1
@@ -0,0 +1,223 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get a Catalog
+.Description
+Get a Catalog
+.Example
+Get-AzSphereCatalog -ResourceGroupName test-sataneja-10
+.Example
+Get-AzSphereCatalog -Name "testcat" -ResourceGroupName "goyedokun"
+.Example
+Get-AzSphereCatalog
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalog
+.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
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecatalog
+#>
+function Get-AzSphereCatalog {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalog])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('CatalogName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Sphere.private\Get-AzSphereCatalog_Get';
+ GetViaIdentity = 'Az.Sphere.private\Get-AzSphereCatalog_GetViaIdentity';
+ List = 'Az.Sphere.private\Get-AzSphereCatalog_List';
+ List1 = 'Az.Sphere.private\Get-AzSphereCatalog_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDevice.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDevice.ps1
new file mode 100644
index 000000000000..8783c82ed5cc
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDevice.ps1
@@ -0,0 +1,212 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Lists devices for catalog.
+.Description
+Lists devices for catalog.
+.Example
+Get-AzSphereCatalogDevice -CatalogName test2024 -ResourceGroupName joyer-test
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDevice
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecatalogdevice
+#>
+function Get-AzSphereCatalogDevice {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDevice])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.String]
+ # Filter the result list using the given expression
+ ${Filter},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The maximum number of result items per page.
+ ${Maxpagesize},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to skip.
+ ${Skip},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to return.
+ ${Top},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ List = 'Az.Sphere.private\Get-AzSphereCatalogDevice_List';
+ }
+ if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceGroup.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceGroup.ps1
new file mode 100644
index 000000000000..7e6b6a22fa6b
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceGroup.ps1
@@ -0,0 +1,218 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+List the device groups for the catalog.
+.Description
+List the device groups for the catalog.
+.Example
+Get-AzSphereCatalogDeviceGroup -CatalogName test2024 -ResourceGroupName joyer-test
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeviceGroup
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecatalogdevicegroup
+#>
+function Get-AzSphereCatalogDeviceGroup {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeviceGroup])]
+[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.String]
+ # Filter the result list using the given expression
+ ${Filter},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The maximum number of result items per page.
+ ${Maxpagesize},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to skip.
+ ${Skip},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to return.
+ ${Top},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Body')]
+ [System.String]
+ # Device Group name.
+ ${DeviceGroupName},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ ListExpanded = 'Az.Sphere.private\Get-AzSphereCatalogDeviceGroup_ListExpanded';
+ }
+ if (('ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceInsight.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceInsight.ps1
new file mode 100644
index 000000000000..f2537c3acfaf
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCatalogDeviceInsight.ps1
@@ -0,0 +1,212 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Lists device insights for catalog.
+.Description
+Lists device insights for catalog.
+.Example
+Get-AzSphereCatalogDeviceInsight -CatalogName test2024 -ResourceGroupName joyer-test
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeviceInsight
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecatalogdeviceinsight
+#>
+function Get-AzSphereCatalogDeviceInsight {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeviceInsight])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.String]
+ # Filter the result list using the given expression
+ ${Filter},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The maximum number of result items per page.
+ ${Maxpagesize},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to skip.
+ ${Skip},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to return.
+ ${Top},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ List = 'Az.Sphere.private\Get-AzSphereCatalogDeviceInsight_List';
+ }
+ if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificate.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificate.ps1
new file mode 100644
index 000000000000..6b4311e430a6
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificate.ps1
@@ -0,0 +1,268 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get a Certificate
+.Description
+Get a Certificate
+.Example
+Get-AzSphereCertificate -CatalogName test2024 -ResourceGroupName joyer-test
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICertificate
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificate
+#>
+function Get-AzSphereCertificate {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICertificate])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Serial number of the certificate.
+ # Use '.default' to get current active certificate.
+ ${SerialNumber},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${CatalogInputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.String]
+ # Filter the result list using the given expression
+ ${Filter},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The maximum number of result items per page.
+ ${Maxpagesize},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to skip.
+ ${Skip},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to return.
+ ${Top},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Sphere.private\Get-AzSphereCertificate_Get';
+ GetViaIdentity = 'Az.Sphere.private\Get-AzSphereCertificate_GetViaIdentity';
+ GetViaIdentityCatalog = 'Az.Sphere.private\Get-AzSphereCertificate_GetViaIdentityCatalog';
+ List = 'Az.Sphere.private\Get-AzSphereCertificate_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateCertChain.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateCertChain.ps1
new file mode 100644
index 000000000000..a875b2d67ae3
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateCertChain.ps1
@@ -0,0 +1,240 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Retrieves cert chain.
+.Description
+Retrieves cert chain.
+.Example
+Get-AzSphereCertificateCertChain -CatalogName test2024 -ResourceGroupName joyer-test -SerialNumber 'serial number'
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICertificateChainResponse
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificatecertchain
+#>
+function Get-AzSphereCertificateCertChain {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICertificateChainResponse])]
+[CmdletBinding(DefaultParameterSetName='Retrieve', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Retrieve', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(ParameterSetName='Retrieve', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Retrieve', Mandatory)]
+ [Parameter(ParameterSetName='RetrieveViaIdentityCatalog', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Serial number of the certificate.
+ # Use '.default' to get current active certificate.
+ ${SerialNumber},
+
+ [Parameter(ParameterSetName='Retrieve')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='RetrieveViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='RetrieveViaIdentityCatalog', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${CatalogInputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Retrieve = 'Az.Sphere.private\Get-AzSphereCertificateCertChain_Retrieve';
+ RetrieveViaIdentity = 'Az.Sphere.private\Get-AzSphereCertificateCertChain_RetrieveViaIdentity';
+ RetrieveViaIdentityCatalog = 'Az.Sphere.private\Get-AzSphereCertificateCertChain_RetrieveViaIdentityCatalog';
+ }
+ if (('Retrieve') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateProof.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateProof.ps1
new file mode 100644
index 000000000000..67094f0ea3cf
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereCertificateProof.ps1
@@ -0,0 +1,246 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Gets the proof of possession nonce.
+.Description
+Gets the proof of possession nonce.
+.Example
+Get-AzSphereCertificateProof -CatalogName test2024 -ResourceGroupName joyer-test -SerialNumber 'serial number' -ProofOfPossessionNonce proofOfPossessionNonce
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IProofOfPossessionNonceResponse
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificateproof
+#>
+function Get-AzSphereCertificateProof {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IProofOfPossessionNonceResponse])]
+[CmdletBinding(DefaultParameterSetName='RetrieveExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='RetrieveExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(ParameterSetName='RetrieveExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='RetrieveExpanded', Mandatory)]
+ [Parameter(ParameterSetName='RetrieveViaIdentityCatalogExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Serial number of the certificate.
+ # Use '.default' to get current active certificate.
+ ${SerialNumber},
+
+ [Parameter(ParameterSetName='RetrieveExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='RetrieveViaIdentityCatalogExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${CatalogInputObject},
+
+ [Parameter(ParameterSetName='RetrieveViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Body')]
+ [System.String]
+ # The proof of possession nonce
+ ${ProofOfPossessionNonce},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ RetrieveExpanded = 'Az.Sphere.private\Get-AzSphereCertificateProof_RetrieveExpanded';
+ RetrieveViaIdentityCatalogExpanded = 'Az.Sphere.private\Get-AzSphereCertificateProof_RetrieveViaIdentityCatalogExpanded';
+ RetrieveViaIdentityExpanded = 'Az.Sphere.private\Get-AzSphereCertificateProof_RetrieveViaIdentityExpanded';
+ }
+ if (('RetrieveExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeployment.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeployment.ps1
new file mode 100644
index 000000000000..f0db6d4a0404
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeployment.ps1
@@ -0,0 +1,330 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get a Deployment.
+'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+.Description
+Get a Deployment.
+'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+.Example
+Get-AzSphereDeployment -ResourceGroupName joyer-test -DeviceGroupName testdevicegroup -ProductName product2024 -CatalogName test2024
+.Example
+Get-AzSphereDeployment -ResourceGroupName joyer-test -DeviceGroupName testdevicegroup -ProductName product2024 -CatalogName test2024 -Name 2e83ddd9-6297-48df-9c2c-2257e6b3cc71
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeployment
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+DEVICEGROUPINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+PRODUCTINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredeployment
+#>
+function Get-AzSphereDeployment {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeployment])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of device group.
+ ${DeviceGroupName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityDeviceGroup', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory)]
+ [Alias('DeploymentName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Deployment name.
+ # Use .default for deployment creation and to get the current deployment for the associated device group.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of product.
+ ${ProductName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${CatalogInputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityDeviceGroup', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${DeviceGroupInputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${ProductInputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.String]
+ # Filter the result list using the given expression
+ ${Filter},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The maximum number of result items per page.
+ ${Maxpagesize},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to skip.
+ ${Skip},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Query')]
+ [System.Int32]
+ # The number of result items to return.
+ ${Top},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Sphere.private\Get-AzSphereDeployment_Get';
+ GetViaIdentity = 'Az.Sphere.private\Get-AzSphereDeployment_GetViaIdentity';
+ GetViaIdentityCatalog = 'Az.Sphere.private\Get-AzSphereDeployment_GetViaIdentityCatalog';
+ GetViaIdentityDeviceGroup = 'Az.Sphere.private\Get-AzSphereDeployment_GetViaIdentityDeviceGroup';
+ GetViaIdentityProduct = 'Az.Sphere.private\Get-AzSphereDeployment_GetViaIdentityProduct';
+ List = 'Az.Sphere.private\Get-AzSphereDeployment_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDevice.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDevice.ps1
new file mode 100644
index 000000000000..e47cf13e7c5c
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDevice.ps1
@@ -0,0 +1,306 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get a Device.
+Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+.Description
+Get a Device.
+Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+.Example
+Get-AzSphereDevice -CatalogName test2024 -ResourceGroupName "joyer-test" -GroupName testdevicegroup -ProductName product2024
+.Example
+Get-AzSphereDevice -CatalogName test2024 -ResourceGroupName "joyer-test" -GroupName testdevicegroup -ProductName product2024 -Name dbb0e0cb8bd961a6129096e1e8a1375ac1fa274f030c08161b37ae3bc5a94f443bdb628cf257bc5bc810d8768c03b6f5ca301a35cd0169f56a49624255964560
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDevice
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+DEVICEGROUPINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+PRODUCTINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredevice
+#>
+function Get-AzSphereDevice {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDevice])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of catalog
+ ${CatalogName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Alias('DeviceGroupName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of device group.
+ ${GroupName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityDeviceGroup', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory)]
+ [Alias('DeviceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Device name
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # Name of product.
+ ${ProductName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityCatalog', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${CatalogInputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityDeviceGroup', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${DeviceGroupInputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityProduct', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity]
+ # Identity Parameter
+ ${ProductInputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Sphere.private\Get-AzSphereDevice_Get';
+ GetViaIdentity = 'Az.Sphere.private\Get-AzSphereDevice_GetViaIdentity';
+ GetViaIdentityCatalog = 'Az.Sphere.private\Get-AzSphereDevice_GetViaIdentityCatalog';
+ GetViaIdentityDeviceGroup = 'Az.Sphere.private\Get-AzSphereDevice_GetViaIdentityDeviceGroup';
+ GetViaIdentityProduct = 'Az.Sphere.private\Get-AzSphereDevice_GetViaIdentityProduct';
+ List = 'Az.Sphere.private\Get-AzSphereDevice_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Sphere.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeviceGroup.ps1 b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeviceGroup.ps1
new file mode 100644
index 000000000000..f6e6b81dd634
--- /dev/null
+++ b/src/Sphere/Sphere.Autorest/exports/Get-AzSphereDeviceGroup.ps1
@@ -0,0 +1,300 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get a DeviceGroup.
+'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+.Description
+Get a DeviceGroup.
+'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+.Example
+Get-AzSphereDeviceGroup -CatalogName NewCatalog -ProductName MyProd815 -ResourceGroupName ps1-test
+.Example
+Get-AzSphereDeviceGroup -CatalogName NewCatalog -Name Marketing -ProductName MyProd815 -ResourceGroupName ps1-test
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ISphereIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeviceGroup
+.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.
+
+CATALOGINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+INPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName ]: Image name. Use an image GUID for GA versions of the API.
+ [ProductName ]: Name of product.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SerialNumber ]: Serial number of the certificate. Use '.default' to get current active certificate.
+ [SubscriptionId ]: The ID of the target subscription.
+
+PRODUCTINPUTOBJECT : Identity Parameter
+ [CatalogName ]: Name of catalog
+ [DeploymentName ]: Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ [DeviceGroupName ]: Name of device group.
+ [DeviceName ]: Device name
+ [Id ]: Resource identity path
+ [ImageName