So I've got a script testing a few program by starting them, checking that they run and then closing them. So here's my code so far:
Powershell
functiontestApps{$arrApps,$arrFriendlyApps=getArrApps$i=0foreach($itemin$arrApps){Start-Process$item-ErrorActionSilentlyContinue$shortItem=getShortItem$itemStart-Sleep2if(!(Get-Process-Name$shortItem-ErrorActionSilentlyContinue)){$errorMessage="Software Test: $item failed to launch"pauseScript$errorMessage}else{$crntFrApp=$arrFriendlyApps[$i]Write-Host"$tab Software Test: $crntFrApp launched successfully"|Add-Content$outLogPath-ErrorActionSilentlyContinueStop-Process-Name$shortItem}$i++}}#works out which programs need to be tested and returns an array with the exe names and one with user friendly namesfunctiongetArrApps{$retValStandard='C:\...