-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The rule 'UseUsingScopeModifierInNewRunspaces' throw an ArgumentException #1492
Comments
I can confirm. cc @Jawz84 |
The exception is originating from here:
_varsDeclaredPerSession[sessionName] already contains the key sccmModule (with value $sccmModule )A simple fix seems to be if (!_varsDeclaredPerSession[sessionName].ContainsKey(item.Key))
{
_varsDeclaredPerSession[sessionName].Add(item.Key, item.Value);
} |
@Jawz84 As far as I see the |
Thank you for attending to this and notifying me. I can't help at this time. I am in the middle of refurbishing my new house where we will be moving to in a few weeks. |
No worries, it's just an FYI, I have a fix for it already in #1493 |
Steps to reproduce
Expected behavior
Actual behavior
If an unexpected error was thrown then please report the full error details using e.g.
$error[0] | Select-Object *
Environment data
The presence of the $sccmModule variable inside the two scriptblock causes the exception.
If we rename the first variable occurence to $sccmModuleOne there are no more exceptions.
Once again we do not know where the error took place. In the file 'xyz', but for which line?
In the error report, we do not know which line triggered the error, yet the analysis engine knows it.
The text was updated successfully, but these errors were encountered: