Skip to content

Add verbose message to Get-Service when properties cannot be returned#27109

Open
reabr wants to merge 4 commits intoPowerShell:masterfrom
reabr:add-verbose-to-get-service
Open

Add verbose message to Get-Service when properties cannot be returned#27109
reabr wants to merge 4 commits intoPowerShell:masterfrom
reabr:add-verbose-to-get-service

Conversation

@reabr
Copy link
Copy Markdown

@reabr reabr commented Mar 27, 2026

Fixes #24272

PR Summary

Adds verbose messages to Get-Service when certain service properties
cannot be retrieved due to permissions or other issues.

When Get-Service fails to read properties like Description,
DelayedAutoStart, BinaryPathName, StartupType or UserName, it now emits
a verbose message explaining which service, which property, and why it
failed. The message is only visible when using -Verbose, so it is
non-intrusive by default.

PR Context

This implements the behavior approved by the WG-Cmdlets-Management working
group in issue #24272. The verbose stream was chosen over debug stream as
most users rerun with -Verbose to diagnose issues.

Tested

Verified locally that verbose messages appear for services with missing
MUI resources (e.g. NPSMSvc, WaaSMedicSvc) when running Get-Service -Verbose.

@reabr reabr requested a review from a team as a code owner March 27, 2026 19:37
@reabr
Copy link
Copy Markdown
Author

reabr commented Mar 27, 2026

@microsoft-github-policy-service agree

@reabr
Copy link
Copy Markdown
Author

reabr commented Mar 27, 2026

Hi, could a maintainer please approve the workflows to run?
This implements the behavior approved in #24272. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add verbose message to Get-Service when certain properties cannot be returned

1 participant