-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-managementArea - Microsoft.PowerShell.Management moduleArea - Microsoft.PowerShell.Management module
Description
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
Content source URL
Author
Document Id
c6a4f863-30eb-83e6-4f24-6d24ab1fa638
Metadata
Metadata
Assignees
Labels
area-managementArea - Microsoft.PowerShell.Management moduleArea - Microsoft.PowerShell.Management module