Action script parameter does not work

I am trying to get the exit code for action script , but parameter command does not capture the output for if then else statement and provide me exit code 0 instead of exit code 100 in the below script

action parameter query "Identity" with description "Please enter the AD User account" with default value "" action parameter query "Error_Folder" with description "Please enter the Folder Name and Path" with default value ""

folder create {parameter “Error_Folder”}
// Enter your action script here

// Disable wow64 redirection on x64 OSes
action uses wow64 redirection {not x64 of operating system}
delete __createfile

if { not exists folder “c:\temp”}
folder create "c:\temp"
endif

// CREATEFILE
createfile until END_OF_FILE

ENDPOINTwaithidden powershell -ExecutionPolicy Bypass -command
Disable-ADAccount -Identity {parameter “Identity”}
$? > {parameter “Error_Folder”}\output.txt
$Error > {parameter “Error_Folder”}\error.txt

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1
waithidden { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File powershell.ps1

parameter “file_content”="{{lines of file “output.txt” of folder (parameter “Error_Folder”)}}"
if {parameter “file_content” contains “False”}
exit 100

endif

A couple of observations

ENDPOINTwaithidden will, I suspect, cause a powershell execution error.

You appear to have doubled the curly braces which will disable relevance substitution so “file_content” parameter probably isn’t processing the file as you expect.

Have you tried using the FixletDebugger action tab for debugging? You may have to be creative with the action parameters and just use standard parameters but this would give you a nice insight as to what is be evaluated and where. Just as an example…

With your double curly braces

With single curly braces

1 Like

i changed the below syntax and it worked for me

if {exists file “output.txt” whose (line of it as string contains “False”) of folder (parameter “Error_Folder”)}
Exit 100
endif

1 Like

Thanks for your reply