From c97c99a9578384682d804e85cad401f093a1e9fe Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 4 Feb 2026 10:08:04 -0600 Subject: [PATCH 1/2] Add shebang to indicate bash requirement (#12732) * Add shebang to indicate bash requirement * Change value formatting to avoid overlocalization --- .../Set-Service.md | 21 ++++++++------- .../Set-Service.md | 27 ++++++++++--------- .../Set-Service.md | 18 ++++++------- .../Set-Service.md | 27 ++++++++++--------- .../docs-conceptual/install/install-alpine.md | 3 ++- .../docs-conceptual/install/install-debian.md | 4 ++- .../docs-conceptual/install/install-rhel.md | 3 ++- .../docs-conceptual/install/install-ubuntu.md | 4 ++- 8 files changed, 58 insertions(+), 49 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Set-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Set-Service.md index d48ccd53fce1..5f664f861576 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Set-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Service @@ -168,6 +168,7 @@ Name StartType spooler Automatic SQLWriter Automatic ``` + ## PARAMETERS ### -ComputerName @@ -291,18 +292,18 @@ Accept wildcard characters: False Sets the startup type of the service. The acceptable values for this parameter are: -- **Automatic** - The service is started or was started by the operating system, at system start-up. +- `Automatic` - The service is started or was started by the operating system, at system start-up. If an automatically started service depends on a manually started service, the manually started service is also started automatically at system startup. -- **Disabled** - The service is disabled and cannot be started by a user or application. -- **Manual** - The service is started only manually, by a user, using the Service Control Manager, +- `Disabled` - The service is disabled and cannot be started by a user or application. +- `Manual` - The service is started only manually, by a user, using the Service Control Manager, or by an application. -- **Boot** - Indicates that the service is a device driver started by the system loader. This +- `Boot` - Indicates that the service is a device driver started by the system loader. This value is valid only for device drivers. -- **System** - Indicates that the service is a device driver started by the 'IOInitSystem()' +- `System` - Indicates that the service is a device driver started by the 'IOInitSystem()' function. This value is valid only for device drivers. - The default value is **Automatic**. + The default value is `Automatic`. ```yaml Type: System.ServiceProcess.ServiceStartMode @@ -323,9 +324,9 @@ Specifies the status for the service. The acceptable values for this parameter are as follows: -- **Paused**. Suspends the service. -- **Running**. Starts the service. -- **Stopped**. Stops the service. +- `Paused`. Suspends the service. +- `Running`. Starts the service. +- `Stopped`. Stops the service. ```yaml Type: System.String diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md index d4aa97136491..533dcbb772ea 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Service @@ -224,18 +224,19 @@ SQLWriter Automatic ### -Credential -Specifies the account used by the service as the [Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). +Specifies the account used by the service as the +[Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. -Credentials are stored in a [PSCredential](/dotnet/api/system.management.automation.pscredential) -object and the password is stored as a [SecureString](/dotnet/api/system.security.securestring). +Credentials are stored in a [PSCredential](xref:System.Management.Automation.PSCredential) object +and the password is stored as a [SecureString](xref:System.Security.SecureString). > [!NOTE] > For more information about **SecureString** data protection, see -> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring). +> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring). This parameter was introduced in PowerShell 6.0. @@ -390,14 +391,14 @@ Specifies the start mode of the service. The acceptable values for this parameter are as follows: -- **Automatic** - The service is started or was started by the operating system, at system start-up. +- `Automatic` - The service is started or was started by the operating system, at system start-up. If an automatically started service depends on a manually started service, the manually started service is also started automatically at system startup. -- **AutomaticDelayedStart** - Starts shortly after the system boots. -- **Disabled** - The service is disabled and cannot be started by a user or application. -- **InvalidValue** - Has no effect. The cmdlet does not return an error but the StartupType of the +- `AutomaticDelayedStart` - Starts shortly after the system boots. +- `Disabled` - The service is disabled and cannot be started by a user or application. +- `InvalidValue` - Has no effect. The cmdlet does not return an error but the StartupType of the service is not changed. -- **Manual** - The service is started only manually, by a user, using the Service Control Manager, +- `Manual` - The service is started only manually, by a user, using the Service Control Manager, or by an application. ```yaml @@ -419,9 +420,9 @@ Specifies the status for the service. The acceptable values for this parameter are as follows: -- **Paused**. Suspends the service. -- **Running**. Starts the service. -- **Stopped**. Stops the service. +- `Paused`. Suspends the service. +- `Running`. Starts the service. +- `Stopped`. Stops the service. ```yaml Type: System.String diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md index c93ffa71dd2f..6194f1684cb9 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Service @@ -391,14 +391,14 @@ Specifies the start mode of the service. The acceptable values for this parameter are as follows: -- **Automatic** - The service is started or was started by the operating system, at system start-up. +- `Automatic` - The service is started or was started by the operating system, at system start-up. If an automatically started service depends on a manually started service, the manually started service is also started automatically at system startup. -- **AutomaticDelayedStart** - Starts shortly after the system boots. -- **Disabled** - The service is disabled and cannot be started by a user or application. -- **InvalidValue** - Has no effect. The cmdlet does not return an error but the StartupType of the +- `AutomaticDelayedStart` - Starts shortly after the system boots. +- `Disabled` - The service is disabled and cannot be started by a user or application. +- `InvalidValue` - Has no effect. The cmdlet does not return an error but the StartupType of the service is not changed. -- **Manual** - The service is started only manually, by a user, using the Service Control Manager, +- `Manual` - The service is started only manually, by a user, using the Service Control Manager, or by an application. ```yaml @@ -420,9 +420,9 @@ Specifies the status for the service. The acceptable values for this parameter are as follows: -- **Paused**. Suspends the service. -- **Running**. Starts the service. -- **Stopped**. Stops the service. +- `Paused`. Suspends the service. +- `Running`. Starts the service. +- `Stopped`. Stops the service. ```yaml Type: System.String diff --git a/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md index 4a02379e509c..6423ff27fe82 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Service @@ -224,18 +224,19 @@ SQLWriter Automatic ### -Credential -Specifies the account used by the service as the [Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). +Specifies the account used by the service as the +[Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. -Credentials are stored in a [PSCredential](/dotnet/api/system.management.automation.pscredential) -object and the password is stored as a [SecureString](/dotnet/api/system.security.securestring). +Credentials are stored in a [PSCredential](xref:System.Management.Automation.PSCredential) object +and the password is stored as a [SecureString](xref:System.Security.SecureString). > [!NOTE] > For more information about **SecureString** data protection, see -> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring). +> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring). This parameter was introduced in PowerShell 6.0. @@ -390,14 +391,14 @@ Specifies the start mode of the service. The acceptable values for this parameter are as follows: -- **Automatic** - The service is started or was started by the operating system, at system start-up. +- `Automatic` - The service is started or was started by the operating system, at system start-up. If an automatically started service depends on a manually started service, the manually started service is also started automatically at system startup. -- **AutomaticDelayedStart** - Starts shortly after the system boots. -- **Disabled** - The service is disabled and cannot be started by a user or application. -- **InvalidValue** - Has no effect. The cmdlet does not return an error but the StartupType of the +- `AutomaticDelayedStart` - Starts shortly after the system boots. +- `Disabled` - The service is disabled and cannot be started by a user or application. +- `InvalidValue` - Has no effect. The cmdlet does not return an error but the StartupType of the service is not changed. -- **Manual** - The service is started only manually, by a user, using the Service Control Manager, +- `Manual` - The service is started only manually, by a user, using the Service Control Manager, or by an application. ```yaml @@ -419,9 +420,9 @@ Specifies the status for the service. The acceptable values for this parameter are as follows: -- **Paused**. Suspends the service. -- **Running**. Starts the service. -- **Stopped**. Stops the service. +- `Paused`. Suspends the service. +- `Running`. Starts the service. +- `Stopped`. Stops the service. ```yaml Type: System.String diff --git a/reference/docs-conceptual/install/install-alpine.md b/reference/docs-conceptual/install/install-alpine.md index 8dc647ff8c77..b753be06321a 100644 --- a/reference/docs-conceptual/install/install-alpine.md +++ b/reference/docs-conceptual/install/install-alpine.md @@ -1,6 +1,6 @@ --- description: How to install PowerShell on Alpine Linux -ms.date: 12/15/2025 +ms.date: 02/04/2026 title: Install PowerShell on Alpine Linux --- # Install PowerShell on Alpine Linux @@ -28,6 +28,7 @@ to the package depends on the version of PowerShell you want to install. Then, in the terminal, execute the following shell commands to install PowerShell 7.4: ```sh +#!/bin/bash # install the requirements sudo apk add --no-cache \ ca-certificates \ diff --git a/reference/docs-conceptual/install/install-debian.md b/reference/docs-conceptual/install/install-debian.md index 6e19d7d47dee..9ec1c92a0378 100644 --- a/reference/docs-conceptual/install/install-debian.md +++ b/reference/docs-conceptual/install/install-debian.md @@ -1,6 +1,6 @@ --- description: How to install PowerShell on Debian Linux -ms.date: 12/15/2025 +ms.date: 02/04/2026 title: Install PowerShell on Debian --- # Install PowerShell on Debian @@ -31,6 +31,7 @@ Installing PowerShell from PMC is the preferred method of installation. > This script only works for supported versions of Debian. ```sh +#!/bin/bash ################################### # Prerequisites @@ -81,6 +82,7 @@ The following shell script downloads and installs the current release of PowerSh change the URL to download the version of PowerShell that you want to install. ```sh +#!/bin/bash ################################### # Prerequisites diff --git a/reference/docs-conceptual/install/install-rhel.md b/reference/docs-conceptual/install/install-rhel.md index d34abeae4a7d..da2bbad85afd 100644 --- a/reference/docs-conceptual/install/install-rhel.md +++ b/reference/docs-conceptual/install/install-rhel.md @@ -1,6 +1,6 @@ --- description: Information about installing PowerShell on Red Hat Enterprise Linux (RHEL) -ms.date: 12/15/2025 +ms.date: 02/04/2026 title: Installing PowerShell on Red Hat Enterprise Linux (RHEL) --- # Installing PowerShell on Red Hat Enterprise Linux (RHEL) @@ -31,6 +31,7 @@ Installing PowerShell from PMC is the preferred method of installation. > This script only works for supported versions of RHEL that are published to PMC. ```sh +#!/bin/bash ################################### # Prerequisites diff --git a/reference/docs-conceptual/install/install-ubuntu.md b/reference/docs-conceptual/install/install-ubuntu.md index 93ec2c3fb63b..d21bb245b137 100644 --- a/reference/docs-conceptual/install/install-ubuntu.md +++ b/reference/docs-conceptual/install/install-ubuntu.md @@ -1,6 +1,6 @@ --- description: Information about installing PowerShell on Ubuntu -ms.date: 12/15/2025 +ms.date: 02/04/2026 title: Installing PowerShell on Ubuntu --- # Installing PowerShell on Ubuntu @@ -31,6 +31,7 @@ Installing PowerShell from PMC is the preferred method of installation. > This script only works for supported versions of Ubuntu. ```sh +#!/bin/bash ################################### # Prerequisites @@ -93,6 +94,7 @@ The following shell script downloads and installs the current preview release of change the URL to download the version of PowerShell that you want to install. ```sh +#!/bin/bash ################################### # Prerequisites From ed225b58d599dfea708fe047fde3effe013d6cbb Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 4 Feb 2026 13:33:10 -0600 Subject: [PATCH 2/2] Add note about using Invoke-Command for remoting (#12735) * Add note about using Invoke-Command for remoting * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Mikey Lombardi (He/Him) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Mikey Lombardi (He/Him) --- .../Get-Service.md | 27 ++-- .../New-Service.md | 7 +- .../Remove-Service.md | 7 +- .../Restart-Service.md | 7 +- .../Resume-Service.md | 7 +- .../Set-Service.md | 5 + .../Start-Service.md | 15 +- .../Stop-Service.md | 13 +- .../Suspend-Service.md | 25 +-- .../Get-Service.md | 28 ++-- .../New-Service.md | 7 +- .../Remove-Service.md | 7 +- .../Restart-Service.md | 7 +- .../Resume-Service.md | 7 +- .../Set-Service.md | 5 + .../Start-Service.md | 7 +- .../Stop-Service.md | 7 +- .../Suspend-Service.md | 7 +- .../Get-Service.md | 27 ++-- .../New-Service.md | 7 +- .../Remove-Service.md | 7 +- .../Restart-Service.md | 7 +- .../Resume-Service.md | 7 +- .../Set-Service.md | 5 + .../Start-Service.md | 15 +- .../Stop-Service.md | 13 +- .../Suspend-Service.md | 25 +-- .../differences-from-windows-powershell.md | 143 +++++++++--------- 28 files changed, 303 insertions(+), 148 deletions(-) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Get-Service.md index 3768ce5e65ae..b3bf9cef37fd 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Get-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -108,10 +108,10 @@ Status is only one property of service objects. To see all of the properties, ty This example gets services that have dependent services. ```powershell -Get-Service | - Where-Object {$_.DependentServices} | +Get-Service | Where-Object {$_.DependentServices} | Format-List -Property Name, DependentServices, @{ - Label="NoOfDependentServices"; Expression={$_.DependentServices.Count} + Label = "NoOfDependentServices" + Expression = {$_.DependentServices.Count} } ``` @@ -140,7 +140,7 @@ This example shows that when you sort services in ascending order by the value o property, stopped services appear before running services. This happens because the value of **Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,9 +338,16 @@ PowerShell includes the following aliases for `Get-Service`: This cmdlet is only available on Windows platforms. -Beginning in PowerShell 6.0, the following properties are added to the **ServiceController** -objects: **UserName**, **Description**, **DelayedAutoStart**, **BinaryPathName**, and -**StartupType** . +PowerShell 6.0 introduced the following changes: + +- The **ServiceController** objects now include the following properties: + - **UserName** + - **Description** + - **DelayedAutoStart** + - **BinaryPathName** + - **StartupType** +- The command no longer includes the **ComputerName** parameter. To use this command on a remote computer, + use the `Invoke-Command` to target a remote system. This cmdlet can display services only when the current user has permission to see them. If this cmdlet does not display services, you might not have permission to see them. @@ -363,10 +370,12 @@ services. The **Status** property of a service is an enumerated value in which t statuses represent integer values. The sort is based on the integer value, not the name. `Running` appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [New-Service](New-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/New-Service.md b/reference/7.4/Microsoft.PowerShell.Management/New-Service.md index 36766b08d47a..f4a3e6707dea 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/New-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/New-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Service @@ -318,8 +318,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Remove-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Remove-Service.md index 719de2e77c08..9515b7df89c8 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Remove-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Remove-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/remove-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Service @@ -152,8 +152,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Like the other `*-Service` cmdlets, this command doesn't have a **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Restart-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Restart-Service.md index d98b30840dd7..bbd21f67730a 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Restart-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/03/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Restart-Service @@ -269,8 +269,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Resume-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Resume-Service.md index ca26dc4a16c8..ffea09cff0ef 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Resume-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/resume-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Resume-Service @@ -247,8 +247,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md index 533dcbb772ea..bb5c695046cd 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Service.md @@ -508,8 +508,13 @@ a command doesn't work correctly, you might not have the required permissions. To find a service's service name or display name, use `Get-Service`. The service names are in the **Name** column and the display names are in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md index 6c4bedaf320f..c4e33f0b2c26 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/15/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -92,9 +92,10 @@ existing file. This example shows how to start a service when the start type of the service is **Disabled**. -``` +```powershell PS> Start-Service tlntsvr -Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot start service TlntSvr on computer '.'. +Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot +start service TlntSvr on computer '.'. At line:1 char:14 + Start-Service <<<< tlntsvr @@ -256,7 +257,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 @@ -303,8 +305,13 @@ This cmdlet is only available on Windows platforms. work to do. When PowerShell starts a service that stops itself almost immediately, it displays the following message: `Service \ start failed.` +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Stop-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Stop-Service.md index 78137fe5e269..718d0a8750e6 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Stop-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Stop-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/27/2023 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -51,7 +51,7 @@ to stop. ### Example 1: Stop a service on the local computer -``` +```powershell PS C:\> Stop-Service -Name "sysmonlog" ``` @@ -59,7 +59,7 @@ This command stops the Performance Logs and Alerts (SysmonLog) service on the lo ### Example 2: Stop a service by using the display name -``` +```powershell PS C:\> Get-Service -DisplayName "telnet" | Stop-Service ``` @@ -69,7 +69,7 @@ an object that represents the Telnet service. The pipeline operator (`|`) pipes ### Example 3: Stop a service that has dependent services -``` +```powershell PS C:\> Get-Service -Name "iisadmin" | Format-List -Property Name, DependentServices PS C:\> Stop-Service -Name "iisadmin" -Force -Confirm ``` @@ -297,8 +297,13 @@ To find the service names and display names of the services on your system, type service names appear in the **Name** column and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md index 9e6c9d5686d4..78cb3e7462ae 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/suspend-service?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Suspend-Service @@ -50,16 +50,16 @@ object that represents the services that you want to suspend. ### Example 1: Suspend a service -``` -PS C:\> Suspend-Service -DisplayName "Telnet" +```powershell +Suspend-Service -DisplayName "Telnet" ``` This command suspends the Telnet service (Tlntsvr) service on the local computer. ### Example 2: Display what would happen if you suspend services -``` -PS C:\> Suspend-Service -Name lanman* -WhatIf +```powershell +Suspend-Service -Name lanman* -WhatIf ``` This command tells what would happen if you suspended the services that have a service name that @@ -67,8 +67,8 @@ starts with lanman. To suspend the services, rerun the command without the **Wha ### Example 3: Get and suspend a service -``` -PS C:\> Get-Service schedule | Suspend-Service +```powershell +Get-Service schedule | Suspend-Service ``` This command uses the `Get-Service` cmdlet to get an object that represents the Task Scheduler @@ -77,8 +77,10 @@ This command uses the `Get-Service` cmdlet to get an object that represents the ### Example 4: Suspend all services that can be suspended -``` -PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend-Service -Confirm +```powershell +Get-Service | + Where-Object {$_.CanPauseAndContinue -eq "True"} | + Suspend-Service -Confirm ``` This command suspends all of the services on the computer that can be suspended. It uses @@ -270,8 +272,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md index 2f1db88ac7ec..a3127ae01e74 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -73,8 +73,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string This example displays services with a display name that includes the word `network`. Searching the -display name finds network-related services even when the service name doesn't include `Net`, such -as xmlprov, the Network Provisioning Service. +display name finds network-related services even when the service name doesn't include `Net`, such as +xmlprov, the Network Provisioning Service. ```powershell Get-Service -DisplayName "*network*" @@ -110,8 +110,8 @@ This example gets services that have dependent services. ```powershell Get-Service | Where-Object {$_.DependentServices} | Format-List -Property Name, DependentServices, @{ - Label="NoOfDependentServices" - Expression={$_.DependentServices.Count} + Label = "NoOfDependentServices" + Expression = {$_.DependentServices.Count} } ``` @@ -338,9 +338,16 @@ PowerShell includes the following aliases for `Get-Service`: This cmdlet is only available on Windows platforms. -Beginning in PowerShell 6.0, the following properties are added to the **ServiceController** -objects: **UserName**, **Description**, **DelayedAutoStart**, **BinaryPathName**, and -**StartupType** . +PowerShell 6.0 introduced the following changes: + +- The **ServiceController** objects now include the following properties: + - **UserName** + - **Description** + - **DelayedAutoStart** + - **BinaryPathName** + - **StartupType** +- The command no longer includes the **ComputerName** parameter. To use this command on a remote computer, + use the `Invoke-Command` to target a remote system. This cmdlet can display services only when the current user has permission to see them. If this cmdlet does not display services, you might not have permission to see them. @@ -362,10 +369,13 @@ When you sort in ascending order by status value, `Stopped` services appear befo services. The **Status** property of a service is an enumerated value in which the names of the statuses represent integer values. The sort is based on the integer value, not the name. `Running` appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For -more information, see [ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). +more information, see +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [New-Service](New-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/New-Service.md b/reference/7.5/Microsoft.PowerShell.Management/New-Service.md index 8fe13bc9cbb4..7b577e5f33ce 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/New-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/New-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Service @@ -318,8 +318,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Remove-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Remove-Service.md index 52952ac0cf75..b1e7f33b1c3f 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Remove-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Remove-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/remove-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Service @@ -152,8 +152,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Like the other `*-Service` cmdlets, this command doesn't have a **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Restart-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Restart-Service.md index 0553b89e2d50..1728c297772c 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Restart-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/03/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Restart-Service @@ -269,8 +269,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Resume-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Resume-Service.md index ad5f582abb48..a9820ef75db8 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Resume-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/resume-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Resume-Service @@ -247,8 +247,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md index 6194f1684cb9..056c55406978 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md @@ -508,8 +508,13 @@ a command doesn't work correctly, you might not have the required permissions. To find a service's service name or display name, use `Get-Service`. The service names are in the **Name** column and the display names are in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md index 1e502222ba94..1d7f704f353f 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/15/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -305,8 +305,13 @@ This cmdlet is only available on Windows platforms. work to do. When PowerShell starts a service that stops itself almost immediately, it displays the following message: `Service \ start failed.` +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md index 0ced97c5daa3..a5915ea95496 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/27/2023 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -297,8 +297,13 @@ To find the service names and display names of the services on your system, type service names appear in the **Name** column and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md index 5b0e5e5882a7..9d3c1356859b 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/suspend-service?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Suspend-Service @@ -272,8 +272,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Get-Service.md index ad7fed86ba94..3976e8198296 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Get-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 03/20/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -108,10 +108,10 @@ Status is only one property of service objects. To see all of the properties, ty This example gets services that have dependent services. ```powershell -Get-Service | - Where-Object {$_.DependentServices} | +Get-Service | Where-Object {$_.DependentServices} | Format-List -Property Name, DependentServices, @{ - Label="NoOfDependentServices"; Expression={$_.DependentServices.Count} + Label = "NoOfDependentServices" + Expression = {$_.DependentServices.Count} } ``` @@ -140,7 +140,7 @@ This example shows that when you sort services in ascending order by the value o property, stopped services appear before running services. This happens because the value of **Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,9 +338,16 @@ PowerShell includes the following aliases for `Get-Service`: This cmdlet is only available on Windows platforms. -Beginning in PowerShell 6.0, the following properties are added to the **ServiceController** -objects: **UserName**, **Description**, **DelayedAutoStart**, **BinaryPathName**, and -**StartupType** . +PowerShell 6.0 introduced the following changes: + +- The **ServiceController** objects now include the following properties: + - **UserName** + - **Description** + - **DelayedAutoStart** + - **BinaryPathName** + - **StartupType** +- The command no longer includes the **ComputerName** parameter. To use this command on a remote computer, + use the `Invoke-Command` to target a remote system. This cmdlet can display services only when the current user has permission to see them. If this cmdlet does not display services, you might not have permission to see them. @@ -363,10 +370,12 @@ services. The **Status** property of a service is an enumerated value in which t statuses represent integer values. The sort is based on the integer value, not the name. `Running` appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [New-Service](New-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/New-Service.md b/reference/7.6/Microsoft.PowerShell.Management/New-Service.md index bfe080c21745..43f0eb8ea986 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/New-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/New-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Service @@ -318,8 +318,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Remove-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Remove-Service.md index 540ac084f30f..4eb53950254e 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Remove-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Remove-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/remove-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Service @@ -152,8 +152,13 @@ This cmdlet is only available on Windows platforms. To run this cmdlet, start PowerShell by using the **Run as administrator** option. +Like the other `*-Service` cmdlets, this command doesn't have a **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [Restart-Service](Restart-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Restart-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Restart-Service.md index edbedd67e04b..8b0033a5107b 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Restart-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/03/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Restart-Service @@ -269,8 +269,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Resume-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Resume-Service.md index ae8792abe14e..17211fd4f8e3 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Resume-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/resume-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Resume-Service @@ -247,8 +247,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md index 6423ff27fe82..c6bdb80b394e 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Set-Service.md @@ -508,8 +508,13 @@ a command doesn't work correctly, you might not have the required permissions. To find a service's service name or display name, use `Get-Service`. The service names are in the **Name** column and the display names are in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md index fdaa9445ae1d..cd9a39bb274d 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/15/2024 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -92,9 +92,10 @@ existing file. This example shows how to start a service when the start type of the service is **Disabled**. -``` +```powershell PS> Start-Service tlntsvr -Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot start service TlntSvr on computer '.'. +Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot +start service TlntSvr on computer '.'. At line:1 char:14 + Start-Service <<<< tlntsvr @@ -256,7 +257,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 @@ -303,8 +305,13 @@ This cmdlet is only available on Windows platforms. work to do. When PowerShell starts a service that stops itself almost immediately, it displays the following message: `Service \ start failed.` +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To run +`Start-Service` on a remote computer, use `Invoke-Command`. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Stop-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Stop-Service.md index aa93eb2f3393..527f96ce807e 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Stop-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Stop-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/27/2023 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -51,7 +51,7 @@ to stop. ### Example 1: Stop a service on the local computer -``` +```powershell PS C:\> Stop-Service -Name "sysmonlog" ``` @@ -59,7 +59,7 @@ This command stops the Performance Logs and Alerts (SysmonLog) service on the lo ### Example 2: Stop a service by using the display name -``` +```powershell PS C:\> Get-Service -DisplayName "telnet" | Stop-Service ``` @@ -69,7 +69,7 @@ an object that represents the Telnet service. The pipeline operator (`|`) pipes ### Example 3: Stop a service that has dependent services -``` +```powershell PS C:\> Get-Service -Name "iisadmin" | Format-List -Property Name, DependentServices PS C:\> Stop-Service -Name "iisadmin" -Force -Confirm ``` @@ -297,8 +297,13 @@ To find the service names and display names of the services on your system, type service names appear in the **Name** column and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md index b70c24403a73..25847d8f1a1f 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 12/12/2022 +ms.date: 02/04/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/suspend-service?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Suspend-Service @@ -50,16 +50,16 @@ object that represents the services that you want to suspend. ### Example 1: Suspend a service -``` -PS C:\> Suspend-Service -DisplayName "Telnet" +```powershell +Suspend-Service -DisplayName "Telnet" ``` This command suspends the Telnet service (Tlntsvr) service on the local computer. ### Example 2: Display what would happen if you suspend services -``` -PS C:\> Suspend-Service -Name lanman* -WhatIf +```powershell +Suspend-Service -Name lanman* -WhatIf ``` This command tells what would happen if you suspended the services that have a service name that @@ -67,8 +67,8 @@ starts with lanman. To suspend the services, rerun the command without the **Wha ### Example 3: Get and suspend a service -``` -PS C:\> Get-Service schedule | Suspend-Service +```powershell +Get-Service schedule | Suspend-Service ``` This command uses the `Get-Service` cmdlet to get an object that represents the Task Scheduler @@ -77,8 +77,10 @@ This command uses the `Get-Service` cmdlet to get an object that represents the ### Example 4: Suspend all services that can be suspended -``` -PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend-Service -Confirm +```powershell +Get-Service | + Where-Object { $_.CanPauseAndContinue } | + Suspend-Service -Confirm ``` This command suspends all of the services on the computer that can be suspended. It uses @@ -270,8 +272,13 @@ This cmdlet is only available on Windows platforms. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. +Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use +this command on a remote computer, use the `Invoke-Command` to target a remote system. + ## RELATED LINKS +[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) + [Get-Service](Get-Service.md) [New-Service](New-Service.md) diff --git a/reference/docs-conceptual/whats-new/differences-from-windows-powershell.md b/reference/docs-conceptual/whats-new/differences-from-windows-powershell.md index 77b318eb4d34..53e5666418f8 100644 --- a/reference/docs-conceptual/whats-new/differences-from-windows-powershell.md +++ b/reference/docs-conceptual/whats-new/differences-from-windows-powershell.md @@ -1,7 +1,7 @@ --- -ms.date: 04/02/2024 +ms.date: 02/04/2026 title: Differences between Windows PowerShell 5.1 and PowerShell 7.x -description: This article summarizes the differences and breaking changes from Windows PowerShell 5.1 and the current version of PowerShell that is based on .NET Core. +description: This article summarizes the differences and breaking changes from Windows PowerShell 5.1 and the current version of PowerShell that's based on .NET Core. --- # Differences between Windows PowerShell 5.1 and PowerShell 7.x @@ -16,9 +16,9 @@ and non-Windows platforms and the changes that stem from the differences between and .NET Core. This article summarizes the significant differences and breaking changes between Windows PowerShell -and the current version of PowerShell. This summary does not include new features or cmdlets that +and the current version of PowerShell. This summary doesn't include new features or cmdlets that have been added. Nor does this article discuss what changed between versions. The goal of this -article is to present the current state of PowerShell and how that is different from Windows +article is to present the current state of PowerShell and how that's different from Windows PowerShell. For a detailed discussion of changes between versions and the addition of new features, see the **What's New** articles for each version. @@ -41,12 +41,13 @@ Core, see [Breaking changes for migration from .NET Framework to .NET Core][03]. Each new release of PowerShell is built on a newer version of .NET. There can be breaking changes in .NET that affect PowerShell. +- PowerShell 7.6 - Built on .NET 10.0 (LTS) - PowerShell 7.5 - Built on .NET 9.0 -- PowerShell 7.4 - Built on .NET 8.0 +- PowerShell 7.4 - Built on .NET 8.0 (LTS) - PowerShell 7.3 - Built on .NET 7.0 -- PowerShell 7.2 (LTS-current) - Built on .NET 6.0 (LTS-current) +- PowerShell 7.2 - Built on .NET 6.0 (LTS) - PowerShell 7.1 - Built on .NET 5.0 -- PowerShell 7.0 (LTS) - Built on .NET Core 3.1 (LTS) +- PowerShell 7.0 - Built on .NET Core 3.1 (LTS) - PowerShell 6.2 - Built on .NET Core 2.1 - PowerShell 6.1 - Built on .NET Core 2.1 - PowerShell 6.0 - Built on .NET Core 2.0 @@ -63,7 +64,7 @@ For more information see: ### Be aware of .NET method changes -While .NET method changes are not specific to PowerShell, they can affect your scripts, especially +While .NET method changes aren't specific to PowerShell, they can affect your scripts, especially if you are calling .NET methods directly. Also, there might be new overloads for constructors. This can have an impact on how you create objects using `New-Object` or the `[type]::new()` method. @@ -153,9 +154,9 @@ Workflow from PowerShell. In the future, we would like to enable native parallelism/concurrency in the PowerShell language without the need for PowerShell Workflow. -If there is a need to use checkpoints to resume a script after the OS restarts, we recommend -using Task Scheduler to run a script on OS startup, but the script would need to maintain -its own state (like persisting it to a file). +If there is a need to use checkpoints to resume a script after the OS restarts, we recommend using +Task Scheduler to run a script on OS startup, but the script would need to maintain its own state +(like persisting it to a file). ## Cmdlets removed from PowerShell @@ -248,7 +249,7 @@ and a redesigned syntax. ### `New-WebServiceProxy` cmdlet removed -.NET Core does not support the Windows Communication Framework, which provide services for using the +.NET Core doesn't support the Windows Communication Framework, which provides services for using the SOAP protocol. This cmdlet was removed because it requires SOAP. ### `*-Transaction` cmdlets removed @@ -298,8 +299,8 @@ Additional changes to `pwsh(.exe)` from `powershell.exe`: on non-Windows platforms. It also means that you can run commands like `pwsh foo.ps1` or `pwsh fooScript` without specifying `-File`. However, this change requires that you explicitly specify `-c` or `-Command` when trying to run commands like `pwsh.exe -Command Get-Command`. -- `pwsh` accepts the `-i` (or `-Interactive`) switch to indicate an interactive shell. - This allows PowerShell to be used as a default shell on Unix platforms. +- `pwsh` accepts the `-i` (or `-Interactive`) switch to indicate an interactive shell. This allows + PowerShell to be used as a default shell on Unix platforms. - Removed parameters `-ImportSystemModules` and `-PSConsoleFile` from `pwsh.exe`. - Changed `pwsh -Version` and built-in help for `pwsh.exe` to align with other native tools. - Invalid argument error messages for `-File` and `-Command` and exit codes consistent with Unix @@ -334,23 +335,23 @@ The PowerShell 7.2 MSI package includes following command-line options: - `USE_MU` - This property has two possible values: - `1` (default) - Opts into updating through Microsoft Update or WSUS - - `0` - Do not opt into updating through Microsoft Update or WSUS + - `0` - Don't opt into updating through Microsoft Update or WSUS - `ENABLE_MU` - `1` (default) - Opts into using Microsoft Update the Automatic Updates or Windows Update - - `0` - Do not opt into using Microsoft Update the Automatic Updates or Windows Update + - `0` - Don't opt into using Microsoft Update the Automatic Updates or Windows Update ## Engine changes ### Support PowerShell as a default Unix shell -On Unix, it is a convention for shells to accept `-i` for an interactive shell and many tools -expect this behavior (`script` for example, and when setting PowerShell as the default shell) and -calls the shell with the `-i` switch. This change is breaking in that `-i` previously could be used -as short hand to match `-InputFormat`, which now needs to be `-in`. +On Unix, it's a convention for shells to accept `-i` for an interactive shell and many tools expect +this behavior (`script` for example, and when setting PowerShell as the default shell) and calls the +shell with the `-i` switch. This change is breaking in that `-i` previously could be used as short +hand to match `-InputFormat`, which now needs to be `-in`. ### Custom snap-ins -[PowerShell snap-ins][07] are a predecessor to PowerShell modules that do not have widespread +[PowerShell snap-ins][07] are a predecessor to PowerShell modules that don't have widespread adoption in the PowerShell community. Due to the complexity of supporting snap-ins and their lack of usage in the community, we no longer @@ -378,18 +379,18 @@ the null-element check if the collection's element type is value type. ### Preserve `$?` for **ParenExpression**, **SubExpression** and **ArrayExpression** This PR alters the way we compile subpipelines `(...)`, subexpressions `$(...)` and array -expressions `@()` so that `$?` is not automatically **true**. Instead the value of `$?` depends on +expressions `@()` so that `$?` isn't automatically **true**. Instead the value of `$?` depends on the result of the pipeline or statements executed. ### Fix `$?` to not be `$false` when native command writes to `stderr` -`$?` is not set to `$false` when native command writes to `stderr`. It is common for native commands +`$?` isn't set to `$false` when native command writes to `stderr`. It's common for native commands to write to `stderr` without intending to indicate a failure. `$?` is set to `$false` only when the native command has a non-zero exit code. ### Make `$ErrorActionPreference` not affect `stderr` output of native commands -It is common for native commands to write to `stderr` without intending to indicate a failure. With +It's common for native commands to write to `stderr` without intending to indicate a failure. With this change, `stderr` output is still captured in **ErrorRecord** objects, but the runtime no longer applies `$ErrorActionPreference` if the **ErrorRecord** comes from a native command. @@ -433,8 +434,8 @@ core. ### Allow explicitly specified named parameter to supersede the same one from hashtable splatting With this change, the named parameters from splatting are moved to the end of the parameter list so -that they are bound after all explicitly specified named parameters are bound. Parameter binding for -simple functions doesn't throw an error when a specified named parameter cannot be found. Unknown +that they're bound after all explicitly specified named parameters are bound. Parameter binding for +simple functions doesn't throw an error when a specified named parameter can't be found. Unknown named parameters are bound to the `$args` parameter of the simple function. Moving splatting to the end of the argument list changes the order the parameters appears in `$args`. @@ -450,7 +451,7 @@ function SimpleTest { } ``` -In the previous behavior, **MyPath** is not bound to `-Path` because it's the third argument in the +In the previous behavior, **MyPath** isn't bound to `-Path` because it's the third argument in the argument list. ## So it ends up being stuffed into '$args' along with `Blah = "World"` ```powershell @@ -460,7 +461,7 @@ Name: Hello; Path: ; Args: -Blah: World MyPath ``` With this change, the arguments from `@hash` are moved to the end of the argument list. **MyPath** -becomes the first argument in the list, so it is bound to `-Path`. +becomes the first argument in the list, so it's bound to `-Path`. ```powershell PS> SimpleTest @hash "MyPath" @@ -531,7 +532,7 @@ A null-conditional operator applies a member access, `?.`, or element access, `? its operand only if that operand evaluates to non-null; otherwise, it returns null. Since PowerShell allows `?` to be part of the variable name, formal specification of the variable -name is required for using these operators. So it is required to use `{}` around the variable names +name is required for using these operators. So it's required to use `{}` around the variable names like `${a}` or when `?` is part of the variable name `${a?}`. In the following example, the value of **PropName** is returned. @@ -572,7 +573,7 @@ ${a}?[0] ``` > [!NOTE] -> The variable name syntax of `${}` should not be confused with the `$()` subexpression +> The variable name syntax of `${}` shouldn't be confused with the `$()` subexpression > operator. For more information, see Variable name section of [about_Variables][08]. ### Added `&` operator for job control @@ -669,17 +670,17 @@ True ## New cmdlets -### New Get-Uptime cmdlet +### New `Get-Uptime` cmdlet The [Get-Uptime][19] cmdlet returns the time elapsed since the last boot of the operating system. The cmdlet was introduced in PowerShell 6.0. -### New Remove-Alias cmdlet +### New `Remove-Alias` cmdlet The [Remove-Alias][21] cmdlet removes an alias from the current PowerShell session. The cmdlet was introduced in PowerShell 6.0. -### New cmdlet Remove-Service +### New `Remove-Service` cmdlet The [Remove-Service][15] cmdlet removes a Windows service in the registry and in the service database. The `Remove-Service` cmdlet was introduced in PowerShell 6.0. @@ -699,7 +700,7 @@ The following cmdlets were added in PowerShell 6.1: console. - [Show-Markdown][23] - Displays Markdown content in the console or as HTML -### New Test-Json cmdlet +### New `Test-Json` cmdlet The [Test-Json][24] cmdlet tests whether a string is a valid JavaScript Object Notation (JSON) document and can optionally verify that JSON document against a provided schema. @@ -714,18 +715,18 @@ The following cmdlets were added in PowerShell 6.2 to support Experimental Featu - [Enable-ExperimentalFeature][11] - [Get-ExperimentalFeature][13] -### New Join-String cmdlet +### New `Join-String` cmdlet The [Join-String][20] cmdlet combines objects from the pipeline into a single string. This cmdlet was added in PowerShell 6.2. -### New view ConciseView and cmdlet Get-Error +### New view **ConciseView** and cmdlet `Get-Error` PowerShell 7.0 enhances the display of error messages to improve the readability of interactive and script errors with a new default view, **ConciseView**. The views are user-selectable through the preference variable `$ErrorView`. -With **ConciseView**, if an error is not from a script or parser error, then it's a single line +With **ConciseView**, if an error isn't from a script or parser error, then it's a single line error message: ```powershell @@ -733,12 +734,12 @@ Get-ChildItem -Path C:\NotReal ``` ```Output -Get-ChildItem: Cannot find path 'C:\NotReal' because it does not exist +Get-ChildItem: Can't find path 'C:\NotReal' because it doesn't exist ``` If the error occurs during script execution or is a parsing error, PowerShell returns a multiline error message that contains the error, a pointer, and an error message showing where the error is in -that line. If the terminal doesn't support ANSI color escape sequences (VT100), then colors are not +that line. If the terminal doesn't support ANSI color escape sequences (VT100), then colors aren't displayed. The default view in PowerShell 7 is **ConciseView**. The previous default view was **NormalView** @@ -775,7 +776,7 @@ For more information, see [Get-Error][17]. ## Cmdlet changes -### Parallel execution added to ForEach-Object +### Parallel execution added to `ForEach-Object` Beginning in PowerShell 7.0, the `ForEach-Object` cmdlet, which iterates items in a collection, now has built-in parallelism with the new **Parallel** parameter. @@ -797,7 +798,7 @@ $logEntries.Count 50000 ``` -The **Parallel** parameter specifies the script block that is run in parallel for each input log +The **Parallel** parameter specifies the script block that's run in parallel for each input log name. The new **ThrottleLimit** parameter limits the number of script blocks running in parallel at a @@ -838,19 +839,18 @@ The `Start-Job` cmdlet now uses the current directory as the working directory f ### Remove `-Protocol` from `*-Computer` cmdlets -Due to issues with RPC remoting in CoreFX (particularly on non-Windows platforms) and ensuring a -consistent remoting experience in PowerShell, the `-Protocol` parameter was removed from the -`\*-Computer` cmdlets. DCOM is no longer supported for remoting. The following cmdlets only support -WSMAN remoting: +The `-Protocol` parameter was removed from following cmdlets: - `Rename-Computer` - `Restart-Computer` - `Stop-Computer` +DCOM is no longer supported for remoting. The cmdlets only support WSMAN remoting. + ### Remove `-ComputerName` from `*-Service` cmdlets In order to encourage the consistent use of PSRP, the `-ComputerName` parameter was removed from -`*-Service` cmdlets. +`*-Service` cmdlets. Use `Invoke-Command` to run the cmdlets on remote computers instead. ### Fix `Get-Content -Delimiter` to not include the delimiter in the returned lines @@ -860,22 +860,23 @@ in returned lines. ### Changes to `Format-Hex` -The `-Raw` parameter is now a "no-op" (in that it does nothing). Going forward all output is -displayed with a true representation of numbers that includes all of the bytes for its type. This is -what the `-Raw` parameter was doing prior to this change. +The `-Raw` parameter now does nothing. The `Format-Hex` cmdlet displays a true representation of +numbers that includes all the bytes for its type. This is what the `-Raw` parameter did prior +to this change. -### Typo fix in Get-ComputerInfo property name +### Typo fix in `Get-ComputerInfo` property name `BiosSerialNumber` was misspelled as `BiosSeralNumber` and has been changed to the correct spelling. -### Add `Get-StringHash` and `Get-FileHash` cmdlets +### Changes to available hash algorithms -This change is that some hash algorithms are not supported by CoreFX, therefore they are no longer -available: +The following hash algorithms have been removed from .NET: - `MACTripleDES` - `RIPEMD160` +This change affects the `Get-FileHash` cmdlet. + ### Add validation on `Get-*` cmdlets where passing $null returns all objects instead of error Passing `$null` to any of the following now throws an error: @@ -895,14 +896,14 @@ Passing `$null` to any of the following now throws an error: ### Add support for the W3C Extended Log File Format in `Import-Csv` -Previously, the `Import-Csv` cmdlet cannot be used to directly import the log files in W3C extended +Previously, the `Import-Csv` cmdlet can't be used to directly import the log files in W3C extended log format and additional action would be required. With this change, W3C extended log format is supported. ### `Import-Csv` applies `pstypenames` upon import when type information is present in the CSV Previously, objects exported using `Export-Csv` with `TypeInformation` imported with -`ConvertFrom-Csv` were not retaining the type information. This change adds the type information to +`ConvertFrom-Csv` weren't retaining the type information. This change adds the type information to `pstypenames` member if available from the CSV file. ### `-NoTypeInformation` is the default on `Export-Csv` @@ -920,10 +921,10 @@ found no files, it would silently exit. Correct behavior should be that `-Litera if the file doesn't exist, it should error. Change is to treat wildcards used with `-Literal` as literal. -### Group-Object now sorts the groups +### `Group-Object` now sorts the groups As part of the performance improvement, `Group-Object` now returns a sorted listing of the groups. -Although you should not rely on the order, you could be broken by this change if you wanted the +Although you shouldn't rely on the order, you could be broken by this change if you wanted the first group. We decided that this performance improvement was worth the change since the impact of being dependent on previous behavior is low. @@ -1027,7 +1028,7 @@ Internet Explorer have resulted in several breaking changes within `Invoke-WebRe - `-MaximumRedirection` now produces a terminating error when redirection attempts exceed the provided limit instead of returning the results of the last redirection. - In PowerShell 6.2, a change was made to default to UTF-8 encoding for JSON responses. When a - charset is not supplied for a JSON response, the default encoding should be UTF-8 per RFC 8259. + charset isn't supplied for a JSON response, the default encoding should be UTF-8 per RFC 8259. - Default encoding set to UTF-8 for `application-json` responses - Added `-SkipHeaderValidation` parameter to allow `Content-Type` headers that aren't standards-compliant @@ -1035,7 +1036,7 @@ Internet Explorer have resulted in several breaking changes within `Invoke-WebRe - Compliant, case-insensitive handling of relation keys - Added `-Resume` parameter for web cmdlets -### Invoke-RestMethod returns useful info when no data is returned +### `Invoke-RestMethod` returns useful info when no data is returned When an API returns just `null`, `Invoke-RestMethod` was serializing this as the string `"null"` instead of `$null`. This change fixes the logic in `Invoke-RestMethod` to properly serialize a valid @@ -1050,14 +1051,14 @@ this by using the `-AllowUnencryptedAuthentication` switch. ### Make `-OutFile` parameter in web cmdlets to work like `-LiteralPath` Beginning in PowerShell 7.1, the **OutFile** parameter of the web cmdlets works like **LiteralPath** -and does not process wildcards. +and doesn't process wildcards. ## API changes ### Remove `AddTypeCommandBase` class The `AddTypeCommandBase` class was removed from `Add-Type` to improve performance. This class is -only used by the `Add-Type` cmdlet and should not impact users. +only used by the `Add-Type` cmdlet and shouldn't impact users. ### Removed `VisualBasic` as a supported language in Add-Type @@ -1076,10 +1077,10 @@ An incorrect position of a parameter resulted in the args passed as input instea ### Remove `ClrVersion` and `BuildVersion` properties from `$PSVersionTable` -The `ClrVersion` property of `$PSVersionTable` is not useful with CoreCLR. End users should not be +The `ClrVersion` property of `$PSVersionTable` isn't useful with CoreCLR. End users shouldn't be using that value to determine compatibility. -The `BuildVersion` property was tied to the Windows build version, which is not available on +The `BuildVersion` property was tied to the Windows build version, which isn't available on non-Windows platforms. Use the `GitCommitId` property to retrieve the exact build version of PowerShell. @@ -1104,11 +1105,11 @@ These minor breaking changes mainly affect help provider code. so it makes sense to not allow people to create `Workflow` instances. - Remove the type **System.Management.Automation.DebugSource** since it's only used for workflow debugging. -- Remove the overload of `SetParent` from the abstract class **Debugger** that is only used for +- Remove the overload of `SetParent` from the abstract class **Debugger** that's only used for workflow debugging. - Remove the same overload of `SetParent` from the derived class **RemotingJobDebugger**. -### Do not wrap return result in `PSObject` when converting a `ScriptBlock` to a delegate +### Don't wrap return result in `PSObject` when converting a `ScriptBlock` to a delegate When a `ScriptBlock` is converted to a delegate type to be used in C# context, wrapping the result in a `PSObject` brings unneeded troubles: @@ -1122,12 +1123,10 @@ After this change, the returned object is the underlying object. ## Remoting Support -PowerShell Remoting (PSRP) using WinRM on Unix platforms requires NTLM/Negotiate or Basic Auth over -HTTPS. PSRP on macOS only supports Basic Auth over HTTPS. Kerberos-based authentication is not -supported for non-Windows platforms. - -PowerShell also supports PowerShell Remoting (PSRP) over SSH on all platforms (Windows, macOS, and -Linux). For more information, see [SSH remoting in PowerShell][25]. +PowerShell Remoting (PSRP) using WinRM isn't supported for non-Windows platforms. You can use +PowerShell Remoting (PSRP) over WinRM from Windows to connect to other Windows machines. PowerShell +also supports remoting over SSH on all platforms (Windows, macOS, and Linux). For more information, +see [SSH remoting in PowerShell][25]. ### PowerShell Direct for Containers tries to use `pwsh` first @@ -1207,7 +1206,7 @@ string: ## Telemetry can only be disabled with an environment variable -PowerShell sends basic telemetry data to Microsoft when it is launched. The data includes the OS +PowerShell sends basic telemetry data to Microsoft when it's launched. The data includes the OS name, OS version, and PowerShell version. This data allows us to better understand the environments where PowerShell is used and enables us to prioritize new features and fixes.