Skip to content

Commit 7c9b9b8

Browse files
committed
Generated Test Cases
1 parent 24e56cb commit 7c9b9b8

File tree

77 files changed

+2710
-2219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2710
-2219
lines changed

src/Workloads/Monitors.Autorest/custom/Az.Monitors.custom.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Monitors.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Monitors.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Monitors.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Monitors.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

src/Workloads/Monitors.Autorest/custom/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Custom
2-
This directory contains custom implementation for non-generated cmdlets for the `Az.Monitors` 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.Monitors.custom.psm1`. This file should not be modified.
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.Monitors` 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.Monitors.custom.psm1`. This file should not be modified.
33

44
## Info
55
- Modifiable: yes
@@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
1515
For script cmdlets, these are loaded via the `Az.Monitors.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.
1616

1717
## Purpose
18-
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.
18+
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.
1919

2020
## Usage
21-
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:
21+
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:
2222
- Break
2323
- DefaultProfile
2424
- HttpPipelineAppend
@@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
3636
- `Microsoft.Azure.PowerShell.Cmdlets.Workloads.Monitors.DoNotExportAttribute`
3737
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Monitors`.
3838
- `Microsoft.Azure.PowerShell.Cmdlets.Workloads.Monitors.InternalExportAttribute`
39-
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Monitors`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
39+
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Monitors`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
4040
- `Microsoft.Azure.PowerShell.Cmdlets.Workloads.Monitors.ProfileAttribute`
4141
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

src/Workloads/Monitors.Autorest/docs/Az.Monitors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Monitors
3-
Module Guid: c2b5aac3-3ae4-4fa4-9d6a-b7a7834ba0ba
3+
Module Guid: d805f2ff-7f5f-4e5c-aa61-59be1b0c5ad4
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.monitors
55
Help Version: 1.0.0.0
66
Locale: en-US
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Docs
2-
This directory contains the documentation of the cmdlets for the `Az.Monitors` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder.
2+
This directory contains the documentation of the cmdlets for the `Az.Monitors` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder.
33

44
## Info
55
- Modifiable: no
@@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Monitors` m
88
- Packaged: yes
99

1010
## Details
11-
The process of documentation generation loads `Az.Monitors` 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.
11+
The process of documentation generation loads `Az.Monitors` 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.

src/Workloads/Monitors.Autorest/docs/Update-AzWorkloadsMonitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Accept wildcard characters: False
115115
Determines whether to enable a system-assigned identity for the resource.
116116
117117
```yaml
118-
Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
118+
Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
119119
Parameter Sets: (All)
120120
Aliases:
121121

src/Workloads/Monitors.Autorest/docs/Update-AzWorkloadsProviderInstance.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,34 @@ Update a provider instance for the specified subscription, resource group, SAP m
4040

4141
## EXAMPLES
4242

43-
### Example 1: {{ Add title here }}
43+
### Example 1: Update an existing provider
4444
```powershell
45-
{{ Add code here }}
45+
$providerSetting = New-AzWorkloadsProviderSqlServerInstanceObject -Password '<password>' -Port 1433 -Username '<username>' -Hostname 10.1.14.5 -SapSid X00 -SslPreference Disabled
46+
$providerSetting.ProviderType | Should -Be "MsSqlServer"
47+
48+
Update-AzWorkloadsProviderInstance -MonitorName suha-0202-ams9 -Name sql-prov-1 -ResourceGroupName suha-0802-rg1 -SubscriptionId 49d64d54-e966-4c46-a868-1999802b762c -ProviderSetting $providerSetting
4649
```
4750

4851
```output
49-
{{ Add output here (remove the output block if the example doesn't have an output) }}
52+
Name ResourceGroupName ProvisioningState IdentityType
53+
---- ----------------- ----------------- ------------
54+
sql-prov-1 suha-0802-rg1 Succeeded
5055
```
5156

52-
{{ Add description here }}
57+
Update an existing provider for a specific AMS instance
5358

54-
### Example 2: {{ Add title here }}
59+
### Example 2: Update an existing provider by Id
5560
```powershell
56-
{{ Add code here }}
61+
Update-AzWorkloadsProviderInstance -MonitorName suha-160323-ams4 -Name suha-sql-3 -ResourceGroupName suha-0802-rg1 -SubscriptionId 49d64d54-e966-4c46-a868-1999802b762c -ProviderSetting '{"sslPreference":"Disabled","providerType":"MsSqlServer","hostname":"10.1.14.5","sapSid":"X00","dbPort":"1433","dbUsername":"","dbPassword":""}'
5762
```
5863

5964
```output
60-
{{ Add output here (remove the output block if the example doesn't have an output) }}
65+
Name ResourceGroupName ProvisioningState IdentityType
66+
---- ----------------- ----------------- ------------
67+
suha-sql-3 suha-0802-rg1 Succeeded
6168
```
6269

63-
{{ Add description here }}
70+
Update an existing provider for a specific AMS instance by Arm Id
6471

6572
## PARAMETERS
6673

@@ -99,7 +106,7 @@ Accept wildcard characters: False
99106
Determines whether to enable a system-assigned identity for the resource.
100107
101108
```yaml
102-
Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
109+
Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
103110
Parameter Sets: (All)
104111
Aliases:
105112

@@ -292,4 +299,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
292299
## NOTES
293300
294301
## RELATED LINKS
295-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "d8e34340-7899-4abd-b026-495b63d3c6b9"
2+
"generate_Id": "53839184-64f5-42e2-9d3e-734833eeba70"
33
}

src/Workloads/Monitors.Autorest/resources/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Resources
2-
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.
2+
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder.
33

44
## Info
55
- Modifiable: yes

src/Workloads/Monitors.Autorest/test/Get-AzWorkloadsMonitor.Recording.json

Lines changed: 63 additions & 50 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)