power shell scripts not running as expected using testcomplete script
Hello All, My requirement: 1. get version number of installed app under test before the test starts. am using a powershell script for this. Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Where-Object {$_.DisplayName -Like 'myapp*'} 2. There will be different versions to be installed so I would like to create a txt file from above script Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Where-Object {$_.DisplayName -Like 'myapp*'} > path\to\txt\myApp.txt I have power shell script to update a text file which is supposed run from testcomplete. Manually ps1 script works but not from script; my script looks like; Sys.OleObject("WScript.Shell").Run("PowerShell -File " + ".\myScript.ps1"); myScript.ps1 script is as follows; $MyReport= "version_info.txt" $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition $Folder= Join-Path $scriptPath $MyReport # get items from system that has name myapp Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Where-Object {$_.DisplayName -Like 'myapp*'} > $Folder the powershell is working and successfully executed (it seems - no errors) but my text file created butnot updated. It is updated if run powershell script manually! why testcomplete cannot??? Any thoughts? SSolved1.4KViews0likes2Comments