Forum Discussion
3 Replies
- rraghvani
Champion Level 3
How are you executing the PowerShell scripts? What do the PowerShell scripts do? Are you running TestExecute on the same machine?
- scot1967
Champion Level 1
The first thing that comes to mind is TestExecute will need permission to run power shell scripts. I know we need to set TestComplete to 'Run as administrator'. Could it be a permission issue? Just a guess. But, no there isn't anything as far as TestExecute goes that I am aware of. Let us know what sort of errors you see or what the failure is and we can help more.
... If you find my posts helpful drop me a like! 👍 Be sure to mark the best answer if you get one to help others out and to credit the one who helped you. 😎 - JDR2500Frequent Contributor
Try running it with your same command line arguments from a Command Prompt, not PS. You may get more information back on the problem. Include "-NoExit " as the first argument. That will leave the PS window open and might reveal what's going wrong.
This is the method I've used from TC with VBScript. Getting the right number of quotation marks around the parameters has always been the biggest challenge for me.
Set oShell = Sys.OleObject("WScript.Shell") s_Columns = """" & s_Columns & """" s_PSScriptPath = s_path & "Utility Files\CompareExcelSpecifiedCols.ps1" s_PowershellInput = "powershell.exe -ExecutionPolicy Bypass -File " _ & """" & s_PSScriptPath & """" & " -File1 " & s_ResourceFileName _ & " -File2 " & s_TestFileName & " -OutputFile " & s_OutputFile _ & " -SheetName " & """" & s_SheetName & """" & " -ColumnsToCompare " & s_Columns Set oExec = oShell.Exec(s_PowershellInput)