Skip to content

Commit 00ee0bb

Browse files
committed
Update platyPSHelp documentation
1 parent d49c5cd commit 00ee0bb

File tree

3 files changed

+47
-16
lines changed

3 files changed

+47
-16
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If applicable, reference the bug/issue that this pull request fixes here.
1212
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices [here](https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx).
1313

1414
- [ ] **I have read the [contribution guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md).**
15-
- [ ] **If changes were made to any cmdlet, the XML help was regenerated using the [platyPSHelp module](https://github.com/Azure/azure-powershell/blob/dev/documentation/platyps-help.md).**
15+
- [ ] **If changes were made to any cmdlet, the XML help was regenerated using the [platyPSHelp module](https://github.com/Azure/azure-powershell/blob/dev/documentation/platyPSHelp-documentation.md).**
1616
- [ ] **If any large changes are made to a service, they are reflected in the respective [change log](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#updating-the-change-log).**
1717

1818
### [General Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#general-guidelines)

documentation/platyps-help.md renamed to documentation/platyPSHelp-documentation.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# PlatyPS Help
22

33
- [Description](#description)
4+
- [Prerequisites](#prerequisites)
5+
- [Install and import platyPS](#install-and-import-platyps)
6+
- [Check for valid paths](#check-for-valid-paths)
47
- [Getting Started](#getting-started)
5-
- [Installing the platyPSHelp Module](#installing-the-platypshelp-module)
8+
- [Installing the platyPSHelp module](#installing-the-platypshelp-module)
69
- [Running the New-ServiceMarkdownHelp cmdlet](#running-the-new-servicemarkdownhelp-cmdlet)
710
- [Running the Validate-ServiceMarkdownHelp cmdlet](#running-the-validate-servicemarkdownhelp-cmdlet)
811
- [Running the Update-ServiceMarkdownHelp cmdlet](#running-the-update-servicemarkdownhelp-cmdlet)
@@ -20,15 +23,44 @@
2023

2124
PlatyPS is used to create PowerShell external help in markdown rather than XML (MAML). Where as XML help (MAML) can be difficult to edit by hand or read, markdown is designed to be human-readable and easy to edit. This will allow service teams to quickly and easily edit any help documentation they have for their cmdlets.
2225

23-
Install (and read more about) platyPS from the README, located [here](https://github.com/PowerShell/platyPS/blob/master/README.md).
26+
You can find the more information on platyPS [here](https://github.com/PowerShell/platyPS/blob/master/README.md).
27+
28+
The platyPSHelp module uses platyPS to allow service teams to achieve the following:
29+
- Create markdown files for each of their cmdlets
30+
- Update the markdown files when changes are made to the cmdlets
31+
- Validate the help content in the markdown files to ensure no sections are missing information
32+
33+
## Prerequisites
34+
35+
### Install and import the platyPS
36+
37+
In order to use the platyPSHelp module, you will first need to install the platyPS module. To do so, run the following commands:
38+
39+
```powershell
40+
Install-Module -Name platyPS -Scope CurrentUser
41+
Import-Module platyPS
42+
```
43+
44+
### Check for valid paths
45+
46+
The platyPSHelp module builds paths to the service module and commands directory using the service name provided, the build target, and if the service is ARM or RDFE.
47+
48+
For ARM services, these paths include:
49+
- Path to module: `src\Package\<Build Target>\ResourceManager\AzureResourceManager\AzureRM.<Service>\AzureRM.<Service>.psd1`
50+
- Path to commands: `src\ResourceManager\<Service>\Commands.<Service>`
51+
- Path to help: `src\ResourceManager\<Service>\Commands.<Service>\help`
52+
53+
TrafficManager, for example, is a service that doesn't follow the format of these paths that are built - the path to their commands folder is `src\ResourceManager\TrafficManager\Commands.TrafficManager2`.
54+
55+
In the case that your service doesn't follow the format of the above paths, you will need to use the "FullPath" parameter set, which allows you to pass in the paths as parameters rather than have them built.
2456

2557
## Getting Started
2658

2759
If your service does not currently have any markdown help, follow the below steps to get started.
2860

2961
**NOTE**: Currently, the platyPSHelp module mentioned below is unable to create markdown help for **ServiceManagement** cmdlets. However, markdown help can be created for these cmdlets when running the regular platyPS cmdlets mentioned in the [How it Works](#how-it-works) section.
3062

31-
### Installing the `platyPSHelp` Module
63+
### Installing the platyPSHelp module
3264

3365
The `platyPSHelp` module contains cmdlets that will help service teams with creating, updating, and validating markdown help for their cmdlets.
3466

@@ -39,15 +71,20 @@ There are three cmdlets contained in this module:
3971

4072
Help documentation has been written for each of these cmdlets, outlining the purpose of each cmdlet, the different parameter sets, and examples.
4173

42-
To use this module, change your directory to the **azure-powershell** repo, and from there, go to `tools\platyPS`. Run the following command to import the module:
74+
To use this module, change your directory to the **azure-powershell** repo, and from there, go to `tools\platyPSHelp`. Run the following command to import the module:
4375

4476
```powershell
4577
Import-Module .\platyPSHelp.psd1
4678
```
4779

4880
After executing this command, you will have access to the above cmdlets.
4981

50-
### Running the `New-ServiceMarkdownHelp` cmdlet
82+
If you are not using the "FullPath" parameter set, you will need the following information to use the cmdlets:
83+
- `Service` - the name of the service
84+
- `BuildTarget` - either Build or Release, the type of build used when building the service project locally
85+
- `ModuleName` - the name of the module corresponding to the service (_i.e._, AzureRM.Profile)
86+
87+
### Running the [New-ServiceMarkdownHelp](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/New-ServiceMarkdownHelp.md) cmdlet
5188

5289
Once the module is installed, you will need to generate the markdown for your cmdlets; to do so, you will run the `New-ServiceMarkdownHelp` cmdlet.
5390

@@ -61,16 +98,12 @@ There are four possible parameter sets to choose from when creating your cmdlets
6198
- `FullPath`
6299
- This parameter set will be used if there is an issue when using any of the above parameter sets (*e.g.*, the path to the XML help (MAML) or commands folder does not follow what the cmdlet is expecting); in this case, you can provide the full path to the required items
63100

64-
More information about this cmdlet can be found in the [help](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/New-ServiceMarkdownHelp.md).
65-
66101
Once ran, this cmdlet will create markdown files for each of the cmdlets in your module, and will be placed in the help folder located on the same level as your XML help (MAML). It will also regenerate the XML help (MAML) to ensure that the information in the markdown help is seen when `Get-Help` or `Get-HelpPreview` is ran.
67102

68-
### Running the `Validate-ServiceMarkdownHelp` cmdlet
103+
### Running the [Validate-ServiceMarkdownHelp](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/Validate-ServiceMarkdownHelp.md) cmdlet
69104

70105
Before checking in this markdown, you will need to check to make sure all of the necessary parts are filled out (*i.e.*, synopsis, description, examples, parameter descriptions, and outputs).
71106

72-
This cmdlet contains the same four parameter sets as the `New-ServiceMarkdownHelp`, and more information about the cmdlet can be found in the [help](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/Validate-ServiceMarkdownHelp.md).
73-
74107
Once ran, this cmdlet will output a list of errors for each cmdlet in the following format:
75108

76109
```
@@ -87,12 +120,10 @@ File: Some-Cmdlet.md
87120

88121
This will let you know what parts of the markdown help need to be updated. A recommended tool for editing and visualizing markdown is [Dillinger](http://dillinger.io/), which will display your markdown changes in real-time.
89122

90-
### Running the `Update-ServiceMarkdownHelp` cmdlet
123+
### Running the [Update-ServiceMarkdownHelp](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/Update-ServiceMarkdownHelp.md) cmdlet
91124

92125
Anytime that you make changes to a cmdlet (*e.g.*, add/edit/remove parameter, edit output type, etc.), you will need to make sure that those changes are reflected in the markdown. The `Update-ServiceMarkdownHelp` cmdlet will update your markdown with the changes made to your cmdlets.
93126

94-
This cmdlet contains the same four parameter sets as the other two cmdlets, and more information about the cmdlet can be found in the [help](https://github.com/Azure/azure-powershell/blob/dev/tools/platyPSHelp/help/Update-ServiceMarkdownHelp.md).
95-
96127
In addition to updating the markdown help files, it will also regenerate the XML help (MAML) to ensure that the information in the markdown help is seen when `Get-Help` or `Get-HelpPreview` is ran.
97128

98129
## How it Works

tools/platyPSHelp/platyPSHelp.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function New-ServiceMarkdownHelp
4949
# Set the necessary variables for an RDFE service
5050
elseif ($ServiceManagement.IsPresent)
5151
{
52-
throw "Currently platyPSHelp is unavailable for RDFE services. Please refer to the platyps-help.md documentation for more information."
52+
throw "Currently platyPSHelp is unavailable for RDFE services. Please refer to documentation\platyPSHelp-documentation.md for more information."
5353
$PathToModule = Get-ServiceManagementDll -Service $Service -PathToAzure "$PathToRepo\src\Package\$BuildTarget\ServiceManagement\Azure"
5454
$PathToCommandsFolder = "$PathToRepo\src\ServiceManagement\$Service\Commands.$Service"
5555
}
@@ -186,7 +186,7 @@ function Update-ServiceMarkdownHelp
186186
# Set the necessary variables for an RDFE service
187187
elseif ($ServiceManagement.IsPresent)
188188
{
189-
throw "Currently platyPSHelp is unavailable for RDFE services. Please refer to the platyps-help.md documentation for more information."
189+
throw "Currently platyPSHelp is unavailable for RDFE services. Please refer to the platyPSHelp-documentation.md documentation for more information."
190190
$PathToModule = "$PathToRepo\src\Package\$BuildTarget\ServiceManagement\Azure\Azure.psd1"
191191
$PathToCommandsFolder = "$PathToRepo\src\ServiceManagement\$Service\Commands.$Service"
192192
}

0 commit comments

Comments
 (0)