Action Script Execution Issue -

Hello All

I am trying to write an action script that reads the value from the Registry and puts that in a parameter.
I tried the below logic but all are getting failed, Please suggest

1st Method
Failed appendfile {Preceding text of first “Remotely Anyconnect” of( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))}
move __appendfile C:\info.txt
parameter “path” = {line 1 of file “C:\info.txt”}

2nd Method
Failed parameter “path” = {Preceding text of first “Remotely Anyconnect” of( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))}

Please suggest!!

You need to test your relevance in the debugger to ensure it always returns a single value that is either explicitly cast as a string or something that the debugger can cast to string by default.

Then you can plug the working relevance into your actionscript.

I have tested Relevance in QNA & single clause and I am getting proper output but when I execute via BigFix , Script is getting failed.

Sorry, I disagree.

Your relevance will only work if a single answer is returned. If there are zero or multiple values returned it will fail.

Does the ‘path’ have spaces and require quotation marks?

Agreed, it is very unlikely this would work in the Fixlet Debugger. Let’s break this apart.

( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))

This returns every “InstallLocation” value as a trimmer string. Multiple results, one for each “Uninstall” key.

Preceding text of first “Remotely Anyconnect” of

From each of those InstallLocation values, this pulls the substring before “Remotely Anyconnect”.

This relevance could only work if there is only one InstallLocation value under all of those registry keys, and that one value contains “Remotely Anyconnect”.

In short, your query for registry keys needs a whose() filter to limit to only those containing “Remotely Anyconnect”.

Try

preceding text of first "Remotely Anyconnect" of( unique values of (it as string as trimmed string) of values "InstallLocation" whose (it as string contains "Remotely Anyconnect") of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))

(This could still have an issue of there are more than one “Remotely Anyconnect” registry values)

1 Like

Yes that was correct, when I have mutliple output, I was not able to store in variable