Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion reference/7.5/Microsoft.PowerShell.Core/About/About.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ Describes the attribute that makes a function work like a compiled cmdlet.

### [about_Functions_OutputTypeAttribute](about_Functions_OutputTypeAttribute.md)

Describes an attribute that reports the type of object that the function returns.
Describes an attribute that reports the type of object that the function
returns.

### [about_Functions](about_Functions.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ PowerShell concurrently runs commands and scripts through jobs. There are three
jobs types provided by PowerShell to support concurrency.

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

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

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

## How to start and manage thread-based jobs

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

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

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

```powershell
$logNames.count
$logNames.Count
10

Measure-Command {
Expand Down Expand Up @@ -277,14 +276,29 @@ NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName

## See also

- [about_Job_Details](about_Job_Details.md)
- [about_Remote_Jobs](about_Remote_Jobs.md)
- [about_Thread_Jobs](about_Thread_Jobs.md)
- [about_PSSessions](about_PSSessions.md)
- [about_Remote](about_Remote.md)
- [Get-Job](xref:Microsoft.PowerShell.Core.Get-Job)
- [Receive-Job](xref:Microsoft.PowerShell.Core.Receive-Job)
- [Remove-Job](xref:Microsoft.PowerShell.Core.Remove-Job)
- [Start-Job](xref:Microsoft.PowerShell.Core.Start-Job)
- [Stop-Job](xref:Microsoft.PowerShell.Core.Stop-Job)
- [Wait-Job](xref:Microsoft.PowerShell.Core.Wait-Job)
- [about_Job_Details][04]
- [about_Remote_Jobs][01]
- [about_Thread_Jobs][05]
- [about_PSSessions][06]
- [about_Remote][07]
- [Get-Job][08]
- [Receive-Job][09]
- [Remove-Job][10]
- [Start-Job][11]
- [Stop-Job][12]
- [Wait-Job][13]

<!-- link references -->
[01]: about_Remote_Jobs.md
[02]: about_Jobs.md
[03]: xref:Microsoft.PowerShell.Management.Start-Process
[04]: about_Job_Details.md
[05]: about_Thread_Jobs.md
[06]: about_PSSessions.md
[07]: about_Remote.md
[08]: xref:Microsoft.PowerShell.Core.Get-Job
[09]: xref:Microsoft.PowerShell.Core.Receive-Job
[10]: xref:Microsoft.PowerShell.Core.Remove-Job
[11]: xref:Microsoft.PowerShell.Core.Start-Job
[12]: xref:Microsoft.PowerShell.Core.Stop-Job
[13]: xref:Microsoft.PowerShell.Core.Wait-Job
4 changes: 2 additions & 2 deletions reference/7.5/Microsoft.PowerShell.Core/About/about_Trap.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ however, the `trap` statement is outside the function. PowerShell doesn't go
back into the function after the `trap` statement runs.

> [!CAUTION]
> When multiple traps are defined for the same error condition, the first `trap`
> defined lexically (highest in the script block) is used.
> When multiple traps are defined for the same error condition, the first
> `trap` defined lexically (highest in the script block) is used.

In the following example, only the `trap` with `whoops 1` runs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ try {
"An error occurred that could not be resolved."
} finally {
$wc.Dispose()
if (Test-Path $tempPath) { Remove-item $tempFile }
if (Test-Path $tempPath) { Remove-Item $tempFile }
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ For more information, see [about_Comparison_Operators][05].
[05]: about_Comparison_Operators.md
[06]: about_Functions_Advanced.md
[07]: about_Numeric_Literals.md
[08]: about_parameter_binding.md
[09]: about_preference_variables.md#ofs
[08]: about_Parameter_Binding.md
[09]: about_Preference_Variables.md#ofs
[10]: about_Types.ps1xml.md
[11]: https://stackoverflow.com/questions/76241804/how-does-powershell-split-consecutive-strings-not-a-single-letter
[12]: xref:Microsoft.PowerShell.Utility.Update-TypeData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ data to a PowerShell session.

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

## About extended type data

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

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

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

```powershell
(1, 2, 3, 4).count
(1, 2, 3, 4).Count
4
```

```powershell
(1, 2, 3, 4).length
(1, 2, 3, 4).Length
4
```

Expand Down Expand Up @@ -177,9 +176,7 @@ the `Update-TypeData` command to your PowerShell profile.
The `Types.ps1xml` files add properties and methods to all the instances of the
objects of the specified .NET type in the affected PowerShell session. However,
if you need to add properties or methods only to one instance of an object, use
the `Add-Member` cmdlet.

For more information, see [Add-Member](xref:Microsoft.PowerShell.Utility.Add-Member).
the `Add-Member` cmdlet. For more information, see [Add-Member][03].

## Example: Adding an Age member to FileInfo objects

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

Run `Update-TypeData` to add the new `Types.ps1xml` file to the current
session. The command uses the **PrependData** parameter to place the new file
in a precedence order higher than the original definitions.

For more information about `Update-TypeData`, see
[Update-TypeData](xref:Microsoft.PowerShell.Utility.Update-TypeData).
in a precedence order higher than the original definitions. For more
information about `Update-TypeData`, see [Update-TypeData][01].

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

## The XML in Types.ps1xml files

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

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

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

## Update-TypeData

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

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

## See also

- [about_Signing](about_Signing.md)
- [Copy-Item](xref:Microsoft.PowerShell.Management.Copy-Item)
- [Copy-ItemProperty](xref:Microsoft.PowerShell.Management.Copy-ItemProperty)
- [Get-Member](xref:Microsoft.PowerShell.Utility.Get-Member)
- [Get-TypeData](xref:Microsoft.PowerShell.Utility.Get-TypeData)
- [Remove-TypeData](xref:Microsoft.PowerShell.Utility.Remove-TypeData)
- [Update-TypeData](xref:Microsoft.PowerShell.Utility.Update-TypeData)
- [about_Signing][06]
- [Copy-Item][07]
- [Copy-ItemProperty][08]
- [Get-Member][09]
- [Get-TypeData][10]
- [Remove-TypeData][11]
- [Update-TypeData][01]

<!-- link references -->
[01]: xref:Microsoft.PowerShell.Utility.Update-TypeData
[02]: /dotnet/api/system.datetime
[03]: xref:Microsoft.PowerShell.Utility.Add-Member
[04]: https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Types.xsd
[05]: /powershell/scripting/developer/windows-powershell
[06]: about_Signing.md
[07]: xref:Microsoft.PowerShell.Management.Copy-Item
[08]: xref:Microsoft.PowerShell.Management.Copy-ItemProperty
[09]: xref:Microsoft.PowerShell.Utility.Get-Member
[10]: xref:Microsoft.PowerShell.Utility.Get-TypeData
[11]: xref:Microsoft.PowerShell.Utility.Remove-TypeData
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ to specify a different filesystem location, but they can't exclude the
> only the policy setting under **Computer Configuration** is effective. The
> policy setting under **User Configuration** is ignored.

For more information, see
[about_Group_Policy_Settings][04].
For more information, see [about_Group_Policy_Settings][04].

## How to update help for non-standard modules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ information about setting environment variables, see
PowerShell uses the following endpoints for determining the latest version
available for each channel:

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

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

<!-- link references -->
[01]: ../about/about_Environment_Variables.md
[02]: https://aka.ms/pwsh-buildinfo-lts
[03]: https://aka.ms/pwsh-buildinfo-stable
[04]: https://aka.ms/pwsh-buildinfo-preview
Loading