After a few attempts I am able to run the power shell script but I am unable to read the out put from it using the test completely. I have already gone through the documentation but nothing is working for me
sample code return an empty message
function GetProcesses()
{
var oExec = WshShell.Exec("powershell -File D:\ABS\Untitled1.ps1");
oExec.StdIn.Close(); // Close standard input before reading output
// Get PowerShell output
var strOutput = oExec.StdOut.ReadAll();
// Trim leading and trailing empty lines
strOutput = aqString.Trim(strOutput, aqString.stAll);
// Post PowerShell output to the test log line by line
aqString.ListSeparator = "\r\n";
for (var i = 0; i < aqString.GetListLength(strOutput); i++)
{
Log.Message(aqString.GetListItem(strOutput,i));
}
}
PowerShell code
$Path = 'D:\ABS\ABS.xlsx'
$Excel = New-Object -Com Excel.Application
$Workbook = $Excel.Workbooks.Open($Path)
$page = 'PLANT'
$ws = $Workbook.worksheets | where-object {$_.Name -eq $page}
$cells = $ws.Columns.Item(9).hidden
return $cells
$workbook.Close($true)
$excel.quit()