Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
2 years ago
Solved

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
    2 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]