Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
3 years ago

Running powershell file as admin from JS

Hi,   I have a below line in my javascript function in test complete, which runs the ps1 file. WshShell.Run("powershell -file \"" + pathvar + "\\My Tests\\PickupTest.ps1\"") Now the problem is th...
  • Kitt's avatar
    3 years ago

    You can add Powershell as a TestApp and set RunAs to Admin: [TestComplete reference]

     

    You can also add some lines of code to your PowerShell script to elevate your user privileges automatically (on UAC-enabled systems) - [examples]