Document Unix platform support for Get/Start/Stop/Restart-Service
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 85/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- powershell
- Bereich
- documentation
Rechercherichtung
Aktualisiere die vier benannten Cmdlet-Artikel unter reference/7.7/Microsoft.PowerShell.Management: Get-Service.md, Start-Service.md, Stop-Service.md und Restart-Service.md. Lies zunächst die Abschnitte DESCRIPTION, PARAMETERS, OUTPUTS und NOTES zusammen mit den in diesem Issue vorgeschlagenen Inhalten. Die Arbeit ist abgeschlossen, wenn die Artikel die Erkennung von Unix-Dienstmanagern, die Ausgabe von UnixServiceController, sudo-Anforderungen und plattformspezifisches Parameterverhalten beschreiben und Hinweise auf die Verfügbarkeit nur unter Windows entfernen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- PowerShell
- Sterne
- 2.6k
- Forks
- 1.7k
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MicrosoftDocs/PowerShell-Docs
-
issue-doc-bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
MicrosoftDocs/PowerShell-Docs#13391 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Generalize the warning about combining number literals with decimal places with integer-type suffixesEvtl. vergeben @Tegrask hat das vor 2 Tagen übernommen. Offenneeds-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
MicrosoftDocs/PowerShell-Docs#13384 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Document the renamed `-BasePath` parameter (formerly `-RelativeBasePath`) of Resolve-PathEvtl. vergeben @soroshsabz hat das vor 9 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
MicrosoftDocs/PowerShell-Docs#13379 ·
Maintainer antworten meist innerhalb von 1 Tag
-
https://github.com/MicrosoftDocs/PowerShell-Docs/issues?q=state%3Aopen%20label%3A%22needs-triage%22Offenneeds-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
MicrosoftDocs/PowerShell-Docs#13377 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
MicrosoftDocs/PowerShell-Docs#13375 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in MicrosoftDocs/PowerShell-Docs
Ähnliche Issues
-
Issue-Docs Needs-Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
microsoft/winget-cli#6692 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 66/100
microsoft/ignite26-LAB672#21 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
lean-ja/lean-by-example#2651 ·
-
area:agent-sdk area:docs documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
anthropics/claude-code#110914 ·
-
specification
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
WICG/webmonetization#813 ·
Maintainer antworten meist innerhalb von 3 Tagen