The output is Unicode, not "Funky-Code" \:D
Don't redirect from PS, use the Out-File method and specify ASCII encoding.
 Code:
; Get the FileIO function from the library
Call 'K:\KixLib\FileIO.kxf'

; Run the PowerShell command forcing ASCII output (default is "Unicode", not "Funky-Code"
Shell "Powershell get-ExecutionPolicy | Out-File -encoding ascii c:\temp\PSSec.txt"

; Read file as one big string - This UDF is faster that the FSO method
; FileIO returns the file contents as an array of lines - the Join() converts the entire 
; file into a single string
$FileContents = Join(FileIO($FileToCheck, 'R'), @CRLF)

; See if the result is found.
If InStr($FileContents, $StringToFind)
  'Found!' ?
Else
  'not found...' ?
EndIf
Works flawlessly.

Glenn

PS - the FileIO() function is posted in the UDFs Forum.


Edited by Glenn Barnas (2017-11-18 05:33 PM)
Edit Reason: Added UDF link
_________________________
Actually I am a Rocket Scientist! \:D