This is a question of run powershell script in admin mode, ok, I currently created a script of starting and stopping services items, well scripts works fine... however I noticed that if i simply just right click and choose Run with Powershell of the .ps1 file, it open a user rights powershell window, and when I try to stop services with that, I got "not permitted" error. I would like to do is to run it in a administrator mode. I tried:
Start-Process powershell -verb runas -ArgumentList "-file fullpathofthescript"
This will work but didn't work with my code, I got:
[string]$ComputerName = $env:ComputerName,
If I use that Start-Process it will just jump over the param and param will return as null. I use those param to enter different service name to stops it.
Any idea how I can solve this problem?