Skip to content

Question : how to retrieve the settings object in an external rule inside a script module ? #880

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

Closed
LaurentDardenne opened this issue Feb 8, 2018 · 4 comments

Comments

@LaurentDardenne
Copy link

Is it possible to retrieve the settings object in an external rule inside a script module ?
A priori here the rule module does not know anything about the caller.
The goal is to create a configurable Powershell rule.
Is this possibility only accessible in C# ?

@bergmeister
Copy link
Collaborator

bergmeister commented Feb 27, 2018

Is the goal to use the -Settings parameter to enable/disable rules from the custom rules written In PowerShell using the -CustomRulePath parameter?

@LaurentDardenne
Copy link
Author

Absolutely.
Also to access a parameter.

@bergmeister
Copy link
Collaborator

bergmeister commented Feb 27, 2018

I think this depends on #675 first and is probably even a duplicate of it because #675 is generic and would solve this special case as well 'for free'.

@LaurentDardenne
Copy link
Author

Maybe, but for the moment it's not the content of the file but the access to the content.
The issue 675 is a request that VSCode consume rule modules, not that the rule modules access the rule configuration data.
At the time I think there were no customizable rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants