diff --git a/src/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psm1 b/src/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psm1 index 950181bbced9..27646b11f190 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psm1 +++ b/src/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psm1 @@ -33,7 +33,7 @@ } 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 + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.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 } diff --git a/src/Monitor/ActivityLogAlert.Autorest/custom/README.md b/src/Monitor/ActivityLogAlert.Autorest/custom/README.md index c31c62ba30af..e364c3cdfbac 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/custom/README.md +++ b/src/Monitor/ActivityLogAlert.Autorest/custom/README.md @@ -32,7 +32,7 @@ These provide functionality to our HTTP pipeline and other useful features. In s ### Attributes For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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. + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ActivityLogAlert`. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExportAttribute` diff --git a/src/Monitor/ActivityLogAlert.Autorest/docs/README.md b/src/Monitor/ActivityLogAlert.Autorest/docs/README.md index 71697e9d4b58..602604288a67 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/docs/README.md +++ b/src/Monitor/ActivityLogAlert.Autorest/docs/README.md @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.ActivityLog - Packaged: yes ## Details -The process of documentation generation loads `Az.ActivityLogAlert` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.ActivityLogAlert` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Monitor/ActivityLogAlert.Autorest/exports/README.md b/src/Monitor/ActivityLogAlert.Autorest/exports/README.md index 766913d2b0e7..b5acd25a1c18 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/exports/README.md +++ b/src/Monitor/ActivityLogAlert.Autorest/exports/README.md @@ -1,5 +1,5 @@ # Exports -This directory contains the cmdlets *exported by* `Az.ActivityLogAlert`. No other cmdlets in this repository are directly exported. What that means is the `Az.ActivityLogAlert` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. +This directory contains the cmdlets *exported by* `Az.ActivityLogAlert`. No other cmdlets in this repository are directly exported. What that means is the `Az.ActivityLogAlert` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. ## Info - Modifiable: no diff --git a/src/Monitor/ActivityLogAlert.Autorest/generate-info.json b/src/Monitor/ActivityLogAlert.Autorest/generate-info.json index 65aaa71af279..16a04b830e8c 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/generate-info.json +++ b/src/Monitor/ActivityLogAlert.Autorest/generate-info.json @@ -1,8 +1,8 @@ { "autorest_powershell": "3.0.498", - "autorest": "`-- (empty)", - "autorest_core": "3.9.3", "autorest_modelerfour": "4.15.414", - "swagger_commit": "9842de8f8f11c09511fc00e903eb947f76cba0e6", - "node": "v14.15.5" + "node": "v14.15.5", + "swagger_commit": "d1eb4e42e24016044e150c0fb8f0dc6c1182b5f5", + "autorest_core": "3.9.4", + "autorest": "`-- (empty)" } diff --git a/src/Monitor/ActivityLogAlert.Autorest/how-to.md b/src/Monitor/ActivityLogAlert.Autorest/how-to.md index 4eb707058e6c..9f2ccf7d33b7 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/how-to.md +++ b/src/Monitor/ActivityLogAlert.Autorest/how-to.md @@ -14,7 +14,7 @@ To generate documentation, the process is now integrated into the `build-module. To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. ## Packing `Az.ActivityLogAlert` -To pack `Az.ActivityLogAlert` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. +To pack `Az.ActivityLogAlert` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. ## Module Script Details There are multiple scripts created for performing different actions for developing `Az.ActivityLogAlert`. diff --git a/src/Monitor/ActivityLogAlert.Autorest/internal/README.md b/src/Monitor/ActivityLogAlert.Autorest/internal/README.md index c77dd47448fe..79059f1cab15 100644 --- a/src/Monitor/ActivityLogAlert.Autorest/internal/README.md +++ b/src/Monitor/ActivityLogAlert.Autorest/internal/README.md @@ -8,7 +8,7 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that - Packaged: yes ## Details -The `Az.ActivityLogAlert.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ActivityLogAlert`. Instead, this sub-module is imported by the `..\custom\Az.ActivityLogAlert.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ActivityLogAlert.internal\Get-Example` would call an internal cmdlet named `Get-Example`. +The `Az.ActivityLogAlert.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ActivityLogAlert`. Instead, this sub-module is imported by the `..\custom\Az.ActivityLogAlert.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ActivityLogAlert.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ActivityLogAlert`. diff --git a/src/Monitor/Autoscale.Autorest/Az.Autoscale.psm1 b/src/Monitor/Autoscale.Autorest/Az.Autoscale.psm1 index 203f57259515..19fb8092953f 100644 --- a/src/Monitor/Autoscale.Autorest/Az.Autoscale.psm1 +++ b/src/Monitor/Autoscale.Autorest/Az.Autoscale.psm1 @@ -33,7 +33,7 @@ } 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 + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.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 } diff --git a/src/Monitor/Autoscale.Autorest/README.md b/src/Monitor/Autoscale.Autorest/README.md index b14c58819b3e..66456be4297c 100644 --- a/src/Monitor/Autoscale.Autorest/README.md +++ b/src/Monitor/Autoscale.Autorest/README.md @@ -74,6 +74,30 @@ directive: where: $ transform: $ = $.replace('public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Equals = @"Equals";', 'public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Equal = @"Equals";'); + - from: swagger-document + where: $.definitions.TimeWindow + transform: >- + return { + "type": "object", + "properties": { + "timeZone": { + "type": "string", + "description": "the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time" + }, + "start": { + "type": "string", + "format": "date-time", + "description": "the start time for the profile in ISO 8601 format." + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the end time for the profile in ISO 8601 format." + } + }, + "description": "A specific date-time for the profile." + } + - model-cmdlet: - AutoscaleProfile - ScaleRule diff --git a/src/Monitor/Autoscale.Autorest/custom/README.md b/src/Monitor/Autoscale.Autorest/custom/README.md index 463c868c0255..c7406b114cda 100644 --- a/src/Monitor/Autoscale.Autorest/custom/README.md +++ b/src/Monitor/Autoscale.Autorest/custom/README.md @@ -32,7 +32,7 @@ These provide functionality to our HTTP pipeline and other useful features. In s ### Attributes For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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. + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Autoscale`. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.InternalExportAttribute` diff --git a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleProfileObject.md b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleProfileObject.md index 2235907cd6ab..56287dd1963d 100644 --- a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleProfileObject.md +++ b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleProfileObject.md @@ -26,7 +26,7 @@ Create an in-memory object for AutoscaleProfile. ### Example 1: Create autoscale profile object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" ``` diff --git a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleScaleRuleObject.md b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleScaleRuleObject.md index 8d2dc2de8cbf..e4b772420349 100644 --- a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleScaleRuleObject.md +++ b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleScaleRuleObject.md @@ -30,7 +30,7 @@ Create an in-memory object for ScaleRule. ### Example 1: Create scale rule object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) ``` diff --git a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md index 1b599061a514..040374ce436b 100644 --- a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md +++ b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md @@ -35,7 +35,7 @@ Creates or updates an autoscale setting. ### Example 1: Create autoscale setting for vmss ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" diff --git a/src/Monitor/Autoscale.Autorest/docs/README.md b/src/Monitor/Autoscale.Autorest/docs/README.md index fcd45ce243d7..8dbefe559d9a 100644 --- a/src/Monitor/Autoscale.Autorest/docs/README.md +++ b/src/Monitor/Autoscale.Autorest/docs/README.md @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Autoscale` - Packaged: yes ## Details -The process of documentation generation loads `Az.Autoscale` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.Autoscale` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md index 80c20a3727e5..46bcb62a92dd 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md @@ -1,6 +1,6 @@ ### Example 1: Create autoscale profile object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" ``` diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md index 540c53fe76e5..5c0814ba9159 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md @@ -1,6 +1,6 @@ ### Example 1: Create scale rule object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) ``` diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md index dc6a06ac8c18..594731eddc81 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md @@ -1,6 +1,6 @@ ### Example 1: Create autoscale setting for vmss ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" diff --git a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 index 78d568711c62..914118040ea2 100644 --- a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 +++ b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 @@ -20,7 +20,7 @@ Create an in-memory object for AutoscaleProfile. .Description Create an in-memory object for AutoscaleProfile. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" diff --git a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 index 67461e3cc989..6a7444e9ddec 100644 --- a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 +++ b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 @@ -20,7 +20,7 @@ Create an in-memory object for ScaleRule. .Description Create an in-memory object for ScaleRule. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) .Outputs diff --git a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 index d1bc1793d944..514226c7dde8 100644 --- a/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 +++ b/src/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 @@ -20,7 +20,7 @@ Creates or updates an autoscale setting. .Description Creates or updates an autoscale setting. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" diff --git a/src/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 index 08264375dcfa..5d2cebd91468 100644 --- a/src/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -428,7 +428,7 @@ Creates or updates an autoscale setting. .Description Creates or updates an autoscale setting. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" @@ -1116,7 +1116,7 @@ Create an in-memory object for AutoscaleProfile. .Description Create an in-memory object for AutoscaleProfile. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" @@ -1459,7 +1459,7 @@ Create an in-memory object for ScaleRule. .Description Create an in-memory object for ScaleRule. .Example -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) .Outputs diff --git a/src/Monitor/Autoscale.Autorest/exports/README.md b/src/Monitor/Autoscale.Autorest/exports/README.md index 92935c4f81e8..2a41eeda732e 100644 --- a/src/Monitor/Autoscale.Autorest/exports/README.md +++ b/src/Monitor/Autoscale.Autorest/exports/README.md @@ -1,5 +1,5 @@ # Exports -This directory contains the cmdlets *exported by* `Az.Autoscale`. No other cmdlets in this repository are directly exported. What that means is the `Az.Autoscale` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. +This directory contains the cmdlets *exported by* `Az.Autoscale`. No other cmdlets in this repository are directly exported. What that means is the `Az.Autoscale` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. ## Info - Modifiable: no diff --git a/src/Monitor/Autoscale.Autorest/generate-info.json b/src/Monitor/Autoscale.Autorest/generate-info.json index 65aaa71af279..16a04b830e8c 100644 --- a/src/Monitor/Autoscale.Autorest/generate-info.json +++ b/src/Monitor/Autoscale.Autorest/generate-info.json @@ -1,8 +1,8 @@ { "autorest_powershell": "3.0.498", - "autorest": "`-- (empty)", - "autorest_core": "3.9.3", "autorest_modelerfour": "4.15.414", - "swagger_commit": "9842de8f8f11c09511fc00e903eb947f76cba0e6", - "node": "v14.15.5" + "node": "v14.15.5", + "swagger_commit": "d1eb4e42e24016044e150c0fb8f0dc6c1182b5f5", + "autorest_core": "3.9.4", + "autorest": "`-- (empty)" } diff --git a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs index bf88cc00b0a1..1a4b3e96b14f 100644 --- a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs +++ b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs @@ -118,11 +118,11 @@ internal AutoscaleProfile(global::System.Collections.IDictionary content) } if (content.Contains("FixedDateStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("FixedDateEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("RecurrenceSchedule")) { @@ -203,11 +203,11 @@ internal AutoscaleProfile(global::System.Management.Automation.PSObject content) } if (content.Contains("FixedDateStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("FixedDateEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("RecurrenceSchedule")) { diff --git a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs index 72c5c0a0ff65..9819bcfdabf3 100644 --- a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs +++ b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs @@ -115,11 +115,11 @@ internal TimeWindow(global::System.Collections.IDictionary content) } if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } @@ -144,11 +144,11 @@ internal TimeWindow(global::System.Management.Automation.PSObject content) } if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } diff --git a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs index 421360bdc994..bc991c5909c9 100644 --- a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs +++ b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs @@ -14,18 +14,18 @@ public partial class TimeWindow : { /// Backing field for property. - private global::System.DateTime _end; + private global::System.DateTime? _end; /// the end time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public global::System.DateTime End { get => this._end; set => this._end = value; } + public global::System.DateTime? End { get => this._end; set => this._end = value; } /// Backing field for property. - private global::System.DateTime _start; + private global::System.DateTime? _start; /// the start time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public global::System.DateTime Start { get => this._start; set => this._start = value; } + public global::System.DateTime? Start { get => this._start; set => this._start = value; } /// Backing field for property. private string _timeZone; @@ -70,20 +70,20 @@ public partial interface ITimeWindow : { /// the end time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Description = @"the end time for the profile in ISO 8601 format.", SerializedName = @"end", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime End { get; set; } + global::System.DateTime? End { get; set; } /// the start time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Description = @"the start time for the profile in ISO 8601 format.", SerializedName = @"start", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime Start { get; set; } + global::System.DateTime? Start { get; set; } /// /// the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, /// UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain @@ -123,9 +123,9 @@ internal partial interface ITimeWindowInternal { /// the end time for the profile in ISO 8601 format. - global::System.DateTime End { get; set; } + global::System.DateTime? End { get; set; } /// the start time for the profile in ISO 8601 format. - global::System.DateTime Start { get; set; } + global::System.DateTime? Start { get; set; } /// /// the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, /// UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain diff --git a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs index 53d3b402cc91..d82ba156b9b4 100644 --- a/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs +++ b/src/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs @@ -103,8 +103,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNod return container; } AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._start.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "start" ,container.Add ); - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._end.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "end" ,container.Add ); + AddIf( null != this._start ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._start?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "start" ,container.Add ); + AddIf( null != this._end ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._end?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "end" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/src/Monitor/Autoscale.Autorest/how-to.md b/src/Monitor/Autoscale.Autorest/how-to.md index f73ba9264cc1..b00995e5ca6f 100644 --- a/src/Monitor/Autoscale.Autorest/how-to.md +++ b/src/Monitor/Autoscale.Autorest/how-to.md @@ -14,7 +14,7 @@ To generate documentation, the process is now integrated into the `build-module. To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. ## Packing `Az.Autoscale` -To pack `Az.Autoscale` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. +To pack `Az.Autoscale` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. ## Module Script Details There are multiple scripts created for performing different actions for developing `Az.Autoscale`. diff --git a/src/Monitor/Autoscale.Autorest/internal/README.md b/src/Monitor/Autoscale.Autorest/internal/README.md index 0ed8d63531ee..d01e2b233d85 100644 --- a/src/Monitor/Autoscale.Autorest/internal/README.md +++ b/src/Monitor/Autoscale.Autorest/internal/README.md @@ -8,7 +8,7 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that - Packaged: yes ## Details -The `Az.Autoscale.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Autoscale`. Instead, this sub-module is imported by the `..\custom\Az.Autoscale.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Autoscale.internal\Get-Example` would call an internal cmdlet named `Get-Example`. +The `Az.Autoscale.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Autoscale`. Instead, this sub-module is imported by the `..\custom\Az.Autoscale.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Autoscale.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Autoscale`. diff --git a/src/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psm1 b/src/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psm1 index 8c0fd2ea9e66..d4cf4aa75e47 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psm1 +++ b/src/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psm1 @@ -33,7 +33,7 @@ } 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 + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.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 } diff --git a/src/Monitor/DiagnosticSetting.Autorest/custom/README.md b/src/Monitor/DiagnosticSetting.Autorest/custom/README.md index cf0e8deae9b1..295781bd3d3a 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/custom/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/custom/README.md @@ -32,7 +32,7 @@ These provide functionality to our HTTP pipeline and other useful features. In s ### Attributes For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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. + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.DiagnosticSetting`. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.InternalExportAttribute` diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/README.md b/src/Monitor/DiagnosticSetting.Autorest/docs/README.md index 9a292183c5ad..ac49626f6b4d 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/README.md @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.DiagnosticS - Packaged: yes ## Details -The process of documentation generation loads `Az.DiagnosticSetting` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.DiagnosticSetting` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Monitor/DiagnosticSetting.Autorest/exports/README.md b/src/Monitor/DiagnosticSetting.Autorest/exports/README.md index d5f8e606e985..9f7a1ebecf7d 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/exports/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/exports/README.md @@ -1,5 +1,5 @@ # Exports -This directory contains the cmdlets *exported by* `Az.DiagnosticSetting`. No other cmdlets in this repository are directly exported. What that means is the `Az.DiagnosticSetting` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. +This directory contains the cmdlets *exported by* `Az.DiagnosticSetting`. No other cmdlets in this repository are directly exported. What that means is the `Az.DiagnosticSetting` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. ## Info - Modifiable: no diff --git a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json index 65aaa71af279..16a04b830e8c 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json +++ b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json @@ -1,8 +1,8 @@ { "autorest_powershell": "3.0.498", - "autorest": "`-- (empty)", - "autorest_core": "3.9.3", "autorest_modelerfour": "4.15.414", - "swagger_commit": "9842de8f8f11c09511fc00e903eb947f76cba0e6", - "node": "v14.15.5" + "node": "v14.15.5", + "swagger_commit": "d1eb4e42e24016044e150c0fb8f0dc6c1182b5f5", + "autorest_core": "3.9.4", + "autorest": "`-- (empty)" } diff --git a/src/Monitor/DiagnosticSetting.Autorest/how-to.md b/src/Monitor/DiagnosticSetting.Autorest/how-to.md index e596edea8410..02c3a154801c 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/how-to.md +++ b/src/Monitor/DiagnosticSetting.Autorest/how-to.md @@ -14,7 +14,7 @@ To generate documentation, the process is now integrated into the `build-module. To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. ## Packing `Az.DiagnosticSetting` -To pack `Az.DiagnosticSetting` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. +To pack `Az.DiagnosticSetting` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. ## Module Script Details There are multiple scripts created for performing different actions for developing `Az.DiagnosticSetting`. diff --git a/src/Monitor/DiagnosticSetting.Autorest/internal/README.md b/src/Monitor/DiagnosticSetting.Autorest/internal/README.md index 6bd5cd493a02..c1512fbb0c64 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/internal/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/internal/README.md @@ -8,7 +8,7 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that - Packaged: yes ## Details -The `Az.DiagnosticSetting.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.DiagnosticSetting`. Instead, this sub-module is imported by the `..\custom\Az.DiagnosticSetting.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.DiagnosticSetting.internal\Get-Example` would call an internal cmdlet named `Get-Example`. +The `Az.DiagnosticSetting.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.DiagnosticSetting`. Instead, this sub-module is imported by the `..\custom\Az.DiagnosticSetting.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.DiagnosticSetting.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.DiagnosticSetting`. diff --git a/src/Monitor/Monitor/Az.Monitor.psd1 b/src/Monitor/Monitor/Az.Monitor.psd1 index 15a2f5c871a7..67a0853993af 100644 --- a/src/Monitor/Monitor/Az.Monitor.psd1 +++ b/src/Monitor/Monitor/Az.Monitor.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 1/6/2023 +# Generated on: 2/3/2023 # @{ @@ -154,7 +154,7 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','Monitor' + Tags = 'Azure', 'ResourceManager', 'ARM', 'Monitor' # A URL to the license for this module. LicenseUri = 'https://aka.ms/azps-license' @@ -182,7 +182,7 @@ PrivateData = @{ } # End of PSData hashtable - } # End of PrivateData hashtable +} # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' diff --git a/src/Monitor/Monitor/ChangeLog.md b/src/Monitor/Monitor/ChangeLog.md index 1cbfcd33c400..4a125e0d2eb4 100644 --- a/src/Monitor/Monitor/ChangeLog.md +++ b/src/Monitor/Monitor/ChangeLog.md @@ -19,6 +19,9 @@ --> ## Upcoming Release +* Removed default value for time window for autoscale profile [#20660] + * `Get-AzAutoscaleSetting` + * `New-AzAutoscaleSetting` ## Version 4.4.0 * Fixed bug for `Remove-AzDataCollectionRuleAssociation` [#20207] diff --git a/src/Monitor/Monitor/help/Az.Monitor.md b/src/Monitor/Monitor/help/Az.Monitor.md index c73c02209da7..27554fbd76e4 100644 --- a/src/Monitor/Monitor/help/Az.Monitor.md +++ b/src/Monitor/Monitor/help/Az.Monitor.md @@ -217,6 +217,9 @@ Creates a new or updates an existing action group. ### [Set-AzDataCollectionRule](Set-AzDataCollectionRule.md) Updates (full replacement) a data collection rule. +### [Test-AzActionGroup](Test-AzActionGroup.md) +Sends test notifications + ### [Update-AzActivityLogAlert](Update-AzActivityLogAlert.md) Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. diff --git a/src/Monitor/Monitor/help/New-AzAutoscaleProfileObject.md b/src/Monitor/Monitor/help/New-AzAutoscaleProfileObject.md index 922499e8550d..553f7fb3282b 100644 --- a/src/Monitor/Monitor/help/New-AzAutoscaleProfileObject.md +++ b/src/Monitor/Monitor/help/New-AzAutoscaleProfileObject.md @@ -26,7 +26,7 @@ Create an in-memory object for AutoscaleProfile. ### Example 1: Create autoscale profile object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" ``` diff --git a/src/Monitor/Monitor/help/New-AzAutoscaleScaleRuleObject.md b/src/Monitor/Monitor/help/New-AzAutoscaleScaleRuleObject.md index 3daba1089052..af056c830d18 100644 --- a/src/Monitor/Monitor/help/New-AzAutoscaleScaleRuleObject.md +++ b/src/Monitor/Monitor/help/New-AzAutoscaleScaleRuleObject.md @@ -30,7 +30,7 @@ Create an in-memory object for ScaleRule. ### Example 1: Create scale rule object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) ``` diff --git a/src/Monitor/Monitor/help/New-AzAutoscaleSetting.md b/src/Monitor/Monitor/help/New-AzAutoscaleSetting.md index 9fcdefe43a98..e32a6647b475 100644 --- a/src/Monitor/Monitor/help/New-AzAutoscaleSetting.md +++ b/src/Monitor/Monitor/help/New-AzAutoscaleSetting.md @@ -35,7 +35,7 @@ Creates or updates an autoscale setting. ### Example 1: Create autoscale setting for vmss ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" diff --git a/src/Monitor/Monitor/help/Test-AzActionGroup.md b/src/Monitor/Monitor/help/Test-AzActionGroup.md index be849cf47485..abcc6656d474 100644 --- a/src/Monitor/Monitor/help/Test-AzActionGroup.md +++ b/src/Monitor/Monitor/help/Test-AzActionGroup.md @@ -12,7 +12,6 @@ Sends test notifications ## SYNTAX -### ByPropertyName (Default) ``` Test-AzActionGroup -AlertType -ResourceGroupName -ActionGroupName -Receiver @@ -41,8 +40,24 @@ Default value: None Accept pipeline input: False Accept wildcard characters: False ``` + ## PARAMETERS +### -ActionGroupName +The required action group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AlertType The required alert type name. The supported values are: servicehealth, metricstaticthreshold, metricsdynamicthreshold, logalertv2, smartalert, webtestalert, logalertv1numresult, logalertv1metricmeasurement, activitylog, resourcehealth, budget, actualcostbudget, forecastedbudget @@ -104,21 +119,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ActionGroupName -The required action group name - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psm1 b/src/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psm1 index de0b8a49b2aa..a9daef4aa9b3 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psm1 +++ b/src/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psm1 @@ -33,7 +33,7 @@ } 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 + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.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 } diff --git a/src/Monitor/ScheduledQueryRule.Autorest/custom/README.md b/src/Monitor/ScheduledQueryRule.Autorest/custom/README.md index 761d8b447a7f..65891d780956 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/custom/README.md +++ b/src/Monitor/ScheduledQueryRule.Autorest/custom/README.md @@ -32,7 +32,7 @@ These provide functionality to our HTTP pipeline and other useful features. In s ### Attributes For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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. + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ScheduledQueryRule`. - `Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.InternalExportAttribute` diff --git a/src/Monitor/ScheduledQueryRule.Autorest/docs/README.md b/src/Monitor/ScheduledQueryRule.Autorest/docs/README.md index 8d833ba1fb03..dbc276141fc3 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/docs/README.md +++ b/src/Monitor/ScheduledQueryRule.Autorest/docs/README.md @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.ScheduledQu - Packaged: yes ## Details -The process of documentation generation loads `Az.ScheduledQueryRule` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.ScheduledQueryRule` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Monitor/ScheduledQueryRule.Autorest/exports/README.md b/src/Monitor/ScheduledQueryRule.Autorest/exports/README.md index d2a6282c5825..1617288bd53e 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/exports/README.md +++ b/src/Monitor/ScheduledQueryRule.Autorest/exports/README.md @@ -1,5 +1,5 @@ # Exports -This directory contains the cmdlets *exported by* `Az.ScheduledQueryRule`. No other cmdlets in this repository are directly exported. What that means is the `Az.ScheduledQueryRule` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. +This directory contains the cmdlets *exported by* `Az.ScheduledQueryRule`. No other cmdlets in this repository are directly exported. What that means is the `Az.ScheduledQueryRule` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. ## Info - Modifiable: no diff --git a/src/Monitor/ScheduledQueryRule.Autorest/generate-info.json b/src/Monitor/ScheduledQueryRule.Autorest/generate-info.json index 65aaa71af279..16a04b830e8c 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/generate-info.json +++ b/src/Monitor/ScheduledQueryRule.Autorest/generate-info.json @@ -1,8 +1,8 @@ { "autorest_powershell": "3.0.498", - "autorest": "`-- (empty)", - "autorest_core": "3.9.3", "autorest_modelerfour": "4.15.414", - "swagger_commit": "9842de8f8f11c09511fc00e903eb947f76cba0e6", - "node": "v14.15.5" + "node": "v14.15.5", + "swagger_commit": "d1eb4e42e24016044e150c0fb8f0dc6c1182b5f5", + "autorest_core": "3.9.4", + "autorest": "`-- (empty)" } diff --git a/src/Monitor/ScheduledQueryRule.Autorest/how-to.md b/src/Monitor/ScheduledQueryRule.Autorest/how-to.md index fb023bbe9910..90af0430e2f7 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/how-to.md +++ b/src/Monitor/ScheduledQueryRule.Autorest/how-to.md @@ -14,7 +14,7 @@ To generate documentation, the process is now integrated into the `build-module. To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. ## Packing `Az.ScheduledQueryRule` -To pack `Az.ScheduledQueryRule` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. +To pack `Az.ScheduledQueryRule` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. ## Module Script Details There are multiple scripts created for performing different actions for developing `Az.ScheduledQueryRule`. diff --git a/src/Monitor/ScheduledQueryRule.Autorest/internal/README.md b/src/Monitor/ScheduledQueryRule.Autorest/internal/README.md index e3f7b1dab056..d3c8785d2322 100644 --- a/src/Monitor/ScheduledQueryRule.Autorest/internal/README.md +++ b/src/Monitor/ScheduledQueryRule.Autorest/internal/README.md @@ -8,7 +8,7 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that - Packaged: yes ## Details -The `Az.ScheduledQueryRule.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ScheduledQueryRule`. Instead, this sub-module is imported by the `..\custom\Az.ScheduledQueryRule.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ScheduledQueryRule.internal\Get-Example` would call an internal cmdlet named `Get-Example`. +The `Az.ScheduledQueryRule.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ScheduledQueryRule`. Instead, this sub-module is imported by the `..\custom\Az.ScheduledQueryRule.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ScheduledQueryRule.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ScheduledQueryRule`.