Skip to content

Profile value failure should throw a terminating error #358

Closed
@juneb

Description

@juneb

When you use the Profile parameter, but the value is invalid (hash table, variable containing a hash table, incorrect key name), PSScriptAnalyzer generates a warning, but continues to run the test.

Because the profile is the user's instruction for running the test, when Invoke-ScriptAnalyzer cannot follow that instruction for any reason, the test should immediately fail with a terminating error.

Otherwise, you waste the user's time running the wrong test and, more importantly, if the user has logged output and not examined the warning/error stream, the user might not know that the test they ran was not the test they designed.

Be sure that the error message helps the user to solve the problem. For example, list the valid keys in a profile hash table, rather than just telling the user that the key is invalid.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions