Document Unix platform support for Get/Start/Stop/Restart-Service
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- powershell
调研方向
更新 reference/7.7/Microsoft.PowerShell.Management 下指定的四篇 cmdlet 文章:Get-Service.md、Start-Service.md、Stop-Service.md 和 Restart-Service.md。首先阅读它们的 DESCRIPTION、PARAMETERS、OUTPUTS 和 NOTES 部分,并参照此 issue 中建议的内容。完成标准是:文章描述 Unix 服务管理器的发现、UnixServiceController 输出、sudo 要求以及特定于平台的参数行为,并删除仅适用于 Windows 的说明。
由索引模型根据 Issue 内容生成。
描述
Prerequisites
- Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
- Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new
Get-Foocmdlet" instead of "New cmdlet."
Summary
PowerShell is adding Unix platform support for the Get-Service, Start-Service, Stop-Service, and Restart-Service cmdlets in PowerShell 7.7. The cmdlet references currently document these cmdlets as Windows-only; they need to describe the new Unix behavior, the returned UnixServiceController object, and the sudo requirements for service management.
Details
The change was proposed in PowerShell/PowerShell#18863 and is implemented in PowerShell/PowerShell#28385: on Linux and macOS, the four service cmdlets work through the system service manager, which is discovered in this order: systemctl (systemd), launchctl (macOS), service (sysvinit), and rc-service (OpenRC).
On Unix platforms:
- The cmdlets return UnixServiceController objects instead of System.ServiceProcess.ServiceController objects. The Status and StartType properties map the service manager state onto the same enumerations that are used on Windows.
- Getting service information doesn't require elevated permissions. The service management cmdlets require root privileges; when they aren't running as root, they wrap the service manager command with
sudo -nand write a non-terminating error when elevation isn't available. - The DependentServices and RequiredServices parameters are only populated by systemd.
- The Force parameter is accepted for script compatibility but has no effect on Unix.
- The remaining service cmdlets (
Set-Service,New-Service,Remove-Service,Suspend-Service, andResume-Service) stay Windows-only.
Articles
- Get-Service (
reference/7.7/Microsoft.PowerShell.Management/Get-Service.md) - Start-Service (
reference/7.7/Microsoft.PowerShell.Management/Start-Service.md) - Stop-Service (
reference/7.7/Microsoft.PowerShell.Management/Stop-Service.md) - Restart-Service (
reference/7.7/Microsoft.PowerShell.Management/Restart-Service.md)
Suggested updates:
- Remove the "This cmdlet is only available on the Windows platform." callouts and the Windows-only availability notes.
- Document the Unix service manager discovery order, the UnixServiceController output object, the sudo requirements, and the per-parameter platform behavior in the DESCRIPTION, PARAMETERS, OUTPUTS, and NOTES sections.
Suggested content
Unix support note for each cmdlet's DESCRIPTION section:
Beginning in PowerShell 7.7, this cmdlet is also available on Linux and macOS. On Unix platforms the cmdlet works through the system service manager, which it discovers in this order:
systemctl(systemd),launchctl(macOS),service(sysvinit), andrc-service(OpenRC). For more information, see the Notes section.
Unix output object section:
Microsoft.PowerShell.Commands.UnixServiceController
On Unix platforms, this cmdlet returns UnixServiceController objects that represent the services reported by the system service manager.
Related Source Pull Requests
Related Source Issues
- 主要语言
- PowerShell
- 星标
- 2.6k
- 派生
- 1.7k
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 4
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MicrosoftDocs/PowerShell-Docs 的其他 Issue
-
issue-doc-bug needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
MicrosoftDocs/PowerShell-Docs#13391 ·
维护者通常 1 天内回复
-
Generalize the warning about combining number literals with decimal places with integer-type suffixes可能已有人在做 @Tegrask 于 2 天前认领。 未关闭needs-triage
难度 1/5 1 小时以内 新手友好度 82/100
MicrosoftDocs/PowerShell-Docs#13384 ·
维护者通常 1 天内回复
-
Document the renamed `-BasePath` parameter (formerly `-RelativeBasePath`) of Resolve-Path可能已有人在做 @soroshsabz 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
MicrosoftDocs/PowerShell-Docs#13379 ·
维护者通常 1 天内回复
-
https://github.com/MicrosoftDocs/PowerShell-Docs/issues?q=state%3Aopen%20label%3A%22needs-triage%22未关闭needs-triage
难度 1/5 1 小时以内 新手友好度 65/100
MicrosoftDocs/PowerShell-Docs#13377 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
MicrosoftDocs/PowerShell-Docs#13375 ·
维护者通常 1 天内回复
查看 MicrosoftDocs/PowerShell-Docs 的全部 Issue
相似的 Issue
-
area:agent-sdk area:docs documentation enhancement
难度 2/5 1-3 小时 新手友好度 66/100
anthropics/claude-code#110914 ·
-
specification
难度 1/5 1 小时以内 新手友好度 78/100
WICG/webmonetization#813 ·
维护者通常 3 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 82/100
-
Polish README未关闭documentation
难度 2/5 1-3 小时 新手友好度 66/100
-
Doc: Remove quotes and backticks around RFC objects可能已有人在做 @Tirth00000 今天认领。 未关闭doc good first issue help wanted
难度 2/5 1-3 小时 新手友好度 67/100
collective/icalendar#2146 · 1 条评论 ·