Skip to content

Commit 83e24ac

Browse files
authored
Refreshed style guide (#3478)
1 parent 3f15e95 commit 83e24ac

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

docs-conceptual/azps-12.5.0/azps-docs-style-guide.md

+42-35
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,33 @@ title: Azure PowerShell docs style guide
99

1010
# Azure PowerShell docs style guide
1111

12-
The following checklist helps ensure scripts and samples that use Azure PowerShell are consistent.
12+
This article focuses on Azure PowerShell conceptual and reference content available in the following
13+
GitHub repositories:
14+
15+
- [azure-docs-powershell][azps-docs-repo]
16+
- [azure-powershell][azps-source-repo]
1317

1418
## Version
1519

16-
Because most Microsoft Learn documentation doesn't support multiple product versions, the latest
17-
version of the Az PowerShell module should be referenced in articles. Documentation referencing a
18-
specific version number can become outdated because Azure PowerShell is updated monthly. Only the
19-
last two major versions of the Az PowerShell module are supported by Microsoft. For more
20-
information, see [Azure PowerShell support lifecycle](azureps-support-lifecycle.md).
20+
Unlike most Microsoft Learn documentation, the Azure PowerShell content in the
21+
**azure-docs-powershell** repository is maintained for multiple supported versions. For details on
22+
supported versions, see [Azure PowerShell support lifecycle][support-lifecycle].
2123

22-
If cmdlets used in the article are part of a preview module, that module must be explicitly
23-
installed because only GA modules ship as part of the Az PowerShell module.
24+
If an article references cmdlets from a preview module, that module must be explicitly installed
25+
unless the **AzPreview** module is already installed. This is because only generally available (GA)
26+
modules are included with the **Az** PowerShell module.
2427

2528
> [!IMPORTANT]
26-
> Do not use commands from the AzureRM PowerShell module in articles. AzureRM is deprecated.
29+
> Don't use commands from the **AzureRM** PowerShell module in articles. **AzureRM** is deprecated.
2730
2831
## Prerequisites
2932

30-
### Include files
31-
32-
- Use one of three Azure PowerShell include files when the article contains commands from the Az
33-
PowerShell module.
34-
- [No header](https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/azure-powershell-requirements-no-header.md)
35-
- [H2 header](https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/azure-powershell-requirements.md)
36-
- [H3 header](https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/azure-powershell-requirements-h3.md)
37-
- Always place Azure service prerequisites first, followed by Azure PowerShell and Azure Cloud Shell
38-
instructions. For example, "You must have `Microsoft.Authorization/roleAssignments/write`
39-
permissions to complete the instructions in this tutorial" should come before
40-
`azure-powershell-requirements-no-header.md`.
33+
Always place Azure service prerequisites first, followed by Azure PowerShell and Azure Cloud Shell
34+
instructions. For example, "You must have `Microsoft.Authorization/roleAssignments/write`
35+
permissions to complete the instructions in this tutorial" should come first.
4136

42-
If all commands aren't compatible with Cloud Shell, don't use the include files. Instead, instruct
43-
the user to install Azure PowerShell locally. Include the following text in an H2 Prerequisites
44-
section.
37+
If all commands aren't compatible with Cloud Shell, instruct the user to install the **Az**
38+
PowerShell module locally. Include the following text in an H2 Prerequisites section.
4539

4640
```markdown
4741
- This tutorial requires that you run Azure PowerShell locally:
@@ -56,31 +50,40 @@ Follow the [PowerShell-Docs style guide](/powershell/scripting/community/contrib
5650
and [Editor's checklist](/powershell/scripting/community/contributing/editorial-checklist)
5751
for formatting command syntax elements in Azure PowerShell documentation.
5852

59-
The first mention of a cmdlet name should be a link to the cmdlet documentation, for example:
53+
Don't link to cmdlet documentation when mentioning cmdlet names in a paragraph. Instead, surround
54+
the cmdlet name with backticks, which is styling for inline code (``). Add a references section
55+
towards the bottom of the page. List the cmdlet names in the references section and link to their
56+
associated reference article. For example:
6057

6158
```markdown
62-
The [Get-AzVM](/powershell/module/az.compute/get-azvm) cmdlet uses the **Location** parameter to ...
59+
This is an example of using the `Connect-AzAccount` and `Get-AzVM` cmdlets within a
60+
paragraph.
61+
62+
## References
63+
64+
- [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount)
65+
- [Get-AzVM](/powershell/module/az.compute/get-azvm)
6366
```
6467

6568
> [!NOTE]
66-
> Do not format text inside the brackets of a hyperlink. For more information about linking to
69+
> Don't format text inside the brackets of a hyperlink. For more information about linking to
6770
> Azure PowerShell content, see
6871
> [Linking to other documents](/powershell/scripting/community/contributing/editorial-checklist#linking-to-other-documents).
6972
7073
## Parameter order
7174

7275
Parameters for an Azure PowerShell cmdlet should appear in the order defined by the cmdlet help. A
7376
cmdlet can have multiple ways to provide the required parameters. When it does, follow the parameter
74-
set for the usage you're demonstrating. An example of a cmdlet with multiple ways to invoke it is
75-
[Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount).
77+
set for the usage you're demonstrating. `Connect-AzAccount` is an example of a cmdlet with multiple
78+
ways to invoke it.
7679

7780
## Variables
7881

7982
Avoid reusing variables across multiple code blocks.
8083

81-
The reader may complete the article steps in different sessions. Using variables across code blocks
82-
may cause errors if they're not set correctly. If you must use the variables across steps, make it
83-
clear that variables are reused in later steps.
84+
The reader might complete the article steps in different sessions. Using variables across code
85+
blocks might cause errors if they're not set correctly. If you must use the variables across steps,
86+
make it clear that variables are reused in later steps.
8487

8588
## Randomize passwords for new resources
8689

@@ -108,20 +111,20 @@ Use `Get-Random` to add a random number to a name, for example:
108111
$newAcrName = "myacr-$(Get-Random)"
109112
```
110113

111-
## Interactive code snippets (Try It)
114+
## Interactive code snippets
112115

113-
### When to use Try It
116+
### When to use interactive code snippets
114117

115118
If Cloud Shell supports _every_ Azure PowerShell command in your article, tag your code blocks with
116-
`azurepowershell-interactive` to add the _Try It_ button to the snippets:
119+
`azurepowershell-interactive` to add the _Open Cloud Shell_ button to the snippets:
117120

118121
````
119122
```azurepowershell-interactive
120123
Get-AzResourceGroup | Select-Object -Property ResourceGroupName, Location
121124
```
122125
````
123126

124-
### When NOT to use Try It
127+
### When NOT to use interactive code snippets
125128

126129
Don't use `azurepowershell-interactive` if your article includes _any_ Azure PowerShell commands
127130
that don't work in Cloud Shell. Use `azurepowershell` only. For example, the `Install-AzAksCliTool`
@@ -143,3 +146,7 @@ Because users are already authenticated when logging into Cloud Shell, don't use
143146

144147
See [Migrate Azure PowerShell from AzureRM to Az](migrate-from-azurerm-to-az.md) for information on
145148
how to update commands that use the AzureRM PowerShell module to the Az PowerShell module.
149+
150+
[azps-docs-repo]: https://github.com/MicrosoftDocs/azure-docs-powershell
151+
[azps-source-repo]: https://github.com/Azure/azure-powershell
152+
[support-lifecycle]: azureps-support-lifecycle.md

0 commit comments

Comments
 (0)