if
(
windows of operating system
)
then
(
unique values of
(
it as string as version
)
of values "DisplayVersion" of keys whose
(
exists values "DisplayName" whose
(
(
it as string contains "Cortex XDR"
)
or
(
it as string contains "Traps"
)
)
of it
)
of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of
(
x64 registries; x32 registries
)
)
else if
(
unix of operating system
)
and
(
name of operating system as lowercase contains "linux"
)
then
(
if
(
exists package "cortex-agent" of rpm
)
then
(
version of package "cortex-agent" of rpm as string | ""
)
else if
(
exists file "/opt/traps/version.txt"
)
then
(
following text of last "-" of
(
lines whose
(
it as string contains "cortex"
)
of file "/opt/traps/version.txt"
)
as trimmed string | "n/a"
)
else ""
)
else if
(
mac of operating system
)
then version of application whose
(
name of it contains "Cortex XDR Agent"
)
as string | "" else
(
nothings
)
if (windows of operating system) then (unique values of (it as string as version) of values "DisplayVersion" of keys whose(exists values "DisplayName" whose((it as string contains "Cortex XDR") or (it as string contains "Traps")) of it) of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)) else if (unix of operating system) and (name of operating system as lowercase contains "linux") then ( if(exists package "cortex-agent" of rpm) then (version of package "cortex-agent" of rpm as string | "") else if(exists file "/opt/traps/version.txt") then (following text of last "-" of (lines whose (it as string contains "cortex") of file "/opt/traps/version.txt") as trimmed string | "n/a") else "") else if (mac of operating system) then version of application whose (name of it contains "Cortex XDR Agent") as string | "" else (nothings)