You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jeff 2/10/2019 8:49:10 AM Microsoft Windows 10 Pro 40.20:56:24.5411481
113
+
postCode: This adds another view called Computer that groups objects on the Computername property.
91
114
inputs:
92
115
- type: System.Object
93
116
description: ''
@@ -131,7 +154,7 @@ optionalParameters:
131
154
- name: Passthru
132
155
aliases: []
133
156
defaultValue: None
134
-
description: Write the ps1xml file object to the pipeline.
157
+
description: Write the ps1xml file object to the pipeline. If you run this command inside VS Code and use this parameter, the file will be opened in the editor.
135
158
parameterValueGroup: []
136
159
pipelineInput: False
137
160
position: Named
@@ -169,6 +192,14 @@ optionalParameters:
169
192
pipelineInput: False
170
193
position: Named
171
194
type: String
195
+
- name: GroupBy
196
+
aliases: []
197
+
defaultValue: None
198
+
description: Specify a property name to group on. You can edit the file if you need to change how it is displayed and/or calculated.
199
+
parameterValueGroup: []
200
+
pipelineInput: False
201
+
position: Named
202
+
type: String
172
203
outputs:
173
204
- type: None
174
205
description: ''
@@ -194,7 +225,7 @@ requiredParameters:
194
225
remarks: >-
195
226
When defining custom objects with a new typename, PowerShell by default will display all properties. However, you may wish to have a specific default view, be it a table or list. Or you may want to have different views display the object differently. Format directives are stored in format.ps1xml files which can be tedious to create. This command simplifies that process.
196
227
197
-
Pipe an instance of your custom object to this function and it will generate a format.ps1xml file based on either all the properties or a subset that you provide. You can repeat the process to add additional views. When finished, edit the format.ps1xml file and fine tune it. The file will have notes on how to substitute script blocks.
228
+
Pipe an instance of your custom object to this function and it will generate a format.ps1xml file based on either all the properties or a subset that you provide. You can repeat the process to add additional views. When finished, edit the format.ps1xml file and fine tune it. The file will have notes on how to substitute script blocks. If you run this command inside VS Code and use -Passthru, the new file will automatically be opened in your editor.
198
229
199
230
Note that table views are set to Autosize. But the table definition will include best guesses for column widths. If you prefer a more granular approach you can delete the Autosize tag and experiment with varying widths. Don't forget to run Update-FormatData to load your new file. You may need to start a new PowerShell session to test changes.
When defining custom objects with a new typename, PowerShell by default will display all properties. However, you may wish to have a specific default view, be it a table or list. Or you may want to have different views display the object differently. Format directives are stored in format.ps1xml files which can be tedious to create. This command simplifies that process.
25
25
26
-
Pipe an instance of your custom object to this function and it will generate a format.ps1xml file based on either all the properties or a subset that you provide. You can repeat the process to add additional views. When finished, edit the format.ps1xml file and fine tune it. The file will have notes on how to substitute script blocks.
26
+
Pipe an instance of your custom object to this function and it will generate a format.ps1xml file based on either all the properties or a subset that you provide. You can repeat the process to add additional views. When finished, edit the format.ps1xml file and fine tune it. The file will have notes on how to substitute script blocks. If you run this command inside VS Code and use -Passthru, the new file will automatically be opened in your editor.
27
27
28
28
Note that table views are set to Autosize. But the table definition will include best guesses for column widths. If you prefer a more granular approach you can delete the Autosize tag and experiment with varying widths. Don't forget to run Update-FormatData to load your new file. You may need to start a new PowerShell session to test changes.
Write the ps1xml file object to the pipeline. If you run this command inside VS Code and use this parameter, the file will be opened in the editor.
163
180
164
181
```yaml
165
182
Type: SwitchParameter
@@ -253,9 +270,25 @@ Accept pipeline input: False
253
270
Accept wildcard characters: False
254
271
```
255
272
273
+
### -GroupBy
274
+
275
+
Specify a property name to group on. You can edit the file if you need to change how it is displayed and/or calculated.
276
+
277
+
```yaml
278
+
Type: String
279
+
Parameter Sets: (All)
280
+
Aliases:
281
+
282
+
Required: False
283
+
Position: Named
284
+
Default value: None
285
+
Accept pipeline input: False
286
+
Accept wildcard characters: False
287
+
```
288
+
256
289
### CommonParameters
257
290
258
-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters(http://go.microsoft.com/fwlink/?LinkID=113216).
291
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
0 commit comments