power shell scripts not running as expected using testcomplete script
- 7 years ago
Hi Nis,
That's the issue, I have not getting any error message and power shell window just open and closed. Seems working but not getting expected results.
I have somehow resolved the issue by adding CLR Bridge > browse GAC > added system.management.Automation and below script, now seems working!!
var powerShellScript = "AppVersion.ps1"; // script is in the original message
function getVersionOfInstalledAppUnderTest()
{
var currentDirectory = aqFileSystem.GetCurrentFolder();
psScriptPath = currentDirectory + "\\" + powerShellScript;
var PowerShell = dotNET.System_Management_Automation.PowerShell.Create();
PowerShell.AddScript(currentDirectory + "\\" + powerShellScript);
// invoke powershell to get the results
var results = PowerShell.Invoke();
}