Skip to content

Start-Service.md says "might not have permission" but doesn't say how to give permission #11470

@BenAveling

Description

@BenAveling

Type of issue

Missing information

Feedback

The document currently says "If a command does not work correctly, you might not have the required permissions."

Which is true, but not useful, because it's not obvious how to give it the right permissions.

The usual "Start-Process -Verb runAs" doesn't quite work, because this is a commandlet.

The simplest thing I could find that sort of worked is to start-process powershell.

e.g.

Start-Process -verb runas PowerShell "restart-service spooler" -WindowStyle hidden -wait

And even that's not ideal, because any output from restart-service is lost. (Not having "-WindowStyle hidden" doesn't help, because the window exits as soon as the restart-service finishes.)

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.4

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md

Author

@sdwheeler

Document Id

c6a4f863-30eb-83e6-4f24-6d24ab1fa638

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-managementArea - Microsoft.PowerShell.Management module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions