You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,16 +14,7 @@ If you need to install platyPS on old versions of Windows (Windows 8.1 or Window
14
14
15
15
If you need to install platyPS on really old versions of Windows (a server running a product that lacks support for WMF 5.1 or its requirements), see the [Install platyPS on really old versions of Windows](#install-platyps-on-older-versions-of-windows) section at the end of this article.
16
16
17
-
**Notes**:
18
-
19
-
- You need platyPS v0.14.0 or later (released April 2019). If you have an earlier version of platyPS installed, close all open Windows PowerShell windows where the platyPS module is currently loaded and then run `Update-Module platyPS` from a new elevated Windows PowerShell window. Or, run the command `Remove-Module platyPS` and then run `Install-Module -Name platyPS -Scope CurrentUser` to get the current version.
20
-
21
-
For products where all cmdlets aren't baked into the product module itself (Exchange), be aware of the following issues observed in different platyPS versions:
22
-
23
-
- v0.14.0: Works fine.
24
-
- v0.14.1 and v0.14.2: Work fine, but produce bogus/nuisance errors using New-MarkdownHelp that can slow down operation. See this [platyPS GitHub issue](https://github.com/PowerShell/platyPS/issues/509) for details. This issue will likely be fixed in platyPS v2.0.0-Preview3.
25
-
26
-
If all cmdlets are baked into the product module itself, you likely won't have these issues, so it doesn't matter which version of platyPS you use.
17
+
You need platyPS v0.14.0 or later (released April 2019). If you have an earlier version of platyPS installed, close all open Windows PowerShell windows where the platyPS module is currently loaded and then run `Update-Module platyPS` from a new elevated Windows PowerShell window. Or, run the command `Remove-Module platyPS` and then run `Install-Module -Name platyPS -Scope CurrentUser` to get the current version.
27
18
28
19
## Step 2: Connect to the PowerShell environment that has the cmdlet
29
20
@@ -35,17 +26,23 @@ You probably know how to do this already, but the available workloads and connec
35
26
> Use `Upgrade-Module` and also `Uninstall-Module` depending on the module version you have installed.
36
27
37
28
- Exchange:
38
-
- Exchange Online: [Connect to Exchange Online PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell)
39
-
- Security & Compliance: [Connect to Security & Compliance PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-scc-powershell)
40
-
- Exchange Online Protection: [Connect to Exchange Online Protection PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-exchange-online-protection-powershell)
41
-
- Exchange Server: [Connect to Exchange servers using remote PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-exchange-servers-using-remote-powershell)
29
+
- Exchange Online PowerShell: [Connect to Exchange Online PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell)
- Exchange Server PowerShell: [Connect to Exchange servers using remote PowerShell](https://learn.microsoft.com/powershell/exchange/connect-to-exchange-servers-using-remote-powershell)
42
33
43
-
> [!NOTE]
44
-
> You might need to connect to the service in an elevated Windows PowerShell prompt (Teams and Exchange environments don't require this). The connection instructions article should contain this and other connection requirements.
34
+
> [!TIP]
35
+
> You might need to connect to the service in an elevated Windows PowerShell prompt (Teams and Exchange environments don't require an elevated Windows PowerShell prompt). The connection instructions article should plainly state this and other connection requirements.
36
+
>
37
+
> In Exchange and Security & Compliance PowerShell environments, the cmdlets that are available to you are controlled by role-based access control (RBAC). Most cmdlets and parameters are available to administrators by default, but some aren't (for example, the "Mailbox Search" and "Mailbox Import Export" roles.
45
38
>
46
-
> In Exchange environments, the cmdlets available to you are controlled by role-based access control (RBAC). Most cmdlets and parameters are available to administrators by default, but some aren't (for example, the "Mailbox Search" and "Mailbox Import Export" roles.
39
+
> Remote PowerShell connections are deprecated in Exchange Online PowerShell and Security & Compliance PowerShell in favor of REST API connections. For more information, see the following articles:
47
40
>
48
-
> In v3.0.0 or later of the EXO V3 module, you need to connect to Exchange Online in remote PowerShell mode using the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command. If you omit the _UseRPSSession_ switch and connect in REST API mode, the **Type** value of most parameters will be the incorrect and unhelpful `Object` or `Object[]` values. For more information about the EXO V3 module, see [Updates for version 3.0.0 (the EXO V3 module)](/powershell/exchange/exchange-online-powershell-v2#updates-for-version-300-the-exo-v3-module).
41
+
> -[REST API connections in the EXO V3 module](https://learn.microsoft.com/powershell/exchange/exchange-online-powershell-v2#rest-api-connections-in-the-exo-v3-module).
42
+
> -[Deprecation of Remote PowerShell in Exchange Online](https://techcommunity.microsoft.com/t5/exchange-team-blog/deprecation-of-remote-powershell-in-exchange-online-re-enabling/ba-p/3779692).
43
+
> -[Deprecation of Remote PowerShell (RPS) Protocol in Security & Compliance PowerShell](https://techcommunity.microsoft.com/t5/exchange-team-blog/deprecation-of-remote-powershell-rps-protocol-in-security-and/ba-p/3815432).
44
+
>
45
+
> REST API connections in the Exchange Online PowerShell V3 module incorrectly identify many parameter **Type** values as `Object` or `Object[]`. The true parameter type values are visible in product code.
49
46
50
47
## Step 3: Load platyPS in the PowerShell environment
51
48
@@ -99,83 +96,34 @@ For Microsoft Teams, the module name is always `MicrosoftTeams`.
99
96
100
97
Either way, take note of your module name. You'll need it in the next steps.
101
98
102
-
### Step 5: Store your PSSession in a variable
103
-
104
-
> [!NOTE]
105
-
> This step is required in products that use remote connections to retrieve cmdlets (Exchange). **If you're using a product where all of the cmdlets are baked into the module itself, you can skip this step**.
106
-
>
107
-
> As described earlier, you need to connect to Exchange Online in remote PowerShell mode using the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command. Although the [Get-ConnectionInformation](/powershell/module/exchange/get-connectioninformation) cmdlet is a reasonable replacement for Get-PSSession in REST API mode, the output doesn't work with the _Session_ parameter in **New-MarkdownHelp**. For more information about the EXO V3 module, see [Updates for version 3.0.0 (the EXO V3 module)](/powershell/exchange/exchange-online-powershell-v2#updates-for-version-300-the-exo-v3-module).
108
-
109
-
Do the following steps to store the remote PowerShell connection information to a variable:
110
-
111
-
1. Run the following command to find your session:
112
-
113
-
```powershell
114
-
Get-PSSession | Format-Table -Auto
115
-
```
116
-
117
-
The output will resemble this:
118
-
119
-
```powershell
120
-
Id Name ComputerName ComputerType State ConfigurationName Availability
1 ExchangeOnlineInternalSession_1 outlook.office365.com RemoteMachine Opened Microsoft.Exchange Available
123
-
```
124
-
125
-
> [!NOTE]
126
-
> If you see multiple sessions, either start over in a new PowerShell window or confirm the session you want to use. The first connection is 1, the second is 2, and so on.
127
-
128
-
2. Use the following syntax to store the session in a variable:
129
-
130
-
```powershell
131
-
$<VariableName> = Get-PSSession <SessionID>
132
-
```
133
-
134
-
For example, using the sample output in the previous step:
135
-
136
-
```powershell
137
-
$Session = Get-PSSession 1
138
-
```
139
-
140
-
The variable name you choose doesn't matter, but you'll use it in later steps.
141
-
142
-
### Step 6: Run platyPS to generate topic files
99
+
### Step 5: Run platyPS to generate topic files
143
100
144
101
You have two choices:
145
102
146
103
-**Dump _all_ cmdlets in the module/snap-in to files**: This is simple but could take a while, and you'll end up with dozens or possibly hundreds of cmdlet files you don't need. The basic syntax is:
-**Dump specific cmdlets to files**: This is a bit harder to set up, but the output is much quicker, and there are no extra topic files created. The basic syntax is:
-\<ModuleName\> is the value you found in [Step 4](#step-4-find-your-module-name) (for example, `tmp_byivwzpq.e1k` or `MicrosoftTeams`).
168
126
169
-
-\<PSSessionVariableName\> is the session variable from [Step 5](#step-5-store-your-pssession-in-a-variable) (for example, `$Session`) _and is required only if the cmdlets aren't baked into the module_.
170
-
171
-
> [!IMPORTANT]
172
-
> Failure to use the _Session_ parameter in environments that need it leads to weird results in the topic file output. For example:
173
-
>
174
-
> - Multiple syntax blocks/parameter sets aren't recognized and are collapsed into one big block.
175
-
> - The Type value is Object for all parameters.
176
-
> - The Required value is False for all parameters.
177
-
> - And more.
178
-
179
127
- If the \<Path\> ___location doesn't exist, it's created for you.
180
128
181
129
#### Dump all cmdlets in the module/snap-in to files
This example creates a topic file for the cmdlet named **Get-CoolFeature** in the Exchange Online PowerShell session where the session variable is `$Session`in the folder "C:\My Docs\ExO".
139
+
This example creates a topic file for the cmdlet named **Get-CoolFeature** in the Exchange Online PowerShell session in the folder "C:\My Docs\ExO".
This example creates topic files for the **Get-CoolFeature**, **New-CoolFeature**, **Remove-CoolFeature**, and **Set-CoolFeature** cmdlets from the Exchange Online session where the session variable is `$Session`in the folder C:\My Docs\ExO.
145
+
This example creates topic files for the **Get-CoolFeature**, **New-CoolFeature**, **Remove-CoolFeature**, and **Set-CoolFeature** cmdlets from the Exchange Online session in the folder C:\My Docs\ExO.
198
146
199
147
The first command stores the cmdlet names in a variable. The second command uses that variable to identify the cmdlets and write the output files.
Now that you have topic files for the new cmdlets, you can actually document them. The topics are plain text UTF-8 files that are formatted using [markdown](https://guides.github.com/features/mastering-markdown/). Office writers use [Visual Studio Code](https://code.visualstudio.com/) to edit topic files, but you can use Notepad or your favorite text editor.
212
158
@@ -242,7 +188,7 @@ schema: 2.0.0
242
188
243
189
-**external help file**: Defines which MAML/XML file the cmdlet help topic goes in for `Get-Help` at the command line. This value very product-specific, and the ___location is specified somewhere in product code. Some products (Skype) use only one XML file that's well-known and the same for all cmdlets; others (Exchange) use multiple XML files. See other topics for available values. Don't guess; a wrong value here will affect the availability of the help topic at the command line.
244
190
245
-
-**Module Name**: Not used in Exchange topics (remove it). For other products, this is the module name of the product.
191
+
-**Module Name**: In Exchange topics, this value is `ExchangeOnlineManagement` for those few cmdlets that are [baked into the Exchange Online PowerShell V3 module itself](https://learn.microsoft.com/powershell/exchange/exchange-online-powershell-v2#cmdlets-in-the-exchange-online-powershell-module). For other products, this is the module name of the product.
246
192
247
193
-**online version**: This is the URL of the topic. This URL value is what makes the `Get-Help <Cmdlet> -Online` command work, so it's very important.
Most of the attributes and values are generated automatically by platyPS. The ones that require manual intervention are:
281
227
228
+
-**Type**: In any environment, the values `Object` or `Object[]` are wrong. As previously described, REST API connections in the Exchange Online PowerShell V3 module incorrectly identify many parameter **Type** values as `Object` or `Object[]`. Other values like `String`, `Boolean`, and `DateTime` are detected correctly. The true parameter type values are visible in product code.
229
+
282
230
-**Applicable**: You need to add this attribute and value yourself. Notice the capital 'A'. See other topics for available values (same available values as the **applicable** attribute at the top of the topic). Don't invent new values here. The value **must** come from the list of predefined values.
283
231
284
232
-**Default value** and **Accept wildcard characters**: These attributes are present, but the values are never truthfully populated by platyPS **or any other PowerShell utility** (they're always None and False, respectively). You can correct the values if you think it's important. Otherwise, leave them as is.
285
233
286
-
> [!NOTE]
287
-
> If the **Type** value for parameters is `Object`, then something is wrong. In Exchange Online environments, see [Step 2](#step-2-connect-to-the-powershell-environment-that-has-the-cmdlet) for an explanation of remote PowerShell mode vs. REST API mode.
288
-
289
234
### Step 8: Add the new cmdlet topic files to the repository
290
235
291
-
When you're done editing the topics, upload them to GitHub. Note that you need to fork, upload your files to your fork, then submit a Pull Request.
236
+
When you're done editing the topics, upload them to GitHub. Note that you need to fork the repo, upload your files to your fork, and then submit a Pull Request.
292
237
293
238
1. Go to the correct ___location in the appropriate GitHub repository:
294
239
@@ -300,40 +245,32 @@ When you're done editing the topics, upload them to GitHub. Note that you need t
3. After you're done adding files, go to the **Propose file change** section at the bottom of the page:
252
+
3. After you're done adding files, go to the **Propose changes** section at the bottom of the page:
308
253
309
254
- A brief title is required. By default, the title is the name of the file, but you can change it.
310
-
- Optionally, you can enter more details in the **Add an optional extended description** box.
255
+
- Optionally, you can enter more details in the **Add an optional extended description** box. You should @ include the GitHub alias of someone who can review and approve your upload.
311
256
312
-
When you're ready, click the green **Propose file change** button.
257
+
When you're ready, click the green **Propose changes** button.
5. On the **Open a pull request** page that appears, click the green **Create pull request** button.
261
+
4. On the **Open a pull request** page that appears, click the green **Create pull request** button.
321
262
322
263

323
264
324
-
> [!NOTE]
325
-
>
326
-
> Your permissions in the repo determine what you see. People with no special privileges will see the **Propose file change** section and subsequent confirmation pages as described. People with permissions to create and approve their own pull requests will see a similar **Commit changes** section with extra options for creating a new branch and fewer confirmation pages.
327
-
>
328
-
> The point is: click any green buttons that are presented to you until there are no more.
265
+
5. That's it. There's nothing more for you to do.
329
266
330
267
### Step 9: Add the new cmdlets to the TOC file
331
268
332
269
Add the cmdlet to Table of Contents (TOC) file in the GitHub repo. TOC file is the name of the module. For example:
> Exchange also uses pseudo folders to organize cmdlets. You need to add any new cmdlets in the proper ___location in the file: <https://github.com/MicrosoftDocs/office-docs-powershell/blob/master/exchange/mapping/serviceMapping.json>.
338
275
339
276
- Office Web Apps: <https://github.com/MicrosoftDocs/office-docs-powershell/blob/master/officewebapps/officewebapps-ps/officewebapps/officewebapps.md>
@@ -348,30 +285,7 @@ Add the cmdlet to Table of Contents (TOC) file in the GitHub repo. TOC file is t
348
285
349
286
In the TOC file, you can fill in a description or remove the template text line. However, if you leave the template text line make sure it's in _exactly_ the right format so it won't render as a template text.
350
287
351
-
After you're done editing the TOC files:
352
-
353
-
1. Go to the **Propose file change** section at the bottom of the page:
354
-
355
-
- A brief title is required. By default, the title is the name of the file, but you can change it.
356
-
- Optionally, you can enter more details in the **Add an optional extended description** box.
357
-
358
-
When you're ready, click the green **Propose file change** button.
3. On the **Open a pull request** page that appears, click the green **Create pull request** button.
367
-
368
-

369
-
370
-
> [!NOTE]
371
-
>
372
-
> Your permissions in the repo determine what you see. People with no special privileges will see the **Propose file change** section and subsequent confirmation pages as described. People with permissions to create and approve their own pull requests will see a similar **Commit changes** section with extra options for creating a new branch and fewer confirmation pages.
373
-
>
374
-
> The point is: click any green buttons that are presented to you until there are no more.
288
+
The steps to edit and publish the TOC file are identical to modifying any existing topic. The instructions are [here](https://github.com/MicrosoftDocs/office-docs-powershell/blob/main/README.md) (you're starting at Step 4).
0 commit comments