4rt
October 18, 2023, 11:07am
1
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
trn
October 18, 2023, 11:20am
2
Does the file only contain ‘True’ or ‘False’ or is there other content in there?
4rt
October 18, 2023, 11:21am
3
Thanks for reply
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
SLB
October 18, 2023, 2:48pm
6
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