Skip to content

Commit

Permalink
Copy about_az.help.txt into en-US culture folder (#16473)
Browse files Browse the repository at this point in the history
* add about_az.help.txt into en-US culture folder

* polish doc
  • Loading branch information
BethanyZhou committed Nov 25, 2021
1 parent 2b57afb commit 6b49b2c
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 3 deletions.
10 changes: 9 additions & 1 deletion build.proj
Expand Up @@ -9,6 +9,8 @@
Runs tests
/t:Publish
Creates local nuget packages and MSI
/t:CopyAboutTopics
Copys about topics to culture folders
# Properties
/p:CodeSign=True
Expand Down Expand Up @@ -216,6 +218,12 @@
<Error Text="BinScope or PoliCheck failed. Please check the files in artifacts/BinScope, or Severity 1 issues in artifacts/PoliCheck-Scan.html" />
</Target>

<!-- Copy about topics to culture folders -->
<Target Name="CopyAboutTopics" Condition="'$(SkipHelp)' == 'false'">
<Message Importance="high" Text="Copying about topics to culture folders..." />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Set-Variable -Name ProgressPreference -Value 'SilentlyContinue';. $(RepoTools)/Docs/CopyAboutTopics.ps1 -BuildConfig $(Configuration)&quot;" />
</Target>

<Target Name="GenerateHelp" Condition="'$(SkipHelp)' == 'false'">
<Message Importance="high" Text="Running help generation..." />
<MakeDir Directories="$(StaticAnalysisOutputDirectory)" />
Expand All @@ -225,7 +233,7 @@
</Target>

<!-- Everything except Publish -->
<Target Name="Full" DependsOnTargets="Clean;Build;OnPremChecks;GenerateHelp;StaticAnalysis;Test" />
<Target Name="Full" DependsOnTargets="Clean;Build;OnPremChecks;CopyAboutTopics;GenerateHelp;StaticAnalysis;Test" />

<Target Name="StaticAnalysisBreakingChange" Condition="'$(RunStaticAnalysis)' == 'true'" DependsOnTargets="Build">
<Message Importance="high" Text="Running static analysis for breaking change..." />
Expand Down
50 changes: 50 additions & 0 deletions src/Accounts/Accounts/help/About/about_az.help.txt
@@ -0,0 +1,50 @@
About topic for Azure PowerShell - about_az

TOPIC

about_Az

SHORT DESCRIPTION

The Azure Az PowerShell module is a set of cmdlets for managing Azure
resources directly from the PowerShell command line and in PowerShell
scripts.

LONG DESCRIPTION

Azure PowerShell provides cross-platform cmdlets for managing Azure
services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and
supported versions of PowerShell 7.

The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}.

- {verb} is an approved PowerShell verb reflecting the corresponding HTTP
operation.

- {noun} matches or has a close equivalent to the name of the resource.

The cmdlets produce .NET objects that can be piped between commands
simplifying the sequencing of commands making Azure PowerShell a powerful
solution for scripting and automation purposes.

A PowerShell module is available for each Azure service. For convenience,
we provide a wrapper module named "Az" that comprises the stable modules.
Modules in preview must be installed independently or via the "AzPreview"
wrapper module.

Azure PowerShell is frequently updated to include bug fixes and service
updates. It is recommended to plan to update to the most recent version
regularly (a minimum of twice a year).

GETTING STARTED

1. Connect to Azure using Connect-AzAccount

2. Run your first command. For example, create a resource group in the
east US region.

New-AzResourceGroup -Name "MyResoureGroup" -location "eastus"

SEE ALSO

Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure
52 changes: 52 additions & 0 deletions src/Accounts/Accounts/help/About/about_az.md
@@ -0,0 +1,52 @@
# About topic for Azure PowerShell - about_az

## TOPIC

about_Az

## SHORT DESCRIPTION

The Azure Az PowerShell module is a set of cmdlets for managing Azure
resources directly from the PowerShell command line and in PowerShell
scripts.

## LONG DESCRIPTION

Azure PowerShell provides cross-platform cmdlets for managing Azure
services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1
and supported versions of PowerShell 7.

The Azure PowerShell cmdlets follow the naming convention
{verb}-Az{noun}.

- {verb} is an approved PowerShell verb reflecting the corresponding
HTTP operation.

- {noun} matches or has a close equivalent to the name of the
resource.

The cmdlets produce .NET objects that can be piped between commands
simplifying the sequencing of commands making Azure PowerShell a
powerful solution for scripting and automation purposes.

A PowerShell module is available for each Azure service. For
convenience, we provide a wrapper module named "Az" that comprises the
stable modules. Modules in preview must be installed independently or
via the "AzPreview" wrapper module.

