Checking line from .txt file

Hello All!

So I have output (True or False) from .ps1 script exported to “Output.txt” file.
How can I later check content of this .txt file in action script?
I’ll need it for “IF” statement later.

I hope you understand what I mean. First time here and quite new into BigFix :sweat_smile:

Does the file only contain ‘True’ or ‘False’ or is there other content in there?

Thanks for reply :slight_smile:
Only True or False.

lines of file "LOCATION_OF_FILE\Output.txt"

3 Likes

To use it in an ‘if’ statement, will need to cast ‘as boolean’.

If exists lines whose (it as string as boolean = True) of files "LOCATION_OF_FILE\Output.txt" then "yes" else "no"
3 Likes

Welcome to Bigfix @4rt. Just to expand on @JasonWalker’s example, this is how you could use it within ActionScript

if{exists lines whose (it as string as boolean = True) of files "C:\TEMP\Output.txt"}
	//do something
	regset "[HKEY_LOCAL_MACHINE\Software\Bigfix\My]" "Something"="Yes"
else
	//do something else
	regset "[HKEY_LOCAL_MACHINE\Software\Bigfix\My]" "SomethingElse"="Yes"
endif
3 Likes