Skip to content

Commit 5b74631

Browse files
committed
Upgrade PlatyPS to 1.0.1
1 parent afda183 commit 5b74631

File tree

204 files changed

+40841
-20294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+40841
-20294
lines changed

.azure-pipelines/PipelineSteps/analyze-steps.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Assert-ExitCodeSuccess {
2828

2929
# Install PowerShell dependencies
3030
Write-Host -ForegroundColor Green "-------------------- Start installing PowerShell dependencies ... --------------------"
31-
Install-Module "platyPS", "PSScriptAnalyzer" -Repository PSGallery -Force -Confirm:$false -Scope CurrentUser
31+
Install-Module "Microsoft.PowerShell.PlatyPS", "PSScriptAnalyzer" -Repository PSGallery -Force -Confirm:$false -Scope CurrentUser
3232
Write-Host -ForegroundColor DarkGreen "-------------------- End installing PowerShell dependencies ... --------------------`n`n`n`n`n"
3333

3434
# Install latest Az modules

.azure-pipelines/security-tools.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ jobs:
7070
& $buildStepsPath -RepoRoot "$(Build.SourcesDirectory)" -Configuration "Debug" -FilesChangedOutputPath $filesChangedOutputPath -IsSecurityCheck $true -BuildReason $(Build.Reason) -Trigger $trigger
7171
7272
- task: PowerShell@2
73-
displayName: Install platyPS
73+
displayName: Install Microsoft.PowerShell.PlatyPS
7474
inputs:
7575
targetType: inline
76-
script: Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser
76+
script: Install-Module Microsoft.PowerShell.PlatyPS -Force -Confirm:$false -Scope CurrentUser
7777
pwsh: true
7878
- task: UseDotNet@2
7979
displayName: 'Use .NET SDK 6.0 for CredScan'

.azure-pipelines/util/analyze-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ steps:
2727
packageType: sdk
2828
version: 8.x
2929

30-
- pwsh: 'Install-Module "platyPS", "PSScriptAnalyzer" -Force -Confirm:$false -Scope CurrentUser'
30+
- pwsh: 'Install-Module "Microsoft.PowerShell.PlatyPS", "PSScriptAnalyzer" -Force -Confirm:$false -Scope CurrentUser'
3131
displayName: 'Install PowerShell Dependencies'
3232

3333
- task: PowerShell@2

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ First-time setup requires these exact steps:
2525
- **CRITICAL**: Ensure you have network connectivity to Azure DevOps package feeds. Build failures with "Name or service not known" errors indicate firewall/connectivity issues that must be resolved before building.
2626
- Install .NET SDK 8.0+ and .NET Framework Dev Pack 4.7.2+: `dotnet --version` should show 8.0+
2727
- Install PowerShell 7+: `pwsh --version` should show 7.0+
28-
- Install platyPS module: `pwsh -c "Install-Module -Name platyPS -Force -Scope CurrentUser"`
28+
- Install Microsoft.PowerShell.PlatyPS module: `pwsh -c "Install-Module -Name Microsoft.PowerShell.PlatyPS -Force -Scope CurrentUser"`
2929
- Install PSScriptAnalyzer: `pwsh -c "Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser"`
3030
- Set PowerShell execution policy: `pwsh -c "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser"`
3131

@@ -110,7 +110,7 @@ If build appears to hang or shows no progress:
110110
- Builds may pause during package downloads or complex compilation steps
111111

112112
### Module-Specific Issues
113-
- Help generation requires platyPS module to be installed and functioning
113+
- Help generation requires Microsoft.PowerShell.PlatyPS module to be installed and functioning
114114
- Static analysis requires PSScriptAnalyzer module
115115
- Some projects depend on specific Azure SDK versions from Azure DevOps feeds
116116
- Missing ChangeLog.md updates will cause PR validation to fail

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The following prerequisites should be completed before contributing to the Azure
5050

5151
- Install [Visual Studio 2022 or above](https://www.visualstudio.com/downloads/)
5252
- Install the latest version of [Git](https://git-scm.com/downloads)
53-
- Install the [`platyPS` module](help-generation.md#Installing-platyPS)
53+
- Install the [`Microsoft.PowerShell.PlatyPS` module](help-generation.md#Installing-MicrosoftPowerShellPlatyPS)
5454
- Install [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer#installation)
5555
- Install [**.NET SDK 6, and .NET Framework Dev Pack 4.7.2**](https://dotnet.microsoft.com/en-us/download/dotnet) or greater
5656
- Install [PowerShell 7](https://github.com/PowerShell/PowerShell/releases/latest)
@@ -89,7 +89,7 @@ git pull upstream main
8989

9090
### Building the Environment
9191

92-
_Note_: to build the environment locally, you need `platyPS` install on your machine. Please see the [Prerequisites](#prerequisites) section for details on how to install this module.
92+
_Note_: to build the environment locally, you need `Microsoft.PowerShell.PlatyPS` install on your machine. Please see the [Prerequisites](#prerequisites) section for details on how to install this module.
9393

9494
After cloning the repository to your local machine, you want to ensure that you can build the environment. To do so, launch `VS Developer Command Prompt` (which is installed with Visual Studio) and run the following command (from the root of the repository) to do a full build:
9595

@@ -105,7 +105,7 @@ PS C:\azure-powershell> dotnet msbuild build.proj
105105

106106
### Generating Help
107107

108-
We build the `dll-Help.xml` files (used to display the help content for cmdlets in PowerShell) from markdown using the `platyPS` module. Since this help generation step can take 10-15 minutes, it is a separate part of the command line build process. Run this to generate help:
108+
We build the `dll-Help.xml` files (used to display the help content for cmdlets in PowerShell) from markdown using the `Microsoft.PowerShell.PlatyPS` module. Since this help generation step can take 10-15 minutes, it is a separate part of the command line build process. Run this to generate help:
109109

110110
```
111111
msbuild build.proj /t:GenerateHelp
@@ -153,7 +153,7 @@ Please submit a design review here: https://github.com/Azure/azure-powershell-cm
153153

154154
_Note_: You will need to be part of the `GitHub Azure` org to see this repository. Please go to [this link](https://aka.ms/azuregithub) to become part of the `Azure` org.
155155

156-
We recommend using the `platyPS` module to easily generate markdown files that contains the above information and including the files in the design submission.
156+
We recommend using the `Microsoft.PowerShell.PlatyPS` module to easily generate markdown files that contains the above information and including the files in the design submission.
157157

158158
### Point of Contact
159159

@@ -243,7 +243,7 @@ To import modules automatically when debug has started, follow the below steps:
243243

244244
All cmdlets that are created must have accompanying help that is displayed when users execute the command `Get-Help <your cmdlet>`.
245245

246-
Each cmdlet has a markdown file that contains the help content that is displayed in PowerShell; these markdown files are created (and maintained) using the platyPS module.
246+
Each cmdlet has a markdown file that contains the help content that is displayed in PowerShell; these markdown files are created (and maintained) using the Microsoft.PowerShell.PlatyPS module.
247247

248248
For complete documentation, see [`help-generation.md`](help-generation.md) in the `documentation` folder.
249249

documentation/development-docs/help-generation.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
## Description
44

5-
All MAML files containing the help content for cmdlets have been removed from the Azure PowerShell repository and replaced with markdown files, which are generated and maintained using the [`platyPS`](https://github.com/PowerShell/platyPS) module. Each module has a `help` folder (_e.g.,_ `src/Accounts/Accounts/help`) which contains a markdown file for each of the cmdlets found in that given module. When the help content for a cmdlet (or multiple cmdlets) needs to be updated, users will now only have to update the contents of the markdown file, _and not the MAML file as well_.
5+
All MAML files containing the help content for cmdlets have been removed from the Azure PowerShell repository and replaced with markdown files, which are generated and maintained using the [`Microsoft.PowerShell.PlatyPS`](https://github.com/PowerShell/platyPS) module (v1.0+). Each module has a `help` folder (_e.g.,_ `src/Accounts/Accounts/help`) which contains a markdown file for each of the cmdlets found in that given module. When the help content for a cmdlet (or multiple cmdlets) needs to be updated, users will now only have to update the contents of the markdown file, _and not the MAML file as well_.
66

7-
## Installing `platyPS`
7+
## Installing `Microsoft.PowerShell.PlatyPS`
88

9-
In order to use the cmdlets necessary to update the markdown help files (or generate MAML help locally from these markdown files), you must first install the `platyPS` module mentioned previously. You will need to install a minimum version of 0.11.0.
9+
In order to use the cmdlets necessary to update the markdown help files (or generate MAML help locally from these markdown files), you must first install the `Microsoft.PowerShell.PlatyPS` module mentioned previously. You will need to install a minimum version of 1.0.0.
1010

11-
To do so, you can follow the below steps (which are outlined in the [**Quick start**](https://github.com/PowerShell/platyPS#quick-start) section of the `platyPS` README):
11+
To do so, you can follow the below steps:
1212

1313
```powershell
14-
Install-Module -Name platyPS -Scope CurrentUser
14+
Install-Module -Name Microsoft.PowerShell.PlatyPS -Scope CurrentUser
1515
```
1616

1717
**Note:** this module will need to be installed from the [PowerShell Gallery](http://www.powershellgallery.com/). If, for some reason, this isn't a registered repository when running the `Get-PSRepository` cmdlet, then you will need to register it by running the following command:
@@ -20,11 +20,11 @@ Install-Module -Name platyPS -Scope CurrentUser
2020
Register-PSRepository -Default -InstallationPolicy Trusted
2121
```
2222

23-
## Using `platyPS`
23+
## Using `Microsoft.PowerShell.PlatyPS`
2424

2525
### Importing your module
2626

27-
Before you run the `platyPS` cmdlets to update your markdown help files, you will need to first import the module containing the changes that you have made to your cmdlets into your current PowerShell session. Once you have built your project (either through Visual Studio or with `msbuild`), you can locate the module manifest that you will need to import in the `artifacts/Debug` folder of your local repository.
27+
Before you run the `Microsoft.PowerShell.PlatyPS` cmdlets to update your markdown help files, you will need to first import the module containing the changes that you have made to your cmdlets into your current PowerShell session. Once you have built your project (either through Visual Studio or with `msbuild`), you can locate the module manifest that you will need to import in the `artifacts/Debug` folder of your local repository.
2828

2929
For example, if you have made changes to the `Accounts` module, you will find the corresponding module manifest in `artifacts/Debug/Az.Accounts/Az.Accounts.psd1`.
3030

@@ -43,7 +43,7 @@ For new modules with no existing `help` folder containing the markdown help file
4343

4444
```powershell
4545
$PathToHelpFolder = "../../help" # Full path to help folder containing markdown files to be generated (e.g., src/Accounts/Accounts/help)
46-
New-MarkdownHelp -Module {{moduleName}} -OutputFolder $PathToHelpFolder -AlphabeticParamsOrder -UseFullTypeName -WithModulePage
46+
New-MarkdownCommandHelp -ModuleInfo (Get-Module {{moduleName}}) -OutputFolder $PathToHelpFolder -WithModulePage
4747
```
4848

4949
Once this folder has been generated, follow the steps provided in the below section to update the files with any changes made to the public interface of the cmdlets.
@@ -65,55 +65,59 @@ Whenever the public interface for a cmdlet has changed, the corresponding markdo
6565

6666
#### Updating all markdown files in a module
6767

68-
To update all of the markdown files for a single module, use the [`Update-MarkdownHelpModule`](https://github.com/PowerShell/platyPS/blob/master/docs/Update-MarkdownHelpModule.md) cmdlet:
68+
To update all of the markdown files for a single module, use the `Update-MarkdownCommandHelp` and `Update-MarkdownModuleFile` cmdlets:
6969

7070
```powershell
7171
$PathToModuleManifest = "../../<module>.psd1" # Full path to the module manifest that you have updated
7272
Import-Module -Name $PathToModuleManifest
7373
7474
$PathToHelpFolder = "../../help" # Full path to help folder containing markdown files to be updated
75-
Update-MarkdownHelpModule -Path $PathToHelpFolder -RefreshModulePage -AlphabeticParamsOrder -UseFullTypeName
76-
```
7775
78-
If you would like to update the inputs/outputs for a markdown file, please run this cmdlet with the -UpdateInputOutput parameter. Keep in mind that this will overwrite any customized descriptions of inputs and outputs, so you will need to add these descriptions back if still relevant.
76+
# Update individual command help markdown files
77+
Update-MarkdownCommandHelp -Path "$PathToHelpFolder/*-*.md"
78+
79+
# Refresh the module page with updated command list
80+
$cmdHelp = Import-MarkdownCommandHelp -Path "$PathToHelpFolder/*-*.md"
81+
$moduleFile = Get-ChildItem -Path $PathToHelpFolder -Filter "Az.*.md" | Where-Object { $_.Name -notlike "*-*" } | Select-Object -First 1
82+
if ($moduleFile) { Update-MarkdownModuleFile -Path $moduleFile.FullName -CommandHelp $cmdHelp }
83+
```
7984

80-
This will update all of the markdown files with public interface changes made to corresponding cmdlets, add markdown files for any new cmdlets, remove markdown files for any deleted cmdlets, and update the module page (_e.g.,_ `Az.Accounts.md`) with any added or removed cmdlets.
85+
This will update all of the markdown files with public interface changes made to corresponding cmdlets and update the module page (_e.g.,_ `Az.Accounts.md`) with any added or removed cmdlets.
8186

8287
_This seems to work better when run from within the `help` folder itself (For e.g. to generate the help files for the [`Network`](https://github.com/Azure/azure-powershell/tree/main/src/Network) module run the cmd from under [`Commands.Network/help`](https://github.com/Azure/azure-powershell/tree/main/src/Network/Network/help)). Also, you will have to import the profile module from under <Repo base path>/artifacts/Debug/Az.Accounts/Az.Accounts.psd1_
8388

8489
#### Updating a single markdown file
8590

86-
To update a single markdown file with the changes made to the corresponding cmdlet, use the [`Update-MarkdownHelp`](https://github.com/PowerShell/platyPS/blob/master/docs/Update-MarkdownHelp.md) cmdlet:
91+
To update a single markdown file with the changes made to the corresponding cmdlet, use the `Update-MarkdownCommandHelp` cmdlet:
8792

8893
```powershell
8994
$PathToModuleManifest = "../../<module>.psd1" # Full path to the module manifest that you have updated
9095
Import-Module -Name $PathToModuleManifest
9196
9297
$PathToMarkdownFile = "../../<cmdlet>.md" # Full path to the markdown file to be updated
93-
Update-MarkdownHelp -Path $PathToMarkdownFile -AlphabeticParamsOrder -UseFullTypeName
98+
Update-MarkdownCommandHelp -Path $PathToMarkdownFile
9499
```
95100

96-
If you would like to update the inputs/outputs for a markdown file, please run this cmdlet with the -UpdateInputOutput parameter. Keep in mind that this will overwrite any customized descriptions of inputs and outputs, so you will need to add these descriptions back if still relevant.
97-
98101
#### Generating and viewing the MAML help
99102

100103
During the build, the MAML help will be generated from the markdown files in the repository. If you would like to generate the MAML help and preview what the help content will look like for each of your cmdlets, you can do so with two more commands.
101104

102-
To generate the MAML help based on the contents of your markdown files, use the [`New-ExternalHelp`](https://github.com/PowerShell/platyPS/blob/master/docs/New-ExternalHelp.md) cmdlet:
105+
To generate the MAML help based on the contents of your markdown files, use the `Import-MarkdownCommandHelp` and `Export-MamlCommandHelp` cmdlets:
103106

104107
```powershell
105108
$PathToHelpFolder = "../../help" # Full path to help folder containing markdown files to be updated
106109
$PathToOutputFolder = "../../.." # Full path to folder where you want the MAML file to be generated
107-
New-ExternalHelp -Path $PathToHelpFolder -OutputPath $PathToOutputFolder
110+
$cmdHelp = Import-MarkdownCommandHelp -Path "$PathToHelpFolder/*-*.md"
111+
Export-MamlCommandHelp -CommandHelp $cmdHelp -OutputFolder $PathToOutputFolder
108112
```
109113

110-
To preview the help that you just generated, use the [`Get-HelpPreview`](https://github.com/PowerShell/platyPS/blob/master/docs/Get-HelpPreview.md) cmdlet:
114+
To preview the help that you just generated, use the `Show-HelpPreview` cmdlet:
111115

112116
```powershell
113117
$PathToMAML = "../../<maml>.dll-Help.xml" # Full path to the MAML file that was generated
114118
115119
# Save the help locally
116-
$help = Get-HelpPreview -Path $PathToMAML
120+
$help = Show-HelpPreview -Path $PathToMAML
117121
118122
# Get the help for a specific cmdlet
119123
$help | where { $_.Name -eq "<cmdlet>" }

documentation/development-docs/sdkbased-vs-autogen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Generally speaking, hero scenarios are implemented through customization through
7878

7979
### SDK-based Module
8080

81-
Docs are generated through playPS, please see [platyPS](https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/help-generation.md#Installing-platyPS) for details. And developers should populate generated docs with examples.
81+
Docs are generated through Microsoft.PowerShell.PlatyPS, please see [Microsoft.PowerShell.PlatyPS](https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/help-generation.md#Installing-MicrosoftPowerShellPlatyPS) for details. And developers should populate generated docs with examples.
8282

8383
### Auto-gen Module
8484

documentation/tooling/static-analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The dependency analyzer can be found in the [`DependencyAnalyzer`](https://githu
9393
The help analyzer can be found in the [`HelpAnalyzer`](https://github.com/Azure/azure-powershell/tree/01a81fbb7ea6c086fff2bc137053168c0fc7728a/tools/StaticAnalysis/HelpAnalyzer) folder. In this folder, you will find the following classes:
9494

9595
- `HelpAnalyzer`
96-
- The implementation of the `IStaticAnalyzer` interface; determines which modules to analyze and checks to see which cmdlets within those modules don't have a corresponding markdown help file. It also checks the content structure of markdown help conforms to [PlatyPS Schema](https://github.com/PowerShell/platyPS/blob/master/platyPS.schema.md)
96+
- The implementation of the `IStaticAnalyzer` interface; determines which modules to analyze and checks to see which cmdlets within those modules don't have a corresponding markdown help file. It also checks the content structure of markdown help conforms to [PlatyPS Schema](https://github.com/PowerShell/platyPS) using the `Microsoft.PowerShell.PlatyPS` module
9797
- `HelpIssues`
9898
- The implementation of the `IReportRecord` interface; defines what a help exception looks like when it's reported in the `HelpIssues.csv` file that is found in the build artifacts of a CI run, as well as how to compare a new record to a record found in the existing `HelpIssues.csv` file used for exception suppressions
9999

0 commit comments

Comments
 (0)