Forum Discussion

kakabubu's avatar
kakabubu
Contributor
6 years ago

PowerShell Stop-Process testcomplete returns "Access denied" with testcomplete 14

We're using Powershell script to run our night tests.

Tests are executed by testComplete. The script stops testCompletete force, before starting a new instance and running the project.

After I've updated to testCompletete14, the code below stopped working

 

$testCompleteProcess = Get-Process -name TestComplete -ErrorAction "Ignore"

if ($testCompleteProcess -ne $null) {
echo "Stopping TestComplete..."
Stop-Process -Name TestComplete
} else {
echo "No running TestComplete process found"
}

 

returns error "Access is denied"

How should I stop testComplete from ps1?

2 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    This appears to be working just fine for me, as we do something similar. Is it possible the script and test complete instances are running under different users? Are you running both as administrator? 

    • kakabubu's avatar
      kakabubu
      Contributor

      I'm running both testComplete and PowerShell NOT as administrator, but as the same user.