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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to define and use parameter sets in advanced functions.
Locale: en-US
ms.date: 03/27/2024
ms.date: 03/26/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-5.1&WT.mc_id=ps-gethelp
title: about_Parameter_Sets
---
Expand Down Expand Up @@ -64,12 +64,23 @@ one unique parameter.
Parameters that don't have an assigned parameter set name belong to all
parameter sets.

## Reserved parameter set name

PowerShell reserves the parameter set name `__AllParameterSets` for special
handling.

- This name is the default name of the parameter set that when you don't
explicitly define a parameter set name.
- When you have muliple parameter sets, you can use this name to define a
parameter that belongs to all parameter sets.
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
`[CmdletBinding()]` attribute has no effect.

## Examples

The following example function counts the number lines, characters, and words
in a text file. Using parameters, you can specify which values you want
returned and which files you want to measure. There are four parameter sets
defined:
in a text file. Using parameters, you can specify the values you want returned
and the files you want to measure. There are four parameter sets defined:

- Path
- PathAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ more detailed test results, use the **Verbose** parameter.
This cmdlet works much like `NetDom.exe`. Both NetDom and `Test-ComputerSecureChannel` use the
**NetLogon** service to perform the actions.

> [!NOTE]
> This cmdlet only works on Domain Member computers. When you run it on Domain Controllers, it
> returns false positive errors. To verify and reset the secure channels for Domain Controllers,
> use `netdom.exe` or `nltest.exe`.

## EXAMPLES

