Skip to content

Commit 67d6122

Browse files
kalpeshbhatia000Lei Jin
andauthored
Feature firmwareanalysis fix (#24188)
* Fix documentation for firmwareanalysis ps * Regenerate FirmwareAnalysis * remove commands and some variants * update doc --------- Co-authored-by: Lei Jin <[email protected]>
1 parent a2140dd commit 67d6122

39 files changed

+169
-261
lines changed

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,21 @@ directive:
8989
verb: Set
9090
remove: true
9191

92+
- where:
93+
verb: New
94+
subject: FirmwareDownloadUrl
95+
remove: true
96+
97+
- where:
98+
verb: Get
99+
subject: Summary
100+
variant: List
101+
remove: true
102+
92103
- where:
93104
parameter-name: Id
94105
verb: New
95-
subject: AzFirmwareAnalysisFirmware
106+
subject: Firmware
96107
set:
97108
default:
98109
name: Id

src/FirmwareAnalysis/FirmwareAnalysis.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.FirmwareAnalysis` 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.FirmwareAnalysis.custom.psm1`. This file should not be modified.
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.FirmwareAnalysis` 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.FirmwareAnalysis.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.FirmwareAnalysis.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.FirmwareAnalysis.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.FirmwareAnalysis`.
3838
- `Microsoft.Azure.PowerShell.Cmdlets.FirmwareAnalysis.InternalExportAttribute`
39-
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.FirmwareAnalysis`. 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.FirmwareAnalysis`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
4040
- `Microsoft.Azure.PowerShell.Cmdlets.FirmwareAnalysis.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/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisBinaryHardening.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists binary hardening analysis results of a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the binary hardening analysis results for a firmware.}}
25+
### Example 1: List all the binary hardening analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisBinaryHardening -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json }}
27+
Get-AzFirmwareAnalysisBinaryHardening -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"Architecture": "",
@@ -53,11 +52,9 @@ Lists binary hardening analysis results of a firmware.
5352
"Type": "Microsoft.IoTFirmwareDefense/workspaces/firmwares/binaryHardeningResults"
5453
}
5554
]
56-
}}
5755
```
5856

59-
{{ List all the binary hardening analysis results for a firmware.
60-
}}
57+
List all the binary hardening analysis results for a firmware.
6158

6259
## PARAMETERS
6360

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisCryptoCertificate.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists cryptographic certificate analysis results found in a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the crypto certificate analysis results for a firmware. }}
25+
### Example 1: List all the crypto certificate analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisCryptoCertificate -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json }}
27+
Get-AzFirmwareAnalysisCryptoCertificate -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"CryptoCertId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
@@ -71,11 +70,9 @@ Lists cryptographic certificate analysis results found in a firmware.
7170
"Usage": []
7271
}
7372
]
74-
}}
7573
```
7674

77-
{{ List all the crypto certificate analysis results for a firmware.
78-
}}
75+
List all the crypto certificate analysis results for a firmware.
7976

8077
## PARAMETERS
8178

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisCryptoKey.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists cryptographic key analysis results found in a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the crypto key analysis results for a firmware. }}
25+
### Example 1: List all the crypto key analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisCryptoKey -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json}}
27+
Get-AzFirmwareAnalysisCryptoKey -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"CryptoKeyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
@@ -53,11 +52,9 @@ Lists cryptographic key analysis results found in a firmware.
5352
]
5453
}
5554
]
56-
}}
5755
```
5856

59-
{{ List all the crypto key analysis results for a firmware.
60-
}}
57+
List all the crypto key analysis results for a firmware.
6158

