Create tool to generate format.ps1xml file
Currently there is no way to create a format.ps1xml file without copying an existing file and changing the types and properties.
The cmdlet should go in the Repo-Tasks module: https://github.com/Azure/azure-powershell/blob/preview/tools/Repo-Tasks.psd1
There should be a tool that accepts the .dll for a module and does the following:
- [ ] By default, creates a list and table view for each output type that displays all of their properties
- [ ] Suggest a mechsnism (config, attributes, etc) for the user to specify properties to include or exclude, and potentially for custom formatting
- [ ] Allow users to specify a module, and optionally an output path and a list of cmdlets
Documentation on ps1xml files:https://msdn.microsoft.com/en-us/library/gg580922(v=vs.85).aspx
Sample ps1xml files: https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml
Documentation is needed for this topic as there is very little one how this file works. The documentation should include the following:
- [ ] How a
format.ps1xmlfile is structured - [ ] The difference between list and table view, and when one should be used versus the other
Sample of generated list format: https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml#L93-L118
Documents about formatting: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_format.ps1xml?view=powershell-5.1 https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/update-formatdata?view=powershell-5.1
Sample table format: https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.format.generated.ps1xml#L88-L145
Related issue here: https://github.com/Azure/azure-powershell/issues/865
Quickly use/test cmdlet from VS._
Debug/Start Action/Start external program:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Debug/Start Options/Command line arguments:
-NoProfile -NoExit -Command "Import-Module .\RepoTasks.Cmdlets.dll

https://github.com/Azure/azure-powershell/pull/5559
https://github.com/Azure/azure-powershell/pull/5666
PR merged - closing.