Revision db2fc293
Added by Nicolas CHARLES over 6 years ago
scripts/check-techniques.sh | ||
---|---|---|
EXIT=1
|
||
fi
|
||
|
||
# Check that techniques do not contain $()
|
||
# Check that techniques do not contain $() (except for line containing powershell command)
|
||
${REPOSITORY_PATH}/scripts/technique-files -l -i -f '*.cf' -f '*.st' "${REPOSITORY_PATH}" | while read filename
|
||
do
|
||
if grep '$(' "${filename}" >/dev/null; then
|
||
if grep '$(' "${filename}" | grep -v "powershell" >/dev/null; then
|
||
echo "The file ${filename} contains deprecated \$() syntax"
|
||
exit 1
|
||
fi
|
techniques/system/common/1.0/environment-variables.cf | ||
---|---|---|
# will be available using the syntax ${node.env[ENV_NAME]}
|
||
windows::
|
||
"script" string => "@echo off
|
||
for /F \"tokens=1,2* delims==\" %%G IN ('SET') DO ECHO =node.env[%%G]=%%H";
|
||
c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command \"Get-ChildItem env: | ForEach { Write-Host \\\"=node.env[$($_.name -replace '[^^A-Z0-9_]','_')]=$($_.value)\\\" }\"";
|
||
|
||
|
||
files:
|
||
windows::
|
Also available in: Unified diff
Fixes #11435: Error message on classical windows agent when getting environement variable