Skip to content

Commit 61ab01f

Browse files
authored
[Tools] Generate documentation/azure-powershell-modules.md (#23912)
* Add tools to refresh documentation\azure-powershell-modules.md * Add tools to refresh documentation\azure-powershell-modules.md
1 parent feae308 commit 61ab01f

File tree

2 files changed

+76
-2
lines changed

2 files changed

+76
-2
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
$ProjectRoot = "$PSScriptRoot/../.."
2+
3+
$Modules = Get-ChildItem -Recurse -Depth 2 -Path "$ProjectRoot/src" -File -Filter *.sln | ForEach-Object {$_.BaseName}
4+
5+
$Content = @"
6+
# Azure PowerShell Modules
7+
8+
## Rollup Module
9+
10+
| Description | Module Name | PowerShell Gallery Link |
11+
| ------------------------------------- | ----------- | -------------------------------- |
12+
| Azure PowerShell | ``Az`` | [![Az]][AzGallery] |
13+
| Azure PowerShell with preview Modules | ``AzPreview`` | [![AzPreview]][AzPreviewGallery] |
14+
15+
## Service Modules
16+
17+
| Azure Service | Module Name | PowerShell Gallery Link | Changelog |
18+
| ------------------------------ | ------------------------------- | ------------------------------------------------------------------ | -------------------------------------------------- |
19+
20+
"@
21+
22+
# Table
23+
foreach ($Module in $Modules)
24+
{
25+
$ServiceName = $Module
26+
$ModuleName = "``Az.$Module``"
27+
$PSGalleryLink = "[![$Module]][${Module}Gallery]"
28+
$ChangeLogLink = "[Changelog][${Module}ChangeLog]"
29+
$Content += "| {0,-30} | {1,-31} | {2,-66} | {3,-48} |`n" -f $ServiceName, $ModuleName, $PSGalleryLink, $ChangeLogLink
30+
}
31+
32+
# Shields
33+
$Content += @"
34+
35+
<!-- References -->
36+
37+
<!-- Shields -->
38+
[Az]: https://img.shields.io/powershellgallery/v/Az.svg?style=flat-square&label=Az
39+
[AzPreview]: https://img.shields.io/powershellgallery/v/AzPreview.svg?style=flat-square&label=AzPreview
40+
41+
"@
42+
foreach ($Module in $Modules)
43+
{
44+
$ShieldsLink = "[${Module}]:"
45+
$Content += "{0,-29} https://img.shields.io/powershellgallery/v/Az.$Module.svg?style=flat-square&label=Az.$Module`n" -f $ShieldsLink
46+
}
47+
48+
# PowerShell Gallery
49+
$Content += @"
50+
51+
<!-- PS Gallery -->
52+
[AzGallery]: https://www.powershellgallery.com/packages/Az/
53+
[AzPreviewGallery]: https://www.powershellgallery.com/packages/AzPreview/
54+
55+
"@
56+
foreach ($Module in $Modules)
57+
{
58+
$PSGalleryLink = "[${Module}Gallery]:"
59+
$Content += "{0,-36} https://www.powershellgallery.com/packages/Az.$Module/`n" -f $PSGalleryLink
60+
}
61+
62+
# ChangeLog
63+
$Content += @"
64+
65+
<!-- ChangeLog -->
66+
67+
"@
68+
foreach ($Module in $Modules)
69+
{
70+
$ChangeLogLink = "[${Module}ChangeLog]:"
71+
$Content += "{0,-38} ../src/$Module/$Module/ChangeLog.md`n" -f $ChangeLogLink
72+
}
73+
74+
$Content | Out-File -FilePath "$ProjectRoot/documentation/azure-powershell-Modules.md" -Encoding utf8

tools/Resolve-SolutionFile.ps1 renamed to tools/ResolveTools/Resolve-SolutionFile.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# This will resolve all the solution files under the src folder
1616
# ```powershell
17-
# ./tools/Resolve-SolutionFile.ps1
17+
# ./tools/ResolveTools/Resolve-SolutionFile.ps1
1818
# ```
1919

2020
function Resolve($solutionFilePath) {
@@ -84,5 +84,5 @@ function Resolve($solutionFilePath) {
8484
Set-Location $saveLocation
8585
}
8686

87-
$srcFolder = "$PSScriptRoot/../src"
87+
$srcFolder = "$PSScriptRoot/../../src"
8888
Get-ChildItem -Recurse -Filter *.sln -Path $srcFolder -Exclude Accounts.sln -Depth 2 | Foreach-Object { Resolve $_.FullName }

0 commit comments

Comments
 (0)