PowerShell script to restart a service

Posted by Guy Thomas on Stack Overflow See other posts from Stack Overflow or by Guy Thomas
Published on 2010-05-14T15:45:02Z Indexed on 2010/05/14 16:04 UTC
Read the original article Hit count: 299

My mission is to press a keyboard sequence, such as Ctrl +Shift +R, to restart a Windows Service.

I have a script which works fine in the PowerShell ISE, when launched with administrative privileges.

When I try with a PowerShell script it fails due to insufficient Administrative Privileges. It’s galling that I can get it to work with an old-fashioned bat file, but not PowerShell.

The root of the problem is that shortcuts to a PowerShell script have their Administrative privileges box greyed out. So far no work-around has overcome this privilege problem.

Any ideas?

© Stack Overflow or respective owner

Related posts about powershell

Related posts about windows-services