Azure PowerShell is frequently updated to include bug fixes and service
updates. It is recommended to plan to update to the most recent version
regularly (a minimum of twice a year).

## GETTING STARTED

1. Connect to Azure using `Connect-AzAccount`

2. Run your first command. For example, create a resource group in the
east US region.
```powershell
New-AzResourceGroup -Name "MyResoureGroup" -location "eastus"
```
## SEE ALSO
Azure PowerShell documentation:
https://docs.microsoft.com/powershell/azure
1 change: 1 addition & 0 deletions src/Az.props
Expand Up @@ -47,6 +47,7 @@
<ItemGroup>
<None Update="Az.$(PsModuleName).psd1" CopyToOutputDirectory="PreserveNewest" />
<None Update="help\*.md" CopyToOutputDirectory="PreserveNewest" />
<None Update="help\About\*.help.txt" CopyToOutputDirectory="PreserveNewest" />
<None Update="*.ps1xml" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tools/CleanupBuild.ps1
Expand Up @@ -25,7 +25,7 @@ foreach ($path in $outputPaths)

Write-Verbose "Removing markdown help files and folders"
Get-ChildItem -Recurse -Path $path -Include *.md | Remove-Item -Force -Confirm:$false
Get-ChildItem -Directory -Include help -Recurse -Path $path | Remove-Item -Force -Confirm:$false -ErrorAction "Ignore"
Get-ChildItem -Directory -Include help -Recurse -Path $path | Remove-Item -Force -Recurse -Confirm:$false -ErrorAction "Ignore"

Write-Verbose "Removing unneeded web deployment dependencies"
$webdependencies = @("Microsoft.Web.Hosting.dll", "Microsoft.Web.Delegation.dll", "Microsoft.Web.Administration.dll", "Microsoft.Web.Deployment.Tracing.dll")
Expand Down
27 changes: 27 additions & 0 deletions tools/Docs/CopyAboutTopics.ps1
@@ -0,0 +1,27 @@
[CmdletBinding()]
Param(
[Parameter()]
[string]$BuildConfig = "Release"
)

function CopyAboutTopicsToCultureFolder {
param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$AboutFolder,
[Parameter(Mandatory = $true, Position = 1)]
[string]$CultureFolder
)
Write-Host "Copying about-documents from $AboutFolder to $CultureFolder"
Get-ChildItem -Filter *.help.txt -Path $AboutFolder | Copy-Item -Destination $CultureFolder
}

.($PSScriptRoot + "\..\PreloadToolDll.ps1")
$AboutFolders = Get-ChildItem -Include 'About' -Path "$PSScriptRoot\..\..\artifacts\$BuildConfig" -Recurse -Directory | where { -not [Tools.Common.Utilities.ModuleFilter]::IsAzureStackModule($_.FullName) }

foreach ($AboutFolder in $AboutFolders)
{
$ModuleFolder = $AboutFolder.Parent.Parent.FullName
$CultureFolder = Join-Path -Path $ModuleFolder -ChildPath "en-US"
New-Item -ItemType "directory" -Path $CultureFolder -Force
CopyAboutTopicsToCultureFolder $AboutFolder $CultureFolder
}
12 changes: 12 additions & 0 deletions tools/Docs/GenerateAboutTopicTxt.ps1
@@ -0,0 +1,12 @@
$aboutFileInputFullName = "C:\Azure\azure-powershell\src\Accounts\Accounts\help\About\about_az.md"
$aboutFileOutputFullName = "C:\Azure\azure-powershell\src\Accounts\Accounts\help\About\about_az.help.txt"

$pandocArgs = @(
"--from=gfm",
"--to=plain+multiline_tables",
"--columns=75",
"--output=$aboutFileOutputFullName",
"--quiet"
)

Get-Content $aboutFileInputFullName | pandoc $pandocArgs
2 changes: 1 addition & 1 deletion tools/HelpGeneration/HelpGeneration.psm1
Expand Up @@ -91,7 +91,7 @@ function Test-AzMarkdownHelp
$HelpFolder = Get-Item $HelpFolderPath
$Exceptions = Import-Csv "$SuppressedExceptionsPath\ValidateHelpIssues.csv"
[String[]]$errors = @()
$MarkdownFiles = Get-ChildItem -Path $HelpFolder
$MarkdownFiles = Get-ChildItem -Path $HelpFolder -Include "*.md"
$ModuleName = ($MarkdownFiles | where { $_.Name -notlike "*-*" }).Name -replace ".md",""
foreach ($file in $MarkdownFiles)
{
Expand Down

0 comments on commit 6b49b2c

Please sign in to comment.