diff --git a/generated/Site/Site.Autorest/Az.Site.csproj b/generated/Site/Site.Autorest/Az.Site.csproj
new file mode 100644
index 000000000000..c5e3139a95a3
--- /dev/null
+++ b/generated/Site/Site.Autorest/Az.Site.csproj
@@ -0,0 +1,11 @@
+
+
+ Site
+ Site
+ Site.Autorest
+ Microsoft.Azure.PowerShell.Cmdlets.Site
+
+
+
+
+
diff --git a/generated/Site/Site.Autorest/Az.Site.format.ps1xml b/generated/Site/Site.Autorest/Az.Site.format.ps1xml
new file mode 100644
index 000000000000..d4753512e11c
--- /dev/null
+++ b/generated/Site/Site.Autorest/Az.Site.format.ps1xml
@@ -0,0 +1,455 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ErrorDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ErrorDetail#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ProxyResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ProxyResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.Resource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.Site
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.Site#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteAddressProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteAddressProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ City
+
+
+ Country
+
+
+ PostalCode
+
+
+ StateOrProvince
+
+
+ StreetAddress1
+
+
+ StreetAddress2
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ResourceGroupName
+
+
+ ServicegroupName
+
+
+ SiteName
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ DisplayName
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SitePropertiesLabels
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SitePropertiesLabels#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteUpdateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteUpdateProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ DisplayName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteUpdatePropertiesLabels
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SiteUpdatePropertiesLabels#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Site.Models.SystemData#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/generated/Site/Site.Autorest/Az.Site.psd1 b/generated/Site/Site.Autorest/Az.Site.psd1
new file mode 100644
index 000000000000..92d7c34c9b96
--- /dev/null
+++ b/generated/Site/Site.Autorest/Az.Site.psd1
@@ -0,0 +1,23 @@
+@{
+ GUID = '0d71f77e-e1a5-4caf-8e65-236a1052e79f'
+ RootModule = './Az.Site.psm1'
+ ModuleVersion = '0.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: Site cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.Site.private.dll'
+ FormatsToProcess = './Az.Site.format.ps1xml'
+ FunctionsToExport = 'Get-AzSite', 'New-AzSite', 'Remove-AzSite', 'Update-AzSite'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Site'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/generated/Site/Site.Autorest/Az.Site.psm1 b/generated/Site/Site.Autorest/Az.Site.psm1
new file mode 100644
index 000000000000..b866ba8961b7
--- /dev/null
+++ b/generated/Site/Site.Autorest/Az.Site.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.Site.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Site.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.Site.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/generated/Site/Site.Autorest/Properties/AssemblyInfo.cs b/generated/Site/Site.Autorest/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..e38dec318c06
--- /dev/null
+++ b/generated/Site/Site.Autorest/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+// 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.
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
+[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
+[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
+[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Site")]
+[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")]
+[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")]
+[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
+[assembly: System.CLSCompliantAttribute(false)]
+
+
+
diff --git a/generated/Site/Site.Autorest/check-dependencies.ps1 b/generated/Site/Site.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..90ca9867ae40
--- /dev/null
+++ b/generated/Site/Site.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/generated/Site/Site.Autorest/exports/Get-AzSite.ps1 b/generated/Site/Site.Autorest/exports/Get-AzSite.ps1
new file mode 100644
index 000000000000..190b91a61ad6
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/Get-AzSite.ps1
@@ -0,0 +1,232 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Site
+.Description
+Get a Site from different scopes: Resource Group, Subscription, or Service Group
+.Example
+Get-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -Name "mysite-001" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -Name "mysite-sg-001" -ServicegroupName "my-service-group"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+.Link
+https://learn.microsoft.com/powershell/module/az.site/get-azsite
+#>
+function Get-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site (optional for list operations)
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Get-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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/generated/Site/Site.Autorest/exports/New-AzSite.ps1 b/generated/Site/Site.Autorest/exports/New-AzSite.ps1
new file mode 100644
index 000000000000..00aaecc395ff
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/New-AzSite.ps1
@@ -0,0 +1,360 @@
+
+# ----------------------------------------------------------------------------------
+# 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 a Site
+.Description
+Create a Site in different scopes: Resource Group, Subscription, or Service Group
+.Example
+New-AzSite -SiteName "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "West Coast Site" -Description "Primary site for west coast operations" -Country "US" -PostalCode "98101"
+.Example
+$labels = @{
+ "environment" = "production"
+ "region" = "west"
+ "owner" = "operations-team"
+}
+
+New-AzSite -SiteName "mysite-002" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Seattle Operations Center" -Description "Main operations site for Seattle region" -Country "US" -PostalCode "98101" -StateOrProvince "WA" -City "Seattle" -StreetAddress1 "123 Main St" -Labels $labels
+.Example
+New-AzSite -SiteName "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Global Operations Site" -Description "Enterprise-wide operations center" -Country "US" -PostalCode "10001"
+.Example
+$jsonConfig = @"
+{
+ "properties": {
+ "displayName": "JSON Created Site",
+ "description": "Site created via JSON configuration",
+ "siteAddress": {
+ "country": "CA",
+ "postalCode": "K1A 0A6",
+ "stateOrProvince": "ON",
+ "city": "Ottawa",
+ "streetAddress1": "100 Wellington St"
+ },
+ "labels": {
+ "deployment-method": "json",
+ "country": "canada"
+ }
+ }
+}
+"@
+
+New-AzSite -SiteName "site-json-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -JsonString $jsonConfig
+.Example
+New-AzSite -SiteName "service-site-001" -ServicegroupName "my-service-group" -DisplayName "Service Group Site" -Description "Site managed at service group level" -Country "US" -PostalCode "78701"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+
+SITE : Site details
+ [City ]: City of the address
+ [Country ]: Country of the address
+ [Description ]: Description of Site resource
+ [DisplayName ]: displayName of Site resource
+ [Labels ]: Key-value pairs for labeling the site resource.
+ [(Any) ]: This indicates any property can be added to this object.
+ [PostalCode ]: Postal or ZIP code of the address
+ [StateOrProvince ]: State or province of the address
+ [StreetAddress1 ]: First line of the street address
+ [StreetAddress2 ]: Second line of the street address
+.Link
+https://learn.microsoft.com/powershell/module/az.site/new-azsite
+#>
+function New-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('Name')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${SiteName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite]
+ # Site details
+ ${Site},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Site operation
+ ${JsonFilePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Json string supplied to the Site operation
+ ${JsonString},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Expanded parameters for Site creation
+ # Description of Site resource
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Display name of Site resource
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # City of the address
+ ${City},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Country of the address
+ ${Country},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Postal or ZIP code of the address
+ ${PostalCode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # State or province of the address
+ ${StateOrProvince},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # First line of the street address
+ ${StreetAddress1},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Second line of the street address
+ ${StreetAddress2},
+
+ [Parameter()]
+ [Alias('Labels')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.Collections.Hashtable]
+ # Key-value pairs for labeling the site resource
+ ${Label},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\New-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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/generated/Site/Site.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Site/Site.Autorest/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..f3feef820e3f
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,1148 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Site
+.Description
+Get a Site from different scopes: Resource Group, Subscription, or Service Group
+.Example
+Get-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -Name "mysite-001" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Get-AzSite -Name "mysite-sg-001" -ServicegroupName "my-service-group"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+.Link
+https://learn.microsoft.com/powershell/module/az.site/get-azsite
+#>
+function Get-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site (optional for list operations)
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Get-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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
+ }
+}
+}
+
+<#
+.Synopsis
+Create a Site
+.Description
+Create a Site in different scopes: Resource Group, Subscription, or Service Group
+.Example
+New-AzSite -SiteName "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "West Coast Site" -Description "Primary site for west coast operations" -Country "US" -PostalCode "98101"
+.Example
+$labels = @{
+ "environment" = "production"
+ "region" = "west"
+ "owner" = "operations-team"
+}
+
+New-AzSite -SiteName "mysite-002" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Seattle Operations Center" -Description "Main operations site for Seattle region" -Country "US" -PostalCode "98101" -StateOrProvince "WA" -City "Seattle" -StreetAddress1 "123 Main St" -Labels $labels
+.Example
+New-AzSite -SiteName "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Global Operations Site" -Description "Enterprise-wide operations center" -Country "US" -PostalCode "10001"
+.Example
+$jsonConfig = @"
+{
+ "properties": {
+ "displayName": "JSON Created Site",
+ "description": "Site created via JSON configuration",
+ "siteAddress": {
+ "country": "CA",
+ "postalCode": "K1A 0A6",
+ "stateOrProvince": "ON",
+ "city": "Ottawa",
+ "streetAddress1": "100 Wellington St"
+ },
+ "labels": {
+ "deployment-method": "json",
+ "country": "canada"
+ }
+ }
+}
+"@
+
+New-AzSite -SiteName "site-json-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -JsonString $jsonConfig
+.Example
+New-AzSite -SiteName "service-site-001" -ServicegroupName "my-service-group" -DisplayName "Service Group Site" -Description "Site managed at service group level" -Country "US" -PostalCode "78701"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+
+SITE : Site details
+ [City ]: City of the address
+ [Country ]: Country of the address
+ [Description ]: Description of Site resource
+ [DisplayName ]: displayName of Site resource
+ [Labels ]: Key-value pairs for labeling the site resource.
+ [(Any) ]: This indicates any property can be added to this object.
+ [PostalCode ]: Postal or ZIP code of the address
+ [StateOrProvince ]: State or province of the address
+ [StreetAddress1 ]: First line of the street address
+ [StreetAddress2 ]: Second line of the street address
+.Link
+https://learn.microsoft.com/powershell/module/az.site/new-azsite
+#>
+function New-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('Name')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${SiteName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite]
+ # Site details
+ ${Site},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Site operation
+ ${JsonFilePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Json string supplied to the Site operation
+ ${JsonString},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Expanded parameters for Site creation
+ # Description of Site resource
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Display name of Site resource
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # City of the address
+ ${City},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Country of the address
+ ${Country},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Postal or ZIP code of the address
+ ${PostalCode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # State or province of the address
+ ${StateOrProvince},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # First line of the street address
+ ${StreetAddress1},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Second line of the street address
+ ${StreetAddress2},
+
+ [Parameter()]
+ [Alias('Labels')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.Collections.Hashtable]
+ # Key-value pairs for labeling the site resource
+ ${Label},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\New-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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
+ }
+}
+}
+
+<#
+.Synopsis
+Delete a Site
+.Description
+Delete a Site from different scopes: Resource Group, Subscription, or Service Group
+.Example
+Remove-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Remove-AzSite -Name "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Remove-AzSite -Name "service-site-001" -ServicegroupName "my-service-group"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+.Link
+https://learn.microsoft.com/powershell/module/az.site/remove-azsite
+#>
+function Remove-AzSite {
+[OutputType([System.Boolean])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Remove-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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
+ }
+}
+}
+
+<#
+.Synopsis
+Update a Site
+.Description
+Update a Site in different scopes: Resource Group, Subscription, or Service Group
+.Example
+$newLabels = @{
+ "environment" = "updated"
+ "version" = "2.0"
+ "updated-by" = "admin"
+}
+
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -Description "Updated site description" -Labels $newLabels
+.Example
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Updated West Coast Site"
+.Example
+$jsonUpdate = @"
+{
+ "properties": {
+ "displayName": "JSON Updated Site",
+ "description": "Updated via JSON configuration",
+ "labels": {
+ "update-method": "json",
+ "automation": "true"
+ }
+ }
+}
+"@
+
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -JsonString $jsonUpdate
+.Example
+Update-AzSite -Name "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Updated Global Site" -Description "Updated enterprise operations center"
+.Example
+Update-AzSite -Name "service-site-001" -ServicegroupName "my-service-group" -DisplayName "Updated Service Group Site" -Description "Updated service group managed site"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+
+SITE : Site details
+ [City ]: City of the address
+ [Country ]: Country of the address
+ [Description ]: Description of Site resource
+ [DisplayName ]: displayName of Site resource
+ [Labels ]: Key-value pairs for labeling the site resource.
+ [(Any) ]: This indicates any property can be added to this object.
+ [PostalCode ]: Postal or ZIP code of the address
+ [StateOrProvince ]: State or province of the address
+ [StreetAddress1 ]: First line of the street address
+ [StreetAddress2 ]: Second line of the street address
+.Link
+https://learn.microsoft.com/powershell/module/az.site/update-azsite
+#>
+function Update-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite]
+ # Site details
+ ${Site},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Site operation
+ ${JsonFilePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Json string supplied to the Site operation
+ ${JsonString},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Expanded parameters for Site creation
+ # Description of Site resource
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Display name of Site resource
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # City of the address
+ ${City},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Country of the address
+ ${Country},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Postal or ZIP code of the address
+ ${PostalCode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # State or province of the address
+ ${StateOrProvince},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # First line of the street address
+ ${StreetAddress1},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Second line of the street address
+ ${StreetAddress2},
+
+ [Parameter()]
+ [Alias('Labels')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.Collections.Hashtable]
+ # Key-value pairs for labeling the site resource
+ ${Label},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Update-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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/generated/Site/Site.Autorest/exports/README.md b/generated/Site/Site.Autorest/exports/README.md
new file mode 100644
index 000000000000..b18edcabeef5
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/README.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.Site`. No other cmdlets in this repository are directly exported. What that means is the `Az.Site` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.Site.private.dll`) and from the `..\custom\Az.Site.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](..\internal/README.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.Site.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/generated/Site/Site.Autorest/exports/Remove-AzSite.ps1 b/generated/Site/Site.Autorest/exports/Remove-AzSite.ps1
new file mode 100644
index 000000000000..be0f1a00b056
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/Remove-AzSite.ps1
@@ -0,0 +1,248 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Delete a Site
+.Description
+Delete a Site from different scopes: Resource Group, Subscription, or Service Group
+.Example
+Remove-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Remove-AzSite -Name "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012"
+.Example
+Remove-AzSite -Name "service-site-001" -ServicegroupName "my-service-group"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+.Link
+https://learn.microsoft.com/powershell/module/az.site/remove-azsite
+#>
+function Remove-AzSite {
+[OutputType([System.Boolean])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Remove-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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/generated/Site/Site.Autorest/exports/Update-AzSite.ps1 b/generated/Site/Site.Autorest/exports/Update-AzSite.ps1
new file mode 100644
index 000000000000..bf4f1a5baf93
--- /dev/null
+++ b/generated/Site/Site.Autorest/exports/Update-AzSite.ps1
@@ -0,0 +1,353 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Update a Site
+.Description
+Update a Site in different scopes: Resource Group, Subscription, or Service Group
+.Example
+$newLabels = @{
+ "environment" = "updated"
+ "version" = "2.0"
+ "updated-by" = "admin"
+}
+
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -Description "Updated site description" -Labels $newLabels
+.Example
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Updated West Coast Site"
+.Example
+$jsonUpdate = @"
+{
+ "properties": {
+ "displayName": "JSON Updated Site",
+ "description": "Updated via JSON configuration",
+ "labels": {
+ "update-method": "json",
+ "automation": "true"
+ }
+ }
+}
+"@
+
+Update-AzSite -Name "mysite-001" -ResourceGroupName "rg-sites" -SubscriptionId "12345678-1234-1234-1234-123456789012" -JsonString $jsonUpdate
+.Example
+Update-AzSite -Name "global-site-001" -SubscriptionId "12345678-1234-1234-1234-123456789012" -DisplayName "Updated Global Site" -Description "Updated enterprise operations center"
+.Example
+Update-AzSite -Name "service-site-001" -ServicegroupName "my-service-group" -DisplayName "Updated Service Group Site" -Description "Updated service group managed site"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite
+.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 for pipeline operations
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ServicegroupName ]: The name of the service group
+ [SiteName ]: The name of the Site
+ [SubscriptionId ]: The ID of the target subscription. The value must be an UUID.
+
+SITE : Site details
+ [City ]: City of the address
+ [Country ]: Country of the address
+ [Description ]: Description of Site resource
+ [DisplayName ]: displayName of Site resource
+ [Labels ]: Key-value pairs for labeling the site resource.
+ [(Any) ]: This indicates any property can be added to this object.
+ [PostalCode ]: Postal or ZIP code of the address
+ [StateOrProvince ]: State or province of the address
+ [StreetAddress1 ]: First line of the street address
+ [StreetAddress2 ]: Second line of the street address
+.Link
+https://learn.microsoft.com/powershell/module/az.site/update-azsite
+#>
+function Update-AzSite {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('SiteName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the Site
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # Required for resource group scope operations.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ # Required for resource group and subscription scope operations.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [System.String]
+ # The name of the service group.
+ # Required for service group scope operations.
+ ${ServicegroupName},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISiteIdentity]
+ # Identity Parameter for pipeline operations
+ ${InputObject},
+
+ [Parameter(ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Models.ISite]
+ # Site details
+ ${Site},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Site operation
+ ${JsonFilePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Json string supplied to the Site operation
+ ${JsonString},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Expanded parameters for Site creation
+ # Description of Site resource
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Display name of Site resource
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # City of the address
+ ${City},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Country of the address
+ ${Country},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Postal or ZIP code of the address
+ ${PostalCode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # State or province of the address
+ ${StateOrProvince},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # First line of the street address
+ ${StreetAddress1},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.String]
+ # Second line of the street address
+ ${StreetAddress2},
+
+ [Parameter()]
+ [Alias('Labels')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Body')]
+ [System.Collections.Hashtable]
+ # Key-value pairs for labeling the site resource
+ ${Label},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
+
+ 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.Site.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 = @{
+ __AllParameterSets = 'Az.Site.custom\Update-AzSite';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ 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.Site.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.Site.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Site.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)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
+ $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.Site.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/generated/Site/Site.Autorest/generate-info.json b/generated/Site/Site.Autorest/generate-info.json
new file mode 100644
index 000000000000..946bf273c031
--- /dev/null
+++ b/generated/Site/Site.Autorest/generate-info.json
@@ -0,0 +1,3 @@
+{
+ "generate_Id": "42925558-4e1b-4ac8-9f09-eaca93301159"
+}
diff --git a/generated/Site/Site.Autorest/generated/Module.cs b/generated/Site/Site.Autorest/generated/Module.cs
new file mode 100644
index 000000000000..ffb54c5e57d2
--- /dev/null
+++ b/generated/Site/Site.Autorest/generated/Module.cs
@@ -0,0 +1,202 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Site
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Site.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using GetTelemetryIdDelegate = global::System.Func;
+ using TelemetryDelegate = global::System.Action;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using SanitizerDelegate = global::System.Action