diff --git a/src/Chaos/Chaos.Autorest/Az.Chaos.csproj b/src/Chaos/Chaos.Autorest/Az.Chaos.csproj
new file mode 100644
index 000000000000..0de9ea856985
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/Az.Chaos.csproj
@@ -0,0 +1,10 @@
+
+
+ Chaos
+ Chaos
+ Chaos.Autorest
+
+
+
+
+
diff --git a/src/Chaos/Chaos.Autorest/Az.Chaos.format.ps1xml b/src/Chaos/Chaos.Autorest/Az.Chaos.format.ps1xml
new file mode 100644
index 000000000000..86478b52092c
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/Az.Chaos.format.ps1xml
@@ -0,0 +1,1525 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Action
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Action#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ActionStatus
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ActionStatus#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionId
+
+
+ ActionName
+
+
+ EndTime
+
+
+ StartTime
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Branch
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Branch#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.BranchStatus
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.BranchStatus#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BranchId
+
+
+ BranchName
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Capability
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Capability#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ ParametersSchema
+
+
+ Publisher
+
+
+ TargetType
+
+
+ Urn
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityType
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityType#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypeListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypeListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypeProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypeProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ DisplayName
+
+
+ Kind
+
+
+ ParametersSchema
+
+
+ Publisher
+
+
+ TargetType
+
+
+ Urn
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypePropertiesRuntimeProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.CapabilityTypePropertiesRuntimeProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Kind
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ChaosIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ChaosIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AsyncOperationId
+
+
+ CapabilityName
+
+
+ CapabilityTypeName
+
+
+ ExecutionId
+
+
+ ExperimentName
+
+
+ Location
+
+
+ LocationName
+
+
+ ParentProviderNamespace
+
+
+ ParentResourceName
+
+
+ ParentResourceType
+
+
+ ResourceGroupName
+
+
+ SubscriptionId
+
+
+ TargetName
+
+
+ TargetTypeName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ContinuousAction
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ContinuousAction#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SelectorId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.DelayAction
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.DelayAction#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.DiscreteAction
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.DiscreteAction#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SelectorId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ErrorDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ErrorDetail#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Experiment
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Experiment#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecution
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecution#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionActionTargetDetailsError
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionActionTargetDetailsError#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionActionTargetDetailsProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionActionTargetDetailsProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Status
+
+
+ Target
+
+
+ TargetCompletedTime
+
+
+ TargetFailedTime
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionDetails
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionDetails#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionDetailsProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionDetailsProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StartedAt
+
+
+ Status
+
+
+ StoppedAt
+
+
+ FailureReason
+
+
+ LastActionAt
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentExecutionProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StartedAt
+
+
+ Status
+
+
+ StoppedAt
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ExperimentProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.KeyValuePair
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.KeyValuePair#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Key
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ListSelector
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ListSelector#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ FilterType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Operation
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Operation#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionType
+
+
+ IsDataAction
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationDisplay
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationDisplay#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationStatus
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.OperationStatus#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+ EndTime
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+ StartTime
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.QuerySelector
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.QuerySelector#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterType
+
+
+ QueryString
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Resource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ResourceIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ResourceIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PrincipalId
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Step
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Step#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.StepStatus
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.StepStatus#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Status
+
+
+ StepId
+
+
+ StepName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.SystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.SystemData#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Tags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Tags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Target
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Target#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetType
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetType#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetTypeListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetTypeListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetTypeProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TargetTypeProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ DisplayName
+
+
+ PropertiesSchema
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TrackedResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TrackedResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TrackedResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.TrackedResourceTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.UserAssignedIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.UserAssignedIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClientId
+
+
+ PrincipalId
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/Az.Chaos.psd1 b/src/Chaos/Chaos.Autorest/Az.Chaos.psd1
new file mode 100644
index 000000000000..5620325d61b2
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/Az.Chaos.psd1
@@ -0,0 +1,23 @@
+@{
+ GUID = 'ca01a43f-b9c7-4e71-a41d-a185e2355c98'
+ RootModule = './Az.Chaos.psm1'
+ ModuleVersion = '0.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: Chaos cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.Chaos.private.dll'
+ FormatsToProcess = './Az.Chaos.format.ps1xml'
+ FunctionsToExport = 'Get-AzChaosCapability', 'Get-AzChaosCapabilityType', 'Get-AzChaosExecutionExperimentDetail', 'Get-AzChaosExperiment', 'Get-AzChaosExperimentExecution', 'Get-AzChaosTarget', 'Get-AzChaosTargetType', 'New-AzChaosActionObject', 'New-AzChaosBranchObject', 'New-AzChaosCapability', 'New-AzChaosExperiment', 'New-AzChaosSelectorObject', 'New-AzChaosStepObject', 'New-AzChaosTarget', 'Remove-AzChaosCapability', 'Remove-AzChaosExperiment', 'Remove-AzChaosTarget', 'Start-AzChaosExperiment', 'Stop-AzChaosExperiment', 'Update-AzChaosCapability', 'Update-AzChaosExperiment', 'Update-AzChaosTarget'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Chaos'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/src/Chaos/Chaos.Autorest/Az.Chaos.psm1 b/src/Chaos/Chaos.Autorest/Az.Chaos.psm1
new file mode 100644
index 000000000000..41b3145234a2
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/Az.Chaos.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.Chaos.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/Chaos/Chaos.Autorest/README.md b/src/Chaos/Chaos.Autorest/README.md
new file mode 100644
index 000000000000..699e633e9c3c
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/README.md
@@ -0,0 +1,203 @@
+
+# Az.Chaos
+This directory contains the PowerShell module for the Chaos service.
+
+---
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.Chaos`, see [how-to.md](how-to.md).
+
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+``` yaml
+commit: 907b79c0a6a660826e54dc1f16ea14b831b201d2
+require:
+ - $(this-folder)/../../readme.azure.noprofile.md
+input-file:
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/capabilities.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/capabilityTypes.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/experiments.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/operationStatuses.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/operations.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/targetTypes.json
+ - $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/targets.json
+
+title: Chaos
+module-version: 0.1.0
+subject-prefix: $(service-name)
+
+identity-correction-for-post: true
+
+directive:
+ - from: swagger-document
+ where: $.definitions.TrackedResource.properties.location
+ transform: >-
+ return {
+ "type": "string",
+ "x-ms-mutability": [
+ "read",
+ "create",
+ "update"
+ ],
+ "description": "The geo-location where the resource lives"
+ }
+
+ - from: swagger-document
+ where: $.definitions.target
+ transform: >-
+ return {
+ "type": "object",
+ "description": "Model that represents a Target resource.",
+ "allOf": [
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v2/types.json#/definitions/Resource"
+ }
+ ],
+ "properties": {
+ "systemData": {
+ "description": "The system metadata of the target resource.",
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v2/types.json#/definitions/systemData",
+ "readOnly": true
+ },
+ "location": {
+ "type": "string",
+ "description": "Location of the target resource."
+ },
+ "properties": {
+ "description": "The properties of the target resource.",
+ "x-ms-client-flatten": true,
+ "$ref": "#/definitions/targetProperties"
+ }
+ }
+ }
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}"].delete.responses
+ transform: >-
+ return {
+ "200": {
+ "description": "OK"
+ },
+ "202": {
+ "description": "Asynchronous delete operation."
+ },
+ "default": {
+ "description": "Error response returned if request was unsuccessful.",
+ "schema": {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}"].patch.responses
+ transform: >-
+ return {
+ "200": {
+ "description": "Long running replace experiment operation.",
+ "schema": {
+ "$ref": "./types/experiments.json#/definitions/experiment"
+ }
+ },
+ "202": {
+ "description": "Long running update operation.",
+ "schema": {
+ "$ref": "./types/experiments.json#/definitions/experiment"
+ }
+ },
+ "default": {
+ "description": "Error response returned if request was unsuccessful.",
+ "schema": {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start"].post.responses
+ transform: >-
+ return {
+ "200": {
+ "description": "Ok.",
+ "schema": {
+ "$ref": "./types/experiments.json#/definitions/experiment"
+ }
+ },
+ "202": {
+ "description": "Long running start experiment operation."
+ },
+ "default": {
+ "description": "Error response returned if request was unsuccessful.",
+ "schema": {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel"].post.responses
+ transform: >-
+ return {
+ "200": {
+ "description": "Ok.",
+ "schema": {
+ "$ref": "./types/experiments.json#/definitions/experiment"
+ }
+ },
+ "202": {
+ "description": "Long running start experiment operation."
+ },
+ "default": {
+ "description": "Error response returned if request was unsuccessful.",
+ "schema": {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+
+ - where:
+ verb: New
+ subject: Experiment
+ variant: ^CreateViaIdentityExpanded$|^CreateExpanded$
+ remove: true
+
+ - where:
+ variant: ^(Create|Update).*(?",
+ "-ExperimentName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Execution details of an experiment resource.",
+ "parameters": [
+ {
+ "name": "-ExecutionId",
+ "value": "[Path.executionId]"
+ },
+ {
+ "name": "-ExperimentName",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Get-AzChaosExperimentExecution",
+ "description": "Get an execution of an Experiment resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexperimentexecution"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-ExecutionId ",
+ "-ExperimentName ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get an execution of an Experiment resource.",
+ "parameters": [
+ {
+ "name": "-ExecutionId",
+ "value": "[Path.executionId]"
+ },
+ {
+ "name": "-ExperimentName",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/experiments.json b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/experiments.json
new file mode 100644
index 000000000000..71ad3a7322c3
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/experiments.json
@@ -0,0 +1,161 @@
+{
+ "resourceType": "experiments",
+ "apiVersion": "2024-01-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos"
+ },
+ "commands": [
+ {
+ "name": "Get-AzChaosExperiment",
+ "description": "Get a Experiment resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexperiment"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Experiment resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzChaosExperiment",
+ "description": "Delete a Experiment resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/remove-azchaosexperiment"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a Experiment resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Start-AzChaosExperiment",
+ "description": "Start a Experiment resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/start-azchaosexperiment"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Start a Experiment resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Stop-AzChaosExperiment",
+ "description": "Cancel a running Experiment resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/stop-azchaosexperiment"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Cancel a running Experiment resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.experimentName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes-capabilityTypes.json b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes-capabilityTypes.json
new file mode 100644
index 000000000000..1b0b1aa68b1e
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes-capabilityTypes.json
@@ -0,0 +1,52 @@
+{
+ "resourceType": "locations/targetTypes/capabilityTypes",
+ "apiVersion": "2024-01-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos"
+ },
+ "commands": [
+ {
+ "name": "Get-AzChaosCapabilityType",
+ "description": "Get a Capability Type resource for given Target Type and location.",
+ "path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaoscapabilitytype"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-LocationName ",
+ "-Name ",
+ "[-SubscriptionId ]",
+ "-TargetTypeName "
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Capability Type resource for given Target Type and location.",
+ "parameters": [
+ {
+ "name": "-LocationName",
+ "value": "[Path.locationName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.capabilityTypeName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ },
+ {
+ "name": "-TargetTypeName",
+ "value": "[Path.targetTypeName]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes.json b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes.json
new file mode 100644
index 000000000000..efb0c9ec4d79
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/locations-targetTypes.json
@@ -0,0 +1,47 @@
+{
+ "resourceType": "locations/targetTypes",
+ "apiVersion": "2024-01-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos"
+ },
+ "commands": [
+ {
+ "name": "Get-AzChaosTargetType",
+ "description": "Get a Target Type resources for given location.",
+ "path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaostargettype"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-LocationName ",
+ "-Name ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Target Type resources for given location.",
+ "parameters": [
+ {
+ "name": "-LocationName",
+ "value": "[Path.locationName]"
+ },
+ {
+ "name": "-Name",
+ "value": "[Path.targetTypeName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets-capabilities.json b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets-capabilities.json
new file mode 100644
index 000000000000..754835668041
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets-capabilities.json
@@ -0,0 +1,125 @@
+{
+ "resourceType": "targets/capabilities",
+ "apiVersion": "2024-01-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos"
+ },
+ "commands": [
+ {
+ "name": "Get-AzChaosCapability",
+ "description": "Get a Capability resource that extends a Target resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaoscapability"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ParentProviderNamespace ",
+ "-ParentResourceName ",
+ "-ParentResourceType ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]",
+ "-TargetName "
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Capability resource that extends a Target resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.capabilityName]"
+ },
+ {
+ "name": "-ParentProviderNamespace",
+ "value": "[Path.parentProviderNamespace]"
+ },
+ {
+ "name": "-ParentResourceName",
+ "value": "[Path.parentResourceName]"
+ },
+ {
+ "name": "-ParentResourceType",
+ "value": "[Path.parentResourceType]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ },
+ {
+ "name": "-TargetName",
+ "value": "[Path.targetName]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzChaosCapability",
+ "description": "Delete a Capability that extends a Target resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/remove-azchaoscapability"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ParentProviderNamespace ",
+ "-ParentResourceName ",
+ "-ParentResourceType ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]",
+ "-TargetName "
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a Capability that extends a Target resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.capabilityName]"
+ },
+ {
+ "name": "-ParentProviderNamespace",
+ "value": "[Path.parentProviderNamespace]"
+ },
+ {
+ "name": "-ParentResourceName",
+ "value": "[Path.parentResourceName]"
+ },
+ {
+ "name": "-ParentResourceType",
+ "value": "[Path.parentResourceType]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ },
+ {
+ "name": "-TargetName",
+ "value": "[Path.targetName]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets.json b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets.json
new file mode 100644
index 000000000000..8ba3a513d76d
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/UX/Microsoft.Chaos/targets.json
@@ -0,0 +1,115 @@
+{
+ "resourceType": "targets",
+ "apiVersion": "2024-01-01",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos"
+ },
+ "commands": [
+ {
+ "name": "Get-AzChaosTarget",
+ "description": "Get a Target resource that extends a tracked regional resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaostarget"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ParentProviderNamespace ",
+ "-ParentResourceName ",
+ "-ParentResourceType ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Get a Target resource that extends a tracked regional resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.targetName]"
+ },
+ {
+ "name": "-ParentProviderNamespace",
+ "value": "[Path.parentProviderNamespace]"
+ },
+ {
+ "name": "-ParentResourceName",
+ "value": "[Path.parentResourceName]"
+ },
+ {
+ "name": "-ParentResourceType",
+ "value": "[Path.parentResourceType]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzChaosTarget",
+ "description": "Delete a Target resource that extends a tracked regional resource.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.chaos/remove-azchaostarget"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ParentProviderNamespace ",
+ "-ParentResourceName ",
+ "-ParentResourceType ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Delete a Target resource that extends a tracked regional resource.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.targetName]"
+ },
+ {
+ "name": "-ParentProviderNamespace",
+ "value": "[Path.parentProviderNamespace]"
+ },
+ {
+ "name": "-ParentResourceName",
+ "value": "[Path.parentResourceName]"
+ },
+ {
+ "name": "-ParentResourceType",
+ "value": "[Path.parentResourceType]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Chaos/Chaos.Autorest/build-module.ps1 b/src/Chaos/Chaos.Autorest/build-module.ps1
new file mode 100644
index 000000000000..8f73d0e5e4a4
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/build-module.ps1
@@ -0,0 +1,180 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $NotIsolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($UX) {
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+ if($LastExitCode -ne 0) {
+ # UX generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Chaos.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.Chaos.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.Chaos.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.Chaos'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @(@{modelName="Selector"; cmdletName=""}, @{modelName="Step"; cmdletName=""}, @{modelName="Branch"; cmdletName=""}, @{modelName="Action"; cmdletName=""})
+$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
+if (Test-Path $modelCmdletFolder) {
+ $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
+}
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: Chaos cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.Chaos.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
+{
+ Write-Host -ForegroundColor Green 'Creating ux metadata...'
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/Chaos/Chaos.Autorest/check-dependencies.ps1 b/src/Chaos/Chaos.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..90ca9867ae40
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/Chaos/Chaos.Autorest/create-model-cmdlets.ps1 b/src/Chaos/Chaos.Autorest/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..03def4b1a944
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/create-model-cmdlets.ps1
@@ -0,0 +1,262 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([Hashtable[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+ if (''.length -gt 0) {
+ $ModuleName = ''
+ } else {
+ $ModuleName = 'Az.Chaos'
+ }
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ $classConstantMember = @{}
+ foreach ($Model in $Models)
+ {
+ $ModelName = $Model.modelName
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$ModelName") }
+ $ClassNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'class') -and ($_.Identifier.value -eq "$ModelName") }
+ $classConstantMember = @()
+ foreach ($class in $ClassNode) {
+ foreach ($member in $class.Members) {
+ $isConstant = $false
+ foreach ($attr in $member.AttributeLists) {
+ $memberName = $attr.Attributes.Name.ToString()
+ if ($memberName.EndsWith('.Constant')) {
+ $isConstant = $true
+ break
+ }
+ }
+ if (($member.Modifiers.ToString() -eq 'public') -and $isConstant) {
+ $classConstantMember += $member.Identifier.Value
+ }
+ }
+ }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$ModelName")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $ModelName
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith('Chaos')) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = 'Chaos'
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ if ($classConstantMember.Contains($Member.Identifier.Value)) {
+ # skip constant member
+ continue
+ }
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ $mutability = @{Read = $true; Create = $true; Update = $true}
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Read")
+ {
+ $mutability.Read = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Create")
+ {
+ $mutability.Create = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Update")
+ {
+ $mutability.Update = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ if ($Type.StartsWith("System.Collections.Generic.List"))
+ {
+ # if the type is a list, we need to convert it to array
+ $matched = $Type -match '\<(?.+)\>$'
+ if ($matched)
+ {
+ $Type = $matches.Name + '[]';
+ }
+ }
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required -and $mutability.Create -and $mutability.Update)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if(IsEnumType($Member)){
+ $completer += GetCompleter($Member)
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $cmdletName = "New-Az${ModulePrefix}${ObjectType}Object"
+ if ('' -ne $Model.cmdletName) {
+ $cmdletName = $Model.cmdletName
+ }
+ $OutputPath = Join-Path -ChildPath "${cmdletName}.ps1" -Path $OutputDir
+ $cmdletNameInLowerCase = $cmdletName.ToLower()
+ $Script = "
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the ""License"");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an ""AS IS"" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://learn.microsoft.com/powershell/module/${ModuleName}/${cmdletNameInLowerCase}
+#>
+function ${cmdletName} {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
+
+function IsEnumType {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ $isEnum = $false
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $isEnum = $true
+ break
+ }
+ }
+ return $isEnum;
+}
+
+function GetCompleter {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $attributeName = $attributeName.Split("::")[-1]
+ $possibleValues = [System.String]::Join(", ", $attr.Attributes.ArgumentList.Arguments)
+ $completer += "`n [${attributeName}(${possibleValues})]"
+ return $completer
+ }
+ }
+}
diff --git a/src/Chaos/Chaos.Autorest/custom/Az.Chaos.custom.psm1 b/src/Chaos/Chaos.Autorest/custom/Az.Chaos.custom.psm1
new file mode 100644
index 000000000000..7b25f5277fb1
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/Az.Chaos.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Chaos.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Chaos.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/Chaos/Chaos.Autorest/custom/README.md b/src/Chaos/Chaos.Autorest/custom/README.md
new file mode 100644
index 000000000000..01419bd81639
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.Chaos` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Chaos.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.Chaos` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Chaos.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.Chaos.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Chaos`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.Chaos.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.Chaos.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Chaos`.
+- `Microsoft.Azure.PowerShell.Cmdlets.Chaos.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Chaos`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.Chaos.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosActionObject.ps1 b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosActionObject.ps1
new file mode 100644
index 000000000000..522c1405847a
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosActionObject.ps1
@@ -0,0 +1,53 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for Action.
+.Description
+Create an in-memory object for Action.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Action
+.Link
+https://learn.microsoft.com/powershell/module/Az.Chaos/new-azchaosactionobject
+#>
+function New-AzChaosActionObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Action')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="String that represents a Capability URN.")]
+ [string]
+ $Name,
+ [Parameter(Mandatory, HelpMessage="Enum that discriminates between action models.")]
+ [string]
+ $Type
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Action]::New()
+
+ if ($PSBoundParameters.ContainsKey('Name')) {
+ $Object.Name = $Name
+ }
+ if ($PSBoundParameters.ContainsKey('Type')) {
+ $Object.Type = $Type
+ }
+ return $Object
+ }
+}
+
diff --git a/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosBranchObject.ps1 b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosBranchObject.ps1
new file mode 100644
index 000000000000..8198aa7f16db
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosBranchObject.ps1
@@ -0,0 +1,53 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for Branch.
+.Description
+Create an in-memory object for Branch.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Branch
+.Link
+https://learn.microsoft.com/powershell/module/Az.Chaos/new-azchaosbranchobject
+#>
+function New-AzChaosBranchObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Branch')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="List of actions.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IAction[]]
+ $Action,
+ [Parameter(Mandatory, HelpMessage="String of the branch name.")]
+ [string]
+ $Name
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Branch]::New()
+
+ if ($PSBoundParameters.ContainsKey('Action')) {
+ $Object.Action = $Action
+ }
+ if ($PSBoundParameters.ContainsKey('Name')) {
+ $Object.Name = $Name
+ }
+ return $Object
+ }
+}
+
diff --git a/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosSelectorObject.ps1 b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosSelectorObject.ps1
new file mode 100644
index 000000000000..a94a9753e0f3
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosSelectorObject.ps1
@@ -0,0 +1,54 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for Selector.
+.Description
+Create an in-memory object for Selector.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Selector
+.Link
+https://learn.microsoft.com/powershell/module/Az.Chaos/new-azchaosselectorobject
+#>
+function New-AzChaosSelectorObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Selector')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="String of the selector ID.")]
+ [string]
+ $Id,
+ [Parameter(Mandatory, HelpMessage="Enum of the selector type.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.PSArgumentCompleterAttribute("List", "Query")]
+ [string]
+ $Type
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Selector]::New()
+
+ if ($PSBoundParameters.ContainsKey('Id')) {
+ $Object.Id = $Id
+ }
+ if ($PSBoundParameters.ContainsKey('Type')) {
+ $Object.Type = $Type
+ }
+ return $Object
+ }
+}
+
diff --git a/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosStepObject.ps1 b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosStepObject.ps1
new file mode 100644
index 000000000000..05ec590e229f
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/custom/autogen-model-cmdlets/New-AzChaosStepObject.ps1
@@ -0,0 +1,53 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for Step.
+.Description
+Create an in-memory object for Step.
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Step
+.Link
+https://learn.microsoft.com/powershell/module/Az.Chaos/new-azchaosstepobject
+#>
+function New-AzChaosStepObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Step')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="List of branches.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IBranch[]]
+ $Branch,
+ [Parameter(Mandatory, HelpMessage="String of the step name.")]
+ [string]
+ $Name
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.Step]::New()
+
+ if ($PSBoundParameters.ContainsKey('Branch')) {
+ $Object.Branch = $Branch
+ }
+ if ($PSBoundParameters.ContainsKey('Name')) {
+ $Object.Name = $Name
+ }
+ return $Object
+ }
+}
+
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapability.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapability.md
new file mode 100644
index 000000000000..56beff793346
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapability.md
@@ -0,0 +1,39 @@
+### Example 1: Get a Capability resource that extends a Target resource.
+```powershell
+Get-AzChaosCapability -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+Redeploy-1.0 azps_test_group_chaos
+Shutdown-1.0 azps_test_group_chaos
+```
+
+Get a Capability resource that extends a Target resource.
+
+### Example 2: Get a Capability resource that extends a Target resource.
+```powershell
+Get-AzChaosCapability -Name Shutdown-1.0 -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+```
+
+```output
+Description :
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine/capabilities/Shutdown-1.0
+Name : Shutdown-1.0
+ParametersSchema : https://schema-tc.eastus.chaos-prod.azure.com/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0/parametersSchema.json
+Publisher : microsoft
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:43 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 11:35:18 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+TargetType : virtualmachine
+Type : Microsoft.Chaos/targets/capabilities
+Urn : urn:csci:microsoft:virtualMachine:shutdown/1.0
+```
+
+Get a Capability resource that extends a Target resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapabilityType.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapabilityType.md
new file mode 100644
index 000000000000..4ac2dccfbe39
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosCapabilityType.md
@@ -0,0 +1,45 @@
+### Example 1: Get a Capability Type resource for given Target Type and location.
+```powershell
+Get-AzChaosCapabilityType -LocationName eastus -TargetTypeName microsoft-virtualmachine
+```
+
+```output
+Name Location ResourceGroupName
+---- -------- -----------------
+Redeploy-1.0 eastus
+Shutdown-1.0 eastus
+```
+
+Get a Capability Type resource for given Target Type and location.
+
+### Example 2: Get a Capability Type resource for given Target Type and location.
+```powershell
+Get-AzChaosCapabilityType -LocationName eastus -TargetTypeName microsoft-virtualmachine -Name Shutdown-1.0
+```
+
+```output
+AzureRbacAction : {Microsoft.Compute/virtualMachines/poweroff/action, Microsoft.Compute/virtualMachines/start/action, Microsoft.Compute/virtualMachines/instanceView/read, Microsoft.Compute/virtua
+ lMachines/read…}
+AzureRbacDataAction :
+Description :
+DisplayName :
+Id : /subscriptions/{subId}/providers/Microsoft.Chaos/locations/eastus/targetTypes/virtualmachine/capabilityTypes/Shutdown-1.0
+Kind : Fault
+Location : eastus
+Name : Shutdown-1.0
+ParametersSchema : https://schema-tc.eastus.chaos-prod.azure.com/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0/parametersSchema.json
+Publisher : Microsoft
+ResourceGroupName :
+RuntimePropertyKind : Continuous
+SystemDataCreatedAt : 2024-03-08 06:57:59 PM
+SystemDataCreatedBy :
+SystemDataCreatedByType : Application
+SystemDataLastModifiedAt : 2024-03-08 06:57:59 PM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+TargetType : VirtualMachine
+Type : Microsoft.Chaos/locations/targetTypes/capabilityTypes
+Urn : urn:csci:microsoft:virtualMachine:shutdown/1.0
+```
+
+Get a Capability Type resource for given Target Type and location.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExecutionExperimentDetail.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExecutionExperimentDetail.md
new file mode 100644
index 000000000000..c1712456bd51
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExecutionExperimentDetail.md
@@ -0,0 +1,49 @@
+### Example 1: Execution details of an experiment resource.
+```powershell
+Get-AzChaosExecutionExperimentDetail -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos -ExecutionId 13E31E28-45F4-402E-99B4-DF19A78E457E
+```
+
+```output
+FailureReason :
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/experiment-test/executions/13E31E28-45F4-402E-99B4-DF19A
+ 78E457E
+LastActionAt : 2024-05-06 09:54:20 AM
+Name : 13E31E28-45F4-402E-99B4-DF19A78E457E
+ResourceGroupName : azps_test_group_chaos
+RunInformationStep : {{
+ "stepName": "step1",
+ "stepId": "step1",
+ "status": "completed",
+ "branches": [
+ {
+ "branchName": "branch1",
+ "branchId": "branch1",
+ "status": "completed",
+ "actions": [
+ {
+ "actionName": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "actionId": "c5e62ae5-60c2-4cb4-b620-890bbf671c7b",
+ "status": "completed",
+ "startTime": "2024-05-06T09:43:15.6470366Z",
+ "endTime": "2024-05-06T09:54:16.1794070Z",
+ "targets": [
+ {
+ "status": "completed",
+ "target": "urn:x-chaos-targets:Azure-virtualMachine:/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virt
+ ualMachines/exampleVM/providers/Microsoft.Chaos/targets/microsoft-virtualMachine",
+ "targetFailedTime": "0001-01-01T00:00:00.0000000Z",
+ "targetCompletedTime": "2024-05-06T09:54:16.1708885Z"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }}
+StartedAt : 2024-05-06 09:42:44 AM
+Status : Success
+StoppedAt : 2024-05-06 09:54:20 AM
+Type : Microsoft.Chaos/experiments/executions
+```
+
+Execution details of an experiment resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperiment.md
new file mode 100644
index 000000000000..95d4d4c23ad9
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperiment.md
@@ -0,0 +1,185 @@
+### Example 1: List Experiment resource.
+```powershell
+Get-AzChaosExperiment
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/experiment-test
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType :
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : experiment-test
+ProvisioningState :
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "84f2321b-b84c-4f61-ae0d-f18521c86477",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/microsoft.compute/virtualmachines/exampleVM/providers/Microsoft.C
+ haos/targets/microsoft-virtualmachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "Step 1",
+ "branches": [
+ {
+ "name": "Branch 1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "84f2321b-b84c-4f61-ae0d-f18521c86477"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-03-18 10:35:30 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 10:35:30 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+List Experiment resource.
+
+### Example 2: List Experiment resource.
+```powershell
+Get-AzChaosExperiment -ResourceGroupName azps_test_group_chaos
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/experiment-test
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType :
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : experiment-test
+ProvisioningState :
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "84f2321b-b84c-4f61-ae0d-f18521c86477",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/microsoft.compute/virtualmachines/exampleVM/providers/Microsoft.C
+ haos/targets/microsoft-virtualmachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "Step 1",
+ "branches": [
+ {
+ "name": "Branch 1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "84f2321b-b84c-4f61-ae0d-f18521c86477"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-03-18 10:35:30 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 10:35:30 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+List Experiment resource.
+
+### Example 3: Get a Experiment resource.
+```powershell
+Get-AzChaosExperiment -ResourceGroupName azps_test_group_chaos -Name experiment-test
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/experiment-test
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType :
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : experiment-test
+ProvisioningState :
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "84f2321b-b84c-4f61-ae0d-f18521c86477",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/microsoft.compute/virtualmachines/exampleVM/providers/Microsoft.C
+ haos/targets/microsoft-virtualmachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "Step 1",
+ "branches": [
+ {
+ "name": "Branch 1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "84f2321b-b84c-4f61-ae0d-f18521c86477"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-03-18 10:35:30 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 10:35:30 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+Get a Experiment resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperimentExecution.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperimentExecution.md
new file mode 100644
index 000000000000..936f67e5bb59
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosExperimentExecution.md
@@ -0,0 +1,31 @@
+### Example 1: Get an execution of an Experiment resource.
+```powershell
+Get-AzChaosExperimentExecution -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos
+```
+
+```output
+Name ResourceGroupName
+---- -----------------
+F7FEAFD8-5D50-42A1-ADB7-044A19B997AA azps_test_group_chaos
+13E31E28-45F4-402E-99B4-DF19A78E457E azps_test_group_chaos
+```
+
+Get an execution of an Experiment resource.
+
+### Example 2: Get an execution of an Experiment resource.
+```powershell
+Get-AzChaosExperimentExecution -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos -ExecutionId 13E31E28-45F4-402E-99B4-DF19A78E457E
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/experiment-test/executions/13E31E28-45F4-402E-99B4-DF19A7
+ 8E457E
+Name : 13E31E28-45F4-402E-99B4-DF19A78E457E
+ResourceGroupName : azps_test_group_chaos
+StartedAt : 2024-05-06 09:42:44 AM
+Status : Success
+StoppedAt : 2024-05-06 09:54:20 AM
+Type : Microsoft.Chaos/experiments/executions
+```
+
+Get an execution of an Experiment resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTarget.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTarget.md
new file mode 100644
index 000000000000..0f0ca55b2912
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTarget.md
@@ -0,0 +1,47 @@
+### Example 1: Get a Target resource that extends a tracked regional resource.
+```powershell
+Get-AzChaosTarget -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/microsoft.compute/virtualmachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine
+Location : eastus
+Name : microsoft-virtualmachine
+Property : {
+ }
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:42 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 10:28:42 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.Chaos/targets
+```
+
+Get a Target resource that extends a tracked regional resource.
+
+### Example 2: Get a Target resource that extends a tracked regional resource.
+```powershell
+Get-AzChaosTarget -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -Name microsoft-virtualmachine
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/microsoft.compute/virtualmachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine
+Location : eastus
+Name : microsoft-virtualmachine
+Property : {
+ }
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:42 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 10:28:42 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.Chaos/targets
+```
+
+Get a Target resource that extends a tracked regional resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTargetType.md b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTargetType.md
new file mode 100644
index 000000000000..ef864090bb34
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Get-AzChaosTargetType.md
@@ -0,0 +1,39 @@
+### Example 1: List Target Type resources for given location.
+```powershell
+Get-AzChaosTargetType -LocationName eastus
+```
+
+```output
+Name Location ResourceGroupName
+---- -------- -----------------
+Microsoft-Agent eastus
+Microsoft-AppService eastus
+Microsoft-KeyVault eastus
+```
+
+List Target Type resources for given location.
+
+### Example 2: Get a Target Type resources for given location.
+```powershell
+Get-AzChaosTargetType -LocationName eastus -Name Microsoft-KeyVault
+```
+
+```output
+Description :
+DisplayName :
+Id : /subscriptions/{subId}/providers/Microsoft.Chaos/locations/eastus/targetTypes/Microsoft-KeyVault
+Location : eastus
+Name : Microsoft-KeyVault
+PropertiesSchema : https://schema-tc.eastus.chaos-prod.azure.com/targetTypes/Microsoft-KeyVault/propertiesSchema.json
+ResourceGroupName :
+ResourceType : {Microsoft.KeyVault/vaults}
+SystemDataCreatedAt : 2024-03-08 06:57:58 PM
+SystemDataCreatedBy :
+SystemDataCreatedByType : Application
+SystemDataLastModifiedAt : 2024-03-08 06:57:58 PM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.Chaos/locations/targetTypes
+```
+
+Get a Target Type resources for given location.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosActionObject.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosActionObject.md
new file mode 100644
index 000000000000..42af000494c3
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosActionObject.md
@@ -0,0 +1,12 @@
+### Example 1: Create an in-memory object for Action.
+```powershell
+New-AzChaosActionObject -Name "urn:csci:microsoft:virtualMachine:shutdown/1.0" -Type "continuous"
+```
+
+```output
+Name Type
+---- ----
+urn:csci:microsoft:virtualMachine:shutdown/1.0 continuous
+```
+
+Create an in-memory object for Action.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosBranchObject.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosBranchObject.md
new file mode 100644
index 000000000000..90f3b7815ed1
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosBranchObject.md
@@ -0,0 +1,13 @@
+### Example 1: Create an in-memory object for Branch.
+```powershell
+$actionObj = New-AzChaosActionObject -Name "urn:csci:microsoft:virtualMachine:shutdown/1.0" -Type "continuous"
+New-AzChaosBranchObject -Action $actionObj -Name "branch1"
+```
+
+```output
+Action Name
+------ ----
+{{… branch1
+```
+
+Create an in-memory object for Branch.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosCapability.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosCapability.md
new file mode 100644
index 000000000000..2624c6868b8f
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosCapability.md
@@ -0,0 +1,25 @@
+### Example 1: Create a Capability resource that extends a Target resource.
+```powershell
+New-AzChaosCapability -Name Shutdown-1.0 -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+```
+
+```output
+Description :
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine/capabilities/Shutdown-1.0
+Name : Shutdown-1.0
+ParametersSchema : https://schema-tc.eastus.chaos-prod.azure.com/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0/parametersSchema.json
+Publisher : microsoft
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:43 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 11:35:18 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+TargetType : virtualmachine
+Type : Microsoft.Chaos/targets/capabilities
+Urn : urn:csci:microsoft:virtualMachine:shutdown/1.0
+```
+
+Create a Capability resource that extends a Target resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosExperiment.md
new file mode 100644
index 000000000000..1b5532d947b8
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosExperiment.md
@@ -0,0 +1,169 @@
+### Example 1: Create Or Update a Experiment resource for Json File Path.
+```powershell
+New-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -JsonFilePath "C:\Users\abc\Desktop\jsonStr.json"
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
+IdentityPrincipalId : 72f14040-8265-4f10-b5ea-377c6fc2671c
+IdentityTenantId : 72f988bf-86f1-41af-91ab-2d7cd011db47
+IdentityType : SystemAssigned
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : EXPERIMENT-TEST
+ProvisioningState : Succeeded
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "selector1",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
+ ft.Chaos/targets/Microsoft-VirtualMachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "step1",
+ "branches": [
+ {
+ "name": "branch1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "selector1"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-04-10 10:28:10 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-04-10 10:32:47 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+Create Or Update a Experiment resource for Json File Path.
+
+### Example 2: Create Or Update a Experiment resource for Json String.
+```powershell
+$jsonStr = '
+{
+ "location": "eastus",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "steps": [
+ {
+ "name": "step1",
+ "branches": [
+ {
+ "name": "branch1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "selectorId": "selector1",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "selectors": [
+ {
+ "type": "List",
+ "id": "selector1",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/azpstest1/providers/Microsoft.Chaos/targets/microsoft-virtualmachine"
+ }
+ ]
+ }
+ ]
+ }
+}'
+
+New-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -JsonString $jsonStr
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
+IdentityPrincipalId : 72f14040-8265-4f10-b5ea-377c6fc2671c
+IdentityTenantId : 72f988bf-86f1-41af-91ab-2d7cd011db47
+IdentityType : SystemAssigned
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : EXPERIMENT-TEST
+ProvisioningState : Succeeded
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "selector1",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
+ ft.Chaos/targets/Microsoft-VirtualMachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "step1",
+ "branches": [
+ {
+ "name": "branch1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "selector1"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-04-10 10:28:10 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-04-10 10:32:47 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+Create Or Update a Experiment resource for Json String.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosSelectorObject.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosSelectorObject.md
new file mode 100644
index 000000000000..84efb8b982f6
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosSelectorObject.md
@@ -0,0 +1,19 @@
+### Example 1: Create an in-memory object for Selector.
+```powershell
+New-AzChaosSelectorObject -Id "selector1" -Type List
+```
+
+```output
+Filter : {
+ "type": "Simple"
+ }
+FilterType : Simple
+Id : selector1
+Type : List
+Keys : {}
+Values : {}
+Count : 0
+AdditionalProperties : {}
+```
+
+Create an in-memory object for Selector.
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosStepObject.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosStepObject.md
new file mode 100644
index 000000000000..3154b461a456
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosStepObject.md
@@ -0,0 +1,14 @@
+### Example 1: Create an in-memory object for Step.
+```powershell
+$actionObj = New-AzChaosActionObject -Name "urn:csci:microsoft:virtualMachine:shutdown/1.0" -Type "continuous"
+$branchObj = New-AzChaosBranchObject -Action $actionObj -Name "branch1"
+New-AzChaosStepObject -Branch $branchObj -Name "step1"
+```
+
+```output
+Branch Name
+------ ----
+{{… step1
+```
+
+Create an in-memory object for Step.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/New-AzChaosTarget.md b/src/Chaos/Chaos.Autorest/examples/New-AzChaosTarget.md
new file mode 100644
index 000000000000..58ef48e68630
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/New-AzChaosTarget.md
@@ -0,0 +1,26 @@
+### Example 1: Create a Target resource that extends a tracked regional resource.
+```powershell
+$property = @{"type"="CertificateSubjectIssuer";"subject"="CN=example.subject"}
+$propertyArr = @($property)
+$identities = @{"identities"=$propertyArr}
+New-AzChaosTarget -Name microsoft-virtualmachine -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -Location eastus -Property $identities
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine
+Location : eastus
+Name : microsoft-virtualmachine
+Property : {
+ }
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-26 06:43:28 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-26 07:26:26 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.Chaos/targets
+```
+
+Create a Target resource that extends a tracked regional resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosCapability.md b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosCapability.md
new file mode 100644
index 000000000000..922eb223e44d
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosCapability.md
@@ -0,0 +1,6 @@
+### Example 1: Delete a Capability that extends a Target resource.
+```powershell
+Remove-AzChaosCapability -Name Shutdown-1.0 -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+```
+
+Delete a Capability that extends a Target resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosExperiment.md
new file mode 100644
index 000000000000..7c43f3d72be9
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosExperiment.md
@@ -0,0 +1,6 @@
+### Example 1: Delete a Experiment resource.
+```powershell
+Remove-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos
+```
+
+Delete a Experiment resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosTarget.md b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosTarget.md
new file mode 100644
index 000000000000..f8e341536716
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Remove-AzChaosTarget.md
@@ -0,0 +1,6 @@
+### Example 1: Delete a Target resource that extends a tracked regional resource.
+```powershell
+Remove-AzChaosTarget -Name microsoft-virtualmachine -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos
+```
+
+Delete a Target resource that extends a tracked regional resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Start-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/Start-AzChaosExperiment.md
new file mode 100644
index 000000000000..21aaa4749d49
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Start-AzChaosExperiment.md
@@ -0,0 +1,32 @@
+### Example 1: Start a Experiment resource.
+```powershell
+Start-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos
+```
+
+```output
+Id :
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType :
+IdentityUserAssignedIdentity : {
+ }
+Location :
+Name : experiment-test
+ProvisioningState :
+ResourceGroupName :
+Selector :
+Step :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type :
+```
+
+Start a Experiment resource.
+Give experiment permission to your VM
+https://learn.microsoft.com/en-us/azure/chaos-studio/chaos-studio-quickstart-azure-portal#give-experiment-permission-to-your-vm
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Stop-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/Stop-AzChaosExperiment.md
new file mode 100644
index 000000000000..0cc69bda3694
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Stop-AzChaosExperiment.md
@@ -0,0 +1,30 @@
+### Example 1: Cancel a running Experiment resource.
+```powershell
+Stop-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos
+```
+
+```output
+Id :
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType :
+IdentityUserAssignedIdentity : {
+ }
+Location :
+Name : EXPERIMENT-TEST
+ProvisioningState :
+ResourceGroupName :
+Selector :
+Step :
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type :
+```
+
+Cancel a running Experiment resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Update-AzChaosCapability.md b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosCapability.md
new file mode 100644
index 000000000000..15ad62304017
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosCapability.md
@@ -0,0 +1,25 @@
+### Example 1: Create a Capability resource that extends a Target resource.
+```powershell
+Update-AzChaosCapability -Name Shutdown-1.0 -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+```
+
+```output
+Description :
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine/capabilities/Shutdown-1.0
+Name : Shutdown-1.0
+ParametersSchema : https://schema-tc.eastus.chaos-prod.azure.com/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0/parametersSchema.json
+Publisher : microsoft
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:43 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 11:35:18 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+TargetType : virtualmachine
+Type : Microsoft.Chaos/targets/capabilities
+Urn : urn:csci:microsoft:virtualMachine:shutdown/1.0
+```
+
+Create a Capability resource that extends a Target resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Update-AzChaosExperiment.md b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosExperiment.md
new file mode 100644
index 000000000000..bcdca3d2db5e
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosExperiment.md
@@ -0,0 +1,125 @@
+### Example 1: Update a Experiment resource Tag.
+```powershell
+Update-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -Location eastus -Tag @{"a"="1"}
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
+IdentityPrincipalId : 72f14040-8265-4f10-b5ea-377c6fc2671c
+IdentityTenantId : 72f988bf-86f1-41af-91ab-2d7cd011db47
+IdentityType : SystemAssigned
+IdentityUserAssignedIdentity : {
+ }
+Location : eastus
+Name : EXPERIMENT-TEST
+ProvisioningState : Succeeded
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "selector1",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
+ ft.Chaos/targets/Microsoft-VirtualMachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "step1",
+ "branches": [
+ {
+ "name": "branch1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT10M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "selector1"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-04-10 10:28:10 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-04-10 10:50:21 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+Update a Experiment resource Tag.
+
+### Example 1: Update a Experiment resource IdentityType.
+```powershell
+Update-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -Location eastus -UserAssignedIdentity "/subscriptions/{subId}/resourcegroups/azps_test_group_chaos/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami" -EnableSystemAssignedIdentity:$false
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
+IdentityPrincipalId :
+IdentityTenantId :
+IdentityType : UserAssigned
+IdentityUserAssignedIdentity : {
+ "/subscriptions/{subId}/resourcegroups/azps_test_group_chaos/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami": {
+ }
+ }
+Location : eastus
+Name : EXPERIMENT-TEST
+ProvisioningState : Succeeded
+ResourceGroupName : azps_test_group_chaos
+Selector : {{
+ "type": "List",
+ "id": "selector1",
+ "targets": [
+ {
+ "type": "ChaosTarget",
+ "id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
+ ft.Chaos/targets/microsoft-virtualmachine"
+ }
+ ]
+ }}
+Step : {{
+ "name": "step1",
+ "branches": [
+ {
+ "name": "branch1",
+ "actions": [
+ {
+ "type": "continuous",
+ "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
+ "duration": "PT5M",
+ "parameters": [
+ {
+ "key": "abruptShutdown",
+ "value": "false"
+ }
+ ],
+ "selectorId": "selector1"
+ }
+ ]
+ }
+ ]
+ }}
+SystemDataCreatedAt : 2024-04-17 03:14:43 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-04-17 03:20:23 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : {
+ }
+Type : Microsoft.Chaos/experiments
+```
+
+Update a Experiment resource IdentityType.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/examples/Update-AzChaosTarget.md b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosTarget.md
new file mode 100644
index 000000000000..0e0b6ff3c5b2
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/examples/Update-AzChaosTarget.md
@@ -0,0 +1,26 @@
+### Example 1: Create a Target resource that extends a tracked regional resource.
+```powershell
+$property = @{"type"="CertificateSubjectIssuer";"subject"="CN=example.subject"}
+$propertyArr = @($property)
+$identities = @{"identities"=$propertyArr}
+Update-AzChaosTarget -Name microsoft-virtualmachine -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -Location eastus -Property $identities
+```
+
+```output
+Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/
+ microsoft-virtualmachine
+Location : eastus
+Name : microsoft-virtualmachine
+Property : {
+ }
+ResourceGroupName : azps_test_group_chaos
+SystemDataCreatedAt : 2024-03-18 10:28:42 AM
+SystemDataCreatedBy :
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 2024-03-18 11:51:08 AM
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Type : Microsoft.Chaos/targets
+```
+
+Create a Target resource that extends a tracked regional resource.
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/export-surface.ps1 b/src/Chaos/Chaos.Autorest/export-surface.ps1
new file mode 100644
index 000000000000..3788d76a571f
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Chaos.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.Chaos'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapability.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapability.ps1
new file mode 100644
index 000000000000..f9af38431554
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapability.ps1
@@ -0,0 +1,282 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Capability resource that extends a Target resource.
+.Description
+Get a Capability resource that extends a Target resource.
+.Example
+Get-AzChaosCapability -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+.Example
+Get-AzChaosCapability -Name Shutdown-1.0 -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -TargetName microsoft-virtualmachine
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ICapability
+.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
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+TARGETINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaoscapability
+#>
+function Get-AzChaosCapability {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ICapability])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityTarget', Mandatory)]
+ [Alias('CapabilityName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Capability resource name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource provider namespace.
+ ${ParentProviderNamespace},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource name.
+ ${ParentResourceName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource type.
+ ${ParentResourceType},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents an Azure resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Target resource name.
+ ${TargetName},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityTarget', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${TargetInputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Query')]
+ [System.String]
+ # String that sets the continuation token.
+ ${ContinuationToken},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Chaos.private\Get-AzChaosCapability_Get';
+ GetViaIdentity = 'Az.Chaos.private\Get-AzChaosCapability_GetViaIdentity';
+ GetViaIdentityTarget = 'Az.Chaos.private\Get-AzChaosCapability_GetViaIdentityTarget';
+ List = 'Az.Chaos.private\Get-AzChaosCapability_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapabilityType.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapabilityType.ps1
new file mode 100644
index 000000000000..5b25de200867
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosCapabilityType.ps1
@@ -0,0 +1,287 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Capability Type resource for given Target Type and location.
+.Description
+Get a Capability Type resource for given Target Type and location.
+.Example
+Get-AzChaosCapabilityType -LocationName eastus -TargetTypeName microsoft-virtualmachine
+.Example
+Get-AzChaosCapabilityType -LocationName eastus -TargetTypeName microsoft-virtualmachine -Name Shutdown-1.0
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ICapabilityType
+.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
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+LOCATIONINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+TARGETTYPEINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaoscapabilitytype
+#>
+function Get-AzChaosCapabilityType {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ICapabilityType])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Location resource name.
+ ${LocationName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityTargetType', Mandatory)]
+ [Alias('CapabilityTypeName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Capability Type resource name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Target Type resource name.
+ ${TargetTypeName},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${LocationInputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityTargetType', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${TargetTypeInputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Query')]
+ [System.String]
+ # String that sets the continuation token.
+ ${ContinuationToken},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Chaos.private\Get-AzChaosCapabilityType_Get';
+ GetViaIdentity = 'Az.Chaos.private\Get-AzChaosCapabilityType_GetViaIdentity';
+ GetViaIdentityLocation = 'Az.Chaos.private\Get-AzChaosCapabilityType_GetViaIdentityLocation';
+ GetViaIdentityTargetType = 'Az.Chaos.private\Get-AzChaosCapabilityType_GetViaIdentityTargetType';
+ List = 'Az.Chaos.private\Get-AzChaosCapabilityType_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExecutionExperimentDetail.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExecutionExperimentDetail.ps1
new file mode 100644
index 000000000000..0648255bb877
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExecutionExperimentDetail.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
+Execution details of an experiment resource.
+.Description
+Execution details of an experiment resource.
+.Example
+Get-AzChaosExecutionExperimentDetail -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos -ExecutionId 13E31E28-45F4-402E-99B4-DF19A78E457E
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperimentExecutionDetails
+.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.
+
+EXPERIMENTINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+INPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexecutionexperimentdetail
+#>
+function Get-AzChaosExecutionExperimentDetail {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperimentExecutionDetails])]
+[CmdletBinding(DefaultParameterSetName='Execution', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Execution', Mandatory)]
+ [Parameter(ParameterSetName='ExecutionViaIdentityExperiment', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # GUID that represents a Experiment execution detail.
+ ${ExecutionId},
+
+ [Parameter(ParameterSetName='Execution', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Experiment resource name.
+ ${ExperimentName},
+
+ [Parameter(ParameterSetName='Execution', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents an Azure resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Execution')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ExecutionViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='ExecutionViaIdentityExperiment', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${ExperimentInputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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 = @{
+ Execution = 'Az.Chaos.private\Get-AzChaosExecutionExperimentDetail_Execution';
+ ExecutionViaIdentity = 'Az.Chaos.private\Get-AzChaosExecutionExperimentDetail_ExecutionViaIdentity';
+ ExecutionViaIdentityExperiment = 'Az.Chaos.private\Get-AzChaosExecutionExperimentDetail_ExecutionViaIdentityExperiment';
+ }
+ if (('Execution') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperiment.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperiment.ps1
new file mode 100644
index 000000000000..f99ffa1ebe13
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperiment.ps1
@@ -0,0 +1,242 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Experiment resource.
+.Description
+Get a Experiment resource.
+.Example
+Get-AzChaosExperiment
+.Example
+Get-AzChaosExperiment -ResourceGroupName azps_test_group_chaos
+.Example
+Get-AzChaosExperiment -ResourceGroupName azps_test_group_chaos -Name experiment-test
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperiment
+.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
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexperiment
+#>
+function Get-AzChaosExperiment {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperiment])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('ExperimentName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Experiment resource name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents an Azure resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Query')]
+ [System.String]
+ # String that sets the continuation token.
+ ${ContinuationToken},
+
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Query')]
+ [System.Management.Automation.SwitchParameter]
+ # Optional value that indicates whether to filter results based on if the Experiment is currently running.
+ # If null, then the results will not be filtered.
+ ${Running},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Chaos.private\Get-AzChaosExperiment_Get';
+ GetViaIdentity = 'Az.Chaos.private\Get-AzChaosExperiment_GetViaIdentity';
+ List = 'Az.Chaos.private\Get-AzChaosExperiment_List';
+ List1 = 'Az.Chaos.private\Get-AzChaosExperiment_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperimentExecution.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperimentExecution.ps1
new file mode 100644
index 000000000000..dda6e3b404c5
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosExperimentExecution.ps1
@@ -0,0 +1,254 @@
+
+# ----------------------------------------------------------------------------------
+# 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 an execution of an Experiment resource.
+.Description
+Get an execution of an Experiment resource.
+.Example
+Get-AzChaosExperimentExecution -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos
+.Example
+Get-AzChaosExperimentExecution -ExperimentName experiment-test -ResourceGroupName azps_test_group_chaos -ExecutionId 13E31E28-45F4-402E-99B4-DF19A78E457E
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperimentExecution
+.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.
+
+EXPERIMENTINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+INPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexperimentexecution
+#>
+function Get-AzChaosExperimentExecution {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IExperimentExecution])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='GetViaIdentityExperiment', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # GUID that represents a Experiment execution detail.
+ ${ExecutionId},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Experiment resource name.
+ ${ExperimentName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents an Azure resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GetViaIdentityExperiment', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${ExperimentInputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Chaos.private\Get-AzChaosExperimentExecution_Get';
+ GetViaIdentity = 'Az.Chaos.private\Get-AzChaosExperimentExecution_GetViaIdentity';
+ GetViaIdentityExperiment = 'Az.Chaos.private\Get-AzChaosExperimentExecution_GetViaIdentityExperiment';
+ List = 'Az.Chaos.private\Get-AzChaosExperimentExecution_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTarget.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTarget.ps1
new file mode 100644
index 000000000000..fa3c682ad7a5
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTarget.ps1
@@ -0,0 +1,250 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Target resource that extends a tracked regional resource.
+.Description
+Get a Target resource that extends a tracked regional resource.
+.Example
+Get-AzChaosTarget -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos
+.Example
+Get-AzChaosTarget -ParentProviderNamespace Microsoft.Compute -ParentResourceName exampleVM -ParentResourceType virtualMachines -ResourceGroupName azps_test_group_chaos -Name microsoft-virtualmachine
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ITarget
+.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
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+.Link
+https://learn.microsoft.com/powershell/module/az.chaos/get-azchaostarget
+#>
+function Get-AzChaosTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ITarget])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('TargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a Target resource name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource provider namespace.
+ ${ParentProviderNamespace},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource name.
+ ${ParentResourceName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents a resource type.
+ ${ParentResourceType},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [System.String]
+ # String that represents an Azure resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # GUID that represents an Azure subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity]
+ # Identity Parameter
+ ${InputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Query')]
+ [System.String]
+ # String that sets the continuation token.
+ ${ContinuationToken},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Chaos.private\Get-AzChaosTarget_Get';
+ GetViaIdentity = 'Az.Chaos.private\Get-AzChaosTarget_GetViaIdentity';
+ List = 'Az.Chaos.private\Get-AzChaosTarget_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if ($testPlayback) {
+ $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
+ } else {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.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.Chaos.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Chaos.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTargetType.ps1 b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTargetType.ps1
new file mode 100644
index 000000000000..7c39fdbdd7e4
--- /dev/null
+++ b/src/Chaos/Chaos.Autorest/exports/Get-AzChaosTargetType.ps1
@@ -0,0 +1,254 @@
+
+# ----------------------------------------------------------------------------------
+# 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 Target Type resources for given location.
+.Description
+Get a Target Type resources for given location.
+.Example
+Get-AzChaosTargetType -LocationName eastus
+.Example
+Get-AzChaosTargetType -LocationName eastus -Name Microsoft-KeyVault
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.IChaosIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Chaos.Models.ITargetType
+.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
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace ]: String that represents a resource provider namespace.
+ [ParentResourceName ]: String that represents a resource name.
+ [ParentResourceType ]: String that represents a resource type.
+ [ResourceGroupName ]: String that represents an Azure resource group.
+ [SubscriptionId ]: GUID that represents an Azure subscription ID.
+ [TargetName ]: String that represents a Target resource name.
+ [TargetTypeName ]: String that represents a Target Type resource name.
+
+LOCATIONINPUTOBJECT : Identity Parameter
+ [AsyncOperationId ]: The operation Id.
+ [CapabilityName ]: String that represents a Capability resource name.
+ [CapabilityTypeName ]: String that represents a Capability Type resource name.
+ [ExecutionId ]: GUID that represents a Experiment execution detail.
+ [ExperimentName ]: String that represents a Experiment resource name.
+ [Id ]: Resource identity path
+ [Location ]: The name of the Azure region.
+ [LocationName ]: String that represents a Location resource name.
+ [ParentProviderNamespace