Hello,
I would like to verify the outcome of the Powershell command in an txt file , however It looks like I cannot, can someone help me?
script:
 Code:
Shell "Powershell Set-ExecutionPolicy RemoteSigned"
Shell "Powershell get-ExecutionPolicy > c:\temp\PSSec.txt"

$fileToCheck = "c:\temp\PSSec.txt"
$stringToFind = "RemoteSigned"
			
If Exist($fileToCheck)
	$stringFound = 0
	$fileContents = Split(CreateObject("Scripting.FileSystemObject").OpenTextFile($fileToCheck, 1, Not 1).ReadAll, @CRLF)
	For Each $line in $fileContents
		If InStr($line, $stringToFind)
			$stringFound = 1
		EndIf
	Next
	If $stringFound
		MessageBox("Status OK ! ", "ICT - INFO", 64, 1)
	Else 
		MessageBox("Status NOT OK ! ", "ICT - INFO", 64, 1)
	EndIf
EndIf


Edited by ShaneEP (2017-11-17 10:25 PM)
Edit Reason: put code in code tags