@@ -9,39 +9,33 @@ title: Azure PowerShell docs style guide
9
9
10
10
# Azure PowerShell docs style guide
11
11
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 ]
13
17
14
18
## Version
15
19
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 ] .
21
23
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.
24
27
25
28
> [ !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.
27
30
28
31
## Prerequisites
29
32
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.
41
36
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.
45
39
46
40
``` markdown
47
41
- This tutorial requires that you run Azure PowerShell locally:
@@ -56,31 +50,40 @@ Follow the [PowerShell-Docs style guide](/powershell/scripting/community/contrib
56
50
and [ Editor's checklist] ( /powershell/scripting/community/contributing/editorial-checklist )
57
51
for formatting command syntax elements in Azure PowerShell documentation.
58
52
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:
60
57
61
58
``` 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)
63
66
```
64
67
65
68
> [ !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
67
70
> Azure PowerShell content, see
68
71
> [ Linking to other documents] ( /powershell/scripting/community/contributing/editorial-checklist#linking-to-other-documents ) .
69
72
70
73
## Parameter order
71
74
72
75
Parameters for an Azure PowerShell cmdlet should appear in the order defined by the cmdlet help. A
73
76
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 .
76
79
77
80
## Variables
78
81
79
82
Avoid reusing variables across multiple code blocks.
80
83
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.
84
87
85
88
## Randomize passwords for new resources
86
89
@@ -108,20 +111,20 @@ Use `Get-Random` to add a random number to a name, for example:
108
111
$newAcrName = "myacr-$(Get-Random)"
109
112
```
110
113
111
- ## Interactive code snippets (Try It)
114
+ ## Interactive code snippets
112
115
113
- ### When to use Try It
116
+ ### When to use interactive code snippets
114
117
115
118
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:
117
120
118
121
````
119
122
```azurepowershell-interactive
120
123
Get-AzResourceGroup | Select-Object -Property ResourceGroupName, Location
121
124
```
122
125
````
123
126
124
- ### When NOT to use Try It
127
+ ### When NOT to use interactive code snippets
125
128
126
129
Don't use ` azurepowershell-interactive ` if your article includes _ any_ Azure PowerShell commands
127
130
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
143
146
144
147
See [ Migrate Azure PowerShell from AzureRM to Az] ( migrate-from-azurerm-to-az.md ) for information on
145
148
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