Skip to content

Commit 3c39ac8

Browse files
authored
Markdown and PS Styles (#11732)
1 parent 83832b3 commit 3c39ac8

13 files changed

Lines changed: 140 additions & 99 deletions

reference/7.5/Microsoft.PowerShell.Core/About/About.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ Describes the attribute that makes a function work like a compiled cmdlet.
223223

224224
### [about_Functions_OutputTypeAttribute](about_Functions_OutputTypeAttribute.md)
225225

226-
Describes an attribute that reports the type of object that the function returns.
226+
Describes an attribute that reports the type of object that the function
227+
returns.
227228

228229
### [about_Functions](about_Functions.md)
229230

reference/7.5/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ PowerShell concurrently runs commands and scripts through jobs. There are three
2121
jobs types provided by PowerShell to support concurrency.
2222

2323
- `RemoteJob` - Commands and scripts run in a remote session. For information,
24-
see [about_Remote_Jobs](about_Remote_Jobs.md).
24+
see [about_Remote_Jobs][01].
2525
- `BackgroundJob` - Commands and scripts run in a separate process on the local
26-
machine. For more information, see [about_Jobs](about_Jobs.md).
26+
machine. For more information, see [about_Jobs][02].
2727
- `PSTaskJob` or `ThreadJob` - Commands and scripts run in a separate thread
2828
within the same process on the local machine.
2929

@@ -46,10 +46,9 @@ faster and use fewer resources than the other job types.
4646
There are two ways work around this situation:
4747

4848
1. Use `Invoke-Command` to create jobs that run in disconnected sessions. For
49-
more information, see [about_Remote_Jobs](about_Remote_Jobs.md).
49+
more information, see [about_Remote_Jobs][01].
5050
1. Use `Start-Process` to create a new process rather than a job. For more
51-
information, see
52-
[Start-Process](xref:Microsoft.PowerShell.Management.Start-Process).
51+
information, see [Start-Process][03].
5352

5453
## How to start and manage thread-based jobs
5554

@@ -59,7 +58,7 @@ There are two ways to start thread-based jobs:
5958
- `ForEach-Object -Parallel -AsJob` - the parallel feature was added in
6059
PowerShell 7.0
6160

62-
Use the same **Job** cmdlets described in [about_Jobs](about_Jobs.md) to manage
61+
Use the same **Job** cmdlets described in [about_Jobs][02] to manage
6362
thread-based jobs.
6463

6564
### Using `Start-ThreadJob`
@@ -184,7 +183,7 @@ system logs. Since the script involves reading a number of logs, it makes sense
184183
to do the operations in parallel.
185184

186185
```powershell
187-
$logNames.count
186+
$logNames.Count
188187
10
189188
190189
Measure-Command {
@@ -277,14 +276,29 @@ NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
277276

278277
## See also
279278

280-
- [about_Job_Details](about_Job_Details.md)
281-
- [about_Remote_Jobs](about_Remote_Jobs.md)
282-
- [about_Thread_Jobs](about_Thread_Jobs.md)
283-
- [about_PSSessions](about_PSSessions.md)
284-
- [about_Remote](about_Remote.md)
285-
- [Get-Job](xref:Microsoft.PowerShell.Core.Get-Job)
286-
- [Receive-Job](xref:Microsoft.PowerShell.Core.Receive-Job)
287-
- [Remove-Job](xref:Microsoft.PowerShell.Core.Remove-Job)
288-
- [Start-Job](xref:Microsoft.PowerShell.Core.Start-Job)
289-
- [Stop-Job](xref:Microsoft.PowerShell.Core.Stop-Job)
290-
- [Wait-Job](xref:Microsoft.PowerShell.Core.Wait-Job)
279+
- [about_Job_Details][04]
280+
- [about_Remote_Jobs][01]
281+
- [about_Thread_Jobs][05]
282+
- [about_PSSessions][06]
283+
- [about_Remote][07]
284+
- [Get-Job][08]
285+
- [Receive-Job][09]
286+
- [Remove-Job][10]
287+
- [Start-Job][11]
288+
- [Stop-Job][12]
289+
- [Wait-Job][13]
290+
291+
<!-- link references -->
292+
[01]: about_Remote_Jobs.md
293+
[02]: about_Jobs.md
294+
[03]: xref:Microsoft.PowerShell.Management.Start-Process
295+
[04]: about_Job_Details.md
296+
[05]: about_Thread_Jobs.md
297+
[06]: about_PSSessions.md
298+
[07]: about_Remote.md
299+
[08]: xref:Microsoft.PowerShell.Core.Get-Job
300+
[09]: xref:Microsoft.PowerShell.Core.Receive-Job
301+
[10]: xref:Microsoft.PowerShell.Core.Remove-Job
302+
[11]: xref:Microsoft.PowerShell.Core.Start-Job
303+
[12]: xref:Microsoft.PowerShell.Core.Stop-Job
304+
[13]: xref:Microsoft.PowerShell.Core.Wait-Job

reference/7.5/Microsoft.PowerShell.Core/About/about_Trap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ however, the `trap` statement is outside the function. PowerShell doesn't go
366366
back into the function after the `trap` statement runs.
367367

368368
> [!CAUTION]
369-
> When multiple traps are defined for the same error condition, the first `trap`
370-
> defined lexically (highest in the script block) is used.
369+
> When multiple traps are defined for the same error condition, the first
370+
> `trap` defined lexically (highest in the script block) is used.
371371
372372
In the following example, only the `trap` with `whoops 1` runs.
373373

reference/7.5/Microsoft.PowerShell.Core/About/about_Try_Catch_Finally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ try {
255255
"An error occurred that could not be resolved."
256256
} finally {
257257
$wc.Dispose()
258-
if (Test-Path $tempPath) { Remove-item $tempFile }
258+
if (Test-Path $tempPath) { Remove-Item $tempFile }
259259
}
260260
```
261261

reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Conversion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ For more information, see [about_Comparison_Operators][05].
528528
[05]: about_Comparison_Operators.md
529529
[06]: about_Functions_Advanced.md
530530
[07]: about_Numeric_Literals.md
531-
[08]: about_parameter_binding.md
532-
[09]: about_preference_variables.md#ofs
531+
[08]: about_Parameter_Binding.md
532+
[09]: about_Preference_Variables.md#ofs
533533
[10]: about_Types.ps1xml.md
534534
[11]: https://stackoverflow.com/questions/76241804/how-does-powershell-split-consecutive-strings-not-a-single-letter
535535
[12]: xref:Microsoft.PowerShell.Utility.Update-TypeData

reference/7.5/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ data to a PowerShell session.
2525

2626
This topic describes `Types.ps1xml` files. For more information about using the
2727
`Update-TypeData` cmdlet to add dynamic extended type data to the current
28-
session see
29-
[Update-TypeData](xref:Microsoft.PowerShell.Utility.Update-TypeData).
28+
session see [Update-TypeData][01].
3029

3130
## About extended type data
3231

@@ -47,8 +46,8 @@ Sunday, January 29, 2012 9:43:57 AM
4746
```
4847

4948
You won't find the **DateTime** property in the description of the
50-
[System.DateTime](/dotnet/api/system.datetime) structure, because PowerShell
51-
adds the property and it is visible only in PowerShell.
49+
[System.DateTime][02] structure, because PowerShell adds the property and it is
50+
visible only in PowerShell.
5251

5352
PowerShell internally defines a default set of extended types. This type
5453
information is loaded in every PowerShell session at startup. The **DateTime**
@@ -142,12 +141,12 @@ As a result, you can use either the **Count** property or the **Length**
142141
property of arrays in PowerShell. For example:
143142

144143
```powershell
145-
(1, 2, 3, 4).count
144+
(1, 2, 3, 4).Count
146145
4
147146
```
148147

149148
```powershell
150-
(1, 2, 3, 4).length
149+
(1, 2, 3, 4).Length
151150
4
152151
```
153152

@@ -177,9 +176,7 @@ the `Update-TypeData` command to your PowerShell profile.
177176
The `Types.ps1xml` files add properties and methods to all the instances of the
178177
objects of the specified .NET type in the affected PowerShell session. However,
179178
if you need to add properties or methods only to one instance of an object, use
180-
the `Add-Member` cmdlet.
181-
182-
For more information, see [Add-Member](xref:Microsoft.PowerShell.Utility.Add-Member).
179+
the `Add-Member` cmdlet. For more information, see [Add-Member][03].
183180

184181
## Example: Adding an Age member to FileInfo objects
185182

@@ -211,10 +208,8 @@ Save the follow XML code to the file `$PSHOME\MyTypes.ps1xml`.
211208

212209
Run `Update-TypeData` to add the new `Types.ps1xml` file to the current
213210
session. The command uses the **PrependData** parameter to place the new file
214-
in a precedence order higher than the original definitions.
215-
216-
For more information about `Update-TypeData`, see
217-
[Update-TypeData](xref:Microsoft.PowerShell.Utility.Update-TypeData).
211+
in a precedence order higher than the original definitions. For more
212+
information about `Update-TypeData`, see [Update-TypeData][01].
218213

219214
```powershell
220215
Update-TypeData -PrependPath $PSHOME\MyTypes.ps1xml
@@ -235,9 +230,8 @@ Get-ChildItem $PSHOME\pwsh.exe | Select-Object Age
235230

236231
## The XML in Types.ps1xml files
237232

238-
The full schema definition can be found in
239-
[Types.xsd](https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Types.xsd)
240-
in the PowerShell source code repository on GitHub.
233+
The full schema definition can be found in [Types.xsd][04] in the PowerShell
234+
source code repository on GitHub.
241235

242236
The `<Types>` tag encloses all of the types that are defined in the file. There
243237
should be only one `<Types>` tag.
@@ -518,7 +512,7 @@ objects.
518512
```
519513

520514
For more information, see the
521-
[Windows PowerShell Software Development Kit (SDK)](/powershell/scripting/developer/windows-powershell).
515+
[Windows PowerShell Software Development Kit (SDK)][05].
522516

523517
## Update-TypeData
524518

@@ -546,15 +540,27 @@ are added by running the `Update-TypeData` cmdlet cannot use method syntax.
546540
## Signing a Types.ps1xml file
547541

548542
To protect users of your `Types.ps1xml` file, you can sign the file using a
549-
digital signature. For more information, see
550-
[about_Signing](about_Signing.md).
543+
digital signature. For more information, see [about_Signing][06].
551544

552545
## See also
553546

554-
- [about_Signing](about_Signing.md)
555-
- [Copy-Item](xref:Microsoft.PowerShell.Management.Copy-Item)
556-
- [Copy-ItemProperty](xref:Microsoft.PowerShell.Management.Copy-ItemProperty)
557-
- [Get-Member](xref:Microsoft.PowerShell.Utility.Get-Member)
558-
- [Get-TypeData](xref:Microsoft.PowerShell.Utility.Get-TypeData)
559-
- [Remove-TypeData](xref:Microsoft.PowerShell.Utility.Remove-TypeData)
560-
- [Update-TypeData](xref:Microsoft.PowerShell.Utility.Update-TypeData)
547+
- [about_Signing][06]
548+
- [Copy-Item][07]
549+
- [Copy-ItemProperty][08]
550+
- [Get-Member][09]
551+
- [Get-TypeData][10]
552+
- [Remove-TypeData][11]
553+
- [Update-TypeData][01]
554+
555+
<!-- link references -->
556+
[01]: xref:Microsoft.PowerShell.Utility.Update-TypeData
557+
[02]: /dotnet/api/system.datetime
558+
[03]: xref:Microsoft.PowerShell.Utility.Add-Member
559+
[04]: https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Types.xsd
560+
[05]: /powershell/scripting/developer/windows-powershell
561+
[06]: about_Signing.md
562+
[07]: xref:Microsoft.PowerShell.Management.Copy-Item
563+
[08]: xref:Microsoft.PowerShell.Management.Copy-ItemProperty
564+
[09]: xref:Microsoft.PowerShell.Utility.Get-Member
565+
[10]: xref:Microsoft.PowerShell.Utility.Get-TypeData
566+
[11]: xref:Microsoft.PowerShell.Utility.Remove-TypeData

reference/7.5/Microsoft.PowerShell.Core/About/about_Updatable_Help.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ to specify a different filesystem location, but they can't exclude the
383383
> only the policy setting under **Computer Configuration** is effective. The
384384
> policy setting under **User Configuration** is ignored.
385385
386-
For more information, see
387-
[about_Group_Policy_Settings][04].
386+
For more information, see [about_Group_Policy_Settings][04].
388387

389388
## How to update help for non-standard modules
390389

reference/7.5/Microsoft.PowerShell.Core/About/about_Update_Notifications.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ information about setting environment variables, see
5252
PowerShell uses the following endpoints for determining the latest version
5353
available for each channel:
5454

55-
- `LTS`: <https://aka.ms/pwsh-buildinfo-lts>
56-
- `Stable`: <https://aka.ms/pwsh-buildinfo-stable>
57-
- `Preview`: <https://aka.ms/pwsh-buildinfo-preview>
55+
- `LTS`: [https://aka.ms/pwsh-buildinfo-lts][02]
56+
- `Stable`: [https://aka.ms/pwsh-buildinfo-stable][03]
57+
- `Preview`: [https://aka.ms/pwsh-buildinfo-preview][04]
5858

5959
The update notification doesn't provide any way to automatically update
6060
PowerShell. In the future, there may be more instructions or capabilities to
@@ -63,3 +63,6 @@ mechanism you used to install PowerShell to update it.
6363

6464
<!-- link references -->
6565
[01]: ../about/about_Environment_Variables.md
66+
[02]: https://aka.ms/pwsh-buildinfo-lts
67+
[03]: https://aka.ms/pwsh-buildinfo-stable
68+
[04]: https://aka.ms/pwsh-buildinfo-preview

0 commit comments

Comments
 (0)