Forum Discussion
JDR2500
8 months agoFrequent 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)