### Example 1: Test a channel between the local computer and its domain
Expand Down Expand Up @@ -74,7 +79,8 @@ VERBOSE: "The secure channel between 'SERVER01' and 'net.fabrikam.com' is alive
```

This command uses the **Verbose** common parameter to request detailed messages about the operation.
For more information about **Verbose**, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
For more information about **Verbose**, see
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).

### Example 5: Test a connection before you run a script

Expand Down Expand Up @@ -170,7 +176,7 @@ Accept wildcard characters: False

### -WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.
Shows what would happen if the cmdlet runs. The cmdlet isn't run.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -188,7 +194,8 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down Expand Up @@ -218,3 +225,7 @@ This cmdlet returns `$true` if the connection is working correctly and `$false`
[Restart-Computer](Restart-Computer.md)

[Stop-Computer](Stop-Computer.md)

[Use Netdom.exe to reset machine account passwords of a Windows Server domain controller](/troubleshoot/windows-server/windows-security/use-netdom-reset-domain-controller-password)

[Nltest.exe](/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc731935(v=ws.11))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to define and use parameter sets in advanced functions.
Locale: en-US
ms.date: 03/27/2024
ms.date: 03/26/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.4&WT.mc_id=ps-gethelp
title: about_Parameter_Sets
---
Expand Down Expand Up @@ -64,12 +64,23 @@ one unique parameter.
Parameters that don't have an assigned parameter set name belong to all
parameter sets.

## Reserved parameter set name

PowerShell reserves the parameter set name `__AllParameterSets` for special
handling.

- This name is the default name of the parameter set that when you don't
explicitly define a parameter set name.
- When you have muliple parameter sets, you can use this name to define a
parameter that belongs to all parameter sets.
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
`[CmdletBinding()]` attribute has no effect.

## Examples

The following example function counts the number lines, characters, and words
in a text file. Using parameters, you can specify which values you want
returned and which files you want to measure. There are four parameter sets
defined:
in a text file. Using parameters, you can specify the values you want returned
and the files you want to measure. There are four parameter sets defined:

- Path
- PathAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to define and use parameter sets in advanced functions.
Locale: en-US
ms.date: 03/27/2024
ms.date: 03/26/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.5&WT.mc_id=ps-gethelp
title: about_Parameter_Sets
---
Expand Down Expand Up @@ -64,12 +64,23 @@ one unique parameter.
Parameters that don't have an assigned parameter set name belong to all
parameter sets.

## Reserved parameter set name

PowerShell reserves the parameter set name `__AllParameterSets` for special
handling.

- This name is the default name of the parameter set that when you don't
explicitly define a parameter set name.
- When you have muliple parameter sets, you can use this name to define a
parameter that belongs to all parameter sets.
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
`[CmdletBinding()]` attribute has no effect.

## Examples

The following example function counts the number lines, characters, and words
in a text file. Using parameters, you can specify which values you want
returned and which files you want to measure. There are four parameter sets
defined:
in a text file. Using parameters, you can specify the values you want returned
and the files you want to measure. There are four parameter sets defined:

- Path
- PathAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to define and use parameter sets in advanced functions.
Locale: en-US
ms.date: 03/27/2024
ms.date: 03/26/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.6&WT.mc_id=ps-gethelp
title: about_Parameter_Sets
---
Expand Down Expand Up @@ -64,12 +64,23 @@ one unique parameter.
Parameters that don't have an assigned parameter set name belong to all
parameter sets.

## Reserved parameter set name

PowerShell reserves the parameter set name `__AllParameterSets` for special
handling.

- This name is the default name of the parameter set that when you don't
explicitly define a parameter set name.
- When you have muliple parameter sets, you can use this name to define a
parameter that belongs to all parameter sets.
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
`[CmdletBinding()]` attribute has no effect.

## Examples

The following example function counts the number lines, characters, and words
in a text file. Using parameters, you can specify which values you want
returned and which files you want to measure. There are four parameter sets
defined:
in a text file. Using parameters, you can specify the values you want returned
and the files you want to measure. There are four parameter sets defined:

- Path
- PathAll
Expand Down
101 changes: 45 additions & 56 deletions reference/docs-conceptual/install/PowerShell-in-Docker.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,72 @@
---
description: How to use PowerShell that's preinstalled in a Docker image.
ms.date: 08/01/2024
description: How to use PowerShell in a Docker image.
ms.date: 03/11/2025
ms.devlang: powershell
ms.topic: conceptual
title: Using PowerShell in Docker
title: Use PowerShell in Docker
---

# Using PowerShell in Docker
# Use PowerShell in Docker

We publish Docker images with PowerShell preinstalled. This article shows you how to get
started using PowerShell in the Docker container.
The .NET team publishes Docker images with PowerShell preinstalled. This article shows you how to
get started using PowerShell in the Docker container.

## Finding available images
## Find available images

The released images require Docker 17.05 or newer. It's also expected that you are able to run
Docker without `sudo` or local administrative rights. Please follow Docker's official
[instructions][01] to install `docker` correctly.
These images require Docker 17.05 or newer. Also, you must be able to run Docker without `sudo` or
local administrative rights. For install instructions, see Docker's official [documentation][02].

The release containers derive from the official distribution image, then install dependencies, and
finally install the PowerShell package.
The .NET team publishes several Docker images designed for different development scenarios. Only the
image for the .NET SDK contains PowerShell. For more information, see
[Official .NET Docker images][01].

These containers live at [Microsoft Artifact Registry][05].
## Use PowerShell in a container

For more information about these Docker images, visit the [PowerShell-Docker][02] repository on
GitHub.

## Using PowerShell in a container

The following steps show the Docker commands required to download the image containing the latest
available stable version of PowerShell and start an interactive PowerShell session.
The following command downloads the image containing the latest available stable versions of the
.NET SDK and PowerShell.

```console
docker run -it mcr.microsoft.com/powershell
docker pull mcr.microsoft.com/dotnet/sdk:9.0
```

Use the following command to download and run the image containing the latest available preview
version of PowerShell.

```console
docker run -it mcr.microsoft.com/powershell:preview
```
> [!IMPORTANT]
> The Docker images are built from official operating system (OS) images provide by the OS
> distributor. These images may not have the latest security updates. Microsoft recommends that you
> update the OS packages to the latest version to ensure the latest security updates are applied.

### Remove the image when no longer needed

The following command is used to delete the Docker image when you no longer need it.
Use the following command to start an interactive PowerShell session in the container.

```console
docker rmi mcr.microsoft.com/powershell
docker run -it mcr.microsoft.com/dotnet/sdk:9.0 pwsh
```

## Legal and Licensing
To download and run the latest Long Term Support (LTS) version of PowerShell, change the image name
to `mcr.microsoft.com/dotnet/sdk:8.0`. When you use these image tags, Docker downloads the
appropriate image for your host operating system. If you want an image for a specific operating
system, you can specify the operating system in the image tag. See the
[Microsoft Artifact Registry][07] for a list of available tags.

PowerShell is licensed under the [MIT license][03].
- For more information about tags, the [Supported tag policy][06]
- For more information about supported operating systems, see the [Supported platforms policy][05]

### Windows Docker file and image licenses
## Support lifecycle

By requesting and using the Container OS Image for Windows containers, you acknowledge, understand,
and consent to the Supplemental License Terms available on Docker hub:
The [.NET support policy][03] defines how these images are supported. These images are provided for
development and testing purposes only. If you need a production-ready image, you should build your
own images. For more information about these Docker images, visit the [dotnet-docker][04] repository
on GitHub.

- [Window Server Core][06]
- [Nano Server][04]
The images previously published by the PowerShell team will be marked as deprecated in the Microsoft
Container Registry (MCR).

### Telemetry
## Telemetry

By default, PowerShell collects limited telemetry without personally identifiable information to
help aid development of future versions of PowerShell. To opt-out of sending telemetry, create an
environment variable called `POWERSHELL_TELEMETRY_OPTOUT` set to a value of `1` before starting
PowerShell from the installed location. The telemetry we collect falls under the
[Microsoft Privacy Statement][07].
By default, PowerShell collects limited telemetry without personal data to help aid development of
future versions of PowerShell. To opt-out of sending telemetry, create an environment variable
called `POWERSHELL_TELEMETRY_OPTOUT` set to a value of `1` before starting PowerShell from the
installed location. The telemetry we collect falls under the [Microsoft Privacy Statement][08].

<!-- link references -->
[01]: https://docs.docker.com/engine/installation/
[02]: https://github.com/PowerShell/PowerShell-Docker
[03]: https://github.com/PowerShell/PowerShell/tree/master/LICENSE.txt
[04]: https://mcr.microsoft.com/product/windows/nanoserver
[05]: https://mcr.microsoft.com/product/powershell
[06]: https://mcr.microsoft.com/product/windows/servercore
[07]: https://privacy.microsoft.com/privacystatement/
[01]: /dotnet/architecture/microservices/net-core-net-framework-containers/official-net-docker-images
[02]: https://docs.docker.com/engine/installation/
[03]: https://github.com/dotnet/core/blob/main/support.md
[04]: https://github.com/dotnet/dotnet-docker
[05]: https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md
[06]: https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md
[07]: https://mcr.microsoft.com/en-us/artifact/mar/dotnet/sdk/about
[08]: https://privacy.microsoft.com/privacystatement/
2 changes: 1 addition & 1 deletion reference/docs-conceptual/learn/ps101/06-flow-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ In this chapter, you learned about the different types of loops that exist in Po

## References

- [ForEach-Object][ForEach-Object]
- [ForEach-Object][foreach-object]
- [about_Foreach][about-foreach]
- [about_For][about-for]
- [about_Do][about-do]
Expand Down
Loading