Get-Service Ignore common errors by jborean93 · Pull Request #24245 · PowerShell/PowerShell

@iSazonov iSazonov added the CL-General

Indicates that a PR should be marked as a general cmdlet change in the Change Log

label

Sep 5, 2024

daxian-dbw

daxian-dbw

@jborean93

Ignore common errors when attempting to retrieve some properties for a
service like the Description, UserName, StartupType. These properties
are not critical for using a service object or to retrieve other
information like the name and whether a service exists or not and by
emitting an error record it could fail a script if it did not expect an
error.

Instead if the service failed to retrieve the property due to
permissions or other environmental problems, it will set the affected
properties to $null.

@daxian-dbw

daxian-dbw

@jborean93

daxian-dbw

Sysoiev-Yurii pushed a commit to Sysoiev-Yurii/PowerShell that referenced this pull request

May 12, 2025

@jborean93 @Sysoiev-Yurii

SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request

Dec 12, 2025

@jborean93 @SIRMARGIN