Skip to content

Commit 32d8f28

Browse files
PR comments fix.
1 parent 0df6793 commit 32d8f28

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

documentation/development-docs/generate-format.ps1xml-file.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ c9cbd920-c00c-427c-852b-c329e824c3a8 Azure SDK Powershell Test Enabled c9cbd920-
9898
```
9999

100100
The default table output reveals some issues:
101-
1. **SubscriptionId** property values duplicates the **Id** property values,
102-
2. **CurrentStorageAccountName** property values are empty
103-
3. **ExtendedProperties** property values don't fit the console window and are omitted.
101+
* The selected fields don't fit in a standard window
102+
* The columns are not displayed in order of importance to the customer for doing their work.
103+
* **SubscriptionId** property values duplicates the **Id** property values,
104+
* **CurrentStorageAccountName** property values are empty
105+
* **ExtendedProperties** property values don't fit in the console window and omitted.
104106

105107
# File format.ps1xml.
106108

@@ -113,7 +115,7 @@ To provide a better PowerShell Azure cmdlets output experience we worked out a m
113115
2. Run the New-FormatPs1Xml cmdlet to generate the format.ps1xml file.
114116

115117
---
116-
We presume that for the [output type](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-design-guidelines.md#output-type) you created a new class that, for example, wraps a returning .NET SDK type, rather to use PSObject.
118+
We presume that for the [output type](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-design-guidelines.md#output-type) you created a new class that, for example, wraps a returning .NET SDK type, rather than PSObject.
117119
118120
---
119121

@@ -153,7 +155,6 @@ Let's say for our example we want to only show these parameters in the output:
153155
* Id
154156
* Name
155157
* State
156-
* SubscriptionId
157158
* TenantId
158159

159160
We just need to add the Ps1Xml attribute to the selected properties:
@@ -205,8 +206,14 @@ namespace Microsoft.Azure.Commands.Profile.Models
205206

206207
// code omitted for brevity
207208
```
209+
* The column order in the output table will be the same as the order of the properties in the class:
210+
```
211+
Id Name State TenantId
212+
== ==== ===== ========
213+
```
214+
* If **Label** is not specified - the property name will be used.
208215

209-
Since the **Ps1Xml attribute** definition is located in the [Commands.Common](https://github.com/Azure/azure-powershell/tree/preview/src/Common/Commands.Common) project and the Command.Common project is likely referenced from your project - to make the attribute visible - you only need to add ```using Microsoft.WindowsAzure.Commands.Common.Attributes;``` statement.
216+
* Since the **Ps1Xml attribute** definition is located in the [Commands.Common](https://github.com/Azure/azure-powershell/tree/preview/src/Common/Commands.Common) project and the Command.Common project is likely referenced from your project - to make the attribute visible - you only need to add ```using Microsoft.WindowsAzure.Commands.Common.Attributes;``` statement.
210217
211218

212219
# How to generate format.ps1xml file.
@@ -260,7 +267,7 @@ E:\git\azure-powershell\Microsoft.Azure.Commands.Profile.generated.format.ps1xml
260267

261268
**Note:** All the paths used in the example in the section are under **_azure-powershell/src/Package/Debug_**
262269

263-
1. **Copy** the generated format.ps1xml file to the built module folder (this is where your module manifest file psd1 is located ). In our example the module folder is
270+
1. **Copy** the generated format.ps1xml file to the built module folder (this is where your module manifest file psd1 is located). In our example the module folder is
264271
```
265272
E:\git\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Profile
266273
```

0 commit comments

Comments
 (0)