diff --git a/powershell/ql/lib/semmle/code/powershell/ast/internal/Synthesis.qll b/powershell/ql/lib/semmle/code/powershell/ast/internal/Synthesis.qll index 0b7b6afb2cb..2fee3dd99d6 100644 --- a/powershell/ql/lib/semmle/code/powershell/ast/internal/Synthesis.qll +++ b/powershell/ql/lib/semmle/code/powershell/ast/internal/Synthesis.qll @@ -904,3 +904,15 @@ private module PipelineAccess { } } } + +private module ImplicitAssignmentInForEach { + private class ForEachAssignment extends Synthesis { + override predicate implicitAssignment(Raw::Ast dest, string name) { + exists(Raw::ForEachStmt forEach, Raw::VarAccess va | + va = forEach.getVarAccess() and + va = dest and + va.getUserPath() = name + ) + } + } +}