6259
## PARAMETERS
6360

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisCve.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists CVE analysis results of a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the cve analysis results for a firmware. }}
25+
### Example 1: List all the cve analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisCve -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json }}
27+
Get-AzFirmwareAnalysisCve -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"ComponentId": ,
@@ -57,11 +56,9 @@ Lists CVE analysis results of a firmware.
5756
"Type": "Microsoft.IoTFirmwareDefense/workspaces/firmwares/cves"
5857
}
5958
]
60-
}}
6159
```
6260

63-
{{ List all the cve analysis results for a firmware.
64-
}}
61+
List all the cve analysis results for a firmware.
6562

6663
## PARAMETERS
6764

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisFirmware.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ Get firmware.
4141

4242
## EXAMPLES
4343

44-
### Example 1: {{ List all the firmwares inside a workspace. }}
44+
### Example 1: List all the firmwares inside a workspace.
4545
```powershell
46-
{{ Get-AzFirmwareAnalysisFirmware -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName }}
46+
Get-AzFirmwareAnalysisFirmware -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName
4747
```
4848

4949
```output
50-
{{
5150
Description :
5251
FileName :
5352
FileSize :
@@ -67,19 +66,16 @@ SystemDataLastModifiedByType :
6766
Type : microsoft.iotfirmwaredefense/workspaces/firmwares
6867
Vendor :
6968
Version :
70-
}}
7169
```
7270

73-
{{ List all the firmwares inside a workspace.
74-
}}
71+
List all the firmwares inside a workspace.
7572

76-
### Example 2: {{ Get a firmware inside a workspace. }}
73+
### Example 2: Get a firmware inside a workspace.
7774
```powershell
78-
{{ Get-AzFirmwareAnalysisFirmware -Id FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName }}
75+
Get-AzFirmwareAnalysisFirmware -Id FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName
7976
```
8077

8178
```output
82-
{{
8379
Description :
8480
FileName :
8581
FileSize :
@@ -99,11 +95,9 @@ SystemDataLastModifiedByType :
9995
Type : microsoft.iotfirmwaredefense/workspaces/firmwares
10096
Vendor :
10197
Version :
102-
}}
10398
```
10499

105-
{{ Get a firmware inside a workspace.
106-
}}
100+
Get a firmware inside a workspace.
107101

108102
## PARAMETERS
109103

@@ -140,7 +134,7 @@ Accept wildcard characters: False
140134
141135
### -InputObject
142136
Identity Parameter
143-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
137+
.
144138
145139
```yaml
146140
Type: Microsoft.Azure.PowerShell.Cmdlets.FirmwareAnalysis.Models.IFirmwareAnalysisIdentity
@@ -188,7 +182,7 @@ Accept wildcard characters: False
188182
189183
### -WorkspaceInputObject
190184
Identity Parameter
191-
To construct, see NOTES section for WORKSPACEINPUTOBJECT properties and create a hash table.
185+
.
192186
193187
```yaml
194188
Type: Microsoft.Azure.PowerShell.Cmdlets.FirmwareAnalysis.Models.IFirmwareAnalysisIdentity

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisPasswordHash.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists password hash analysis results of a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the password hash analysis results for a firmware. }}
25+
### Example 1: List all the password hash analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisPasswordHash -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json }}
27+
Get-AzFirmwareAnalysisPasswordHash -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"Algorithm": "",
@@ -49,11 +48,9 @@ Lists password hash analysis results of a firmware.
4948
"Username": ""
5049
}
5150
]
52-
}}
5351
```
5452

55-
{{ List all the password hash analysis results for a firmware.
56-
}}
53+
List all the password hash analysis results for a firmware.
5754

5855
## PARAMETERS
5956

src/FirmwareAnalysis/FirmwareAnalysis.Autorest/docs/Get-AzFirmwareAnalysisSbomComponent.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Lists SBOM analysis results of a firmware.
2222

2323
## EXAMPLES
2424

25-
### Example 1: {{ List all the sbom component analysis results for a firmware. }}
25+
### Example 1: List all the sbom component analysis results for a firmware.
2626
```powershell
27-
{{ Get-AzFirmwareAnalysisSbomComponent -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json}}
27+
Get-AzFirmwareAnalysisSbomComponent -FirmwareId FirmwareId -ResourceGroupName ResourceGroupName -WorkspaceName WorkspaceName | ConvertTo-Json
2828
```
2929

3030
```output
31-
{{
3231
[
3332
{
3433
"ComponentId": "",
@@ -47,11 +46,9 @@ Lists SBOM analysis results of a firmware.
4746
"Version": ""
4847
}
4948
]
50-
}}
5149
```
5250

53-
{{ List all the sbom component analysis results for a firmware.
54-
}}
51+
List all the sbom component analysis results for a firmware.
5552

5653
## PARAMETERS
5754

0 commit comments

Comments
 (0)