Skip to content

Accept [ScriptBlock] for -ScriptDefinition #1937

Open
@iRon7

Description

@iRon7

Summary of the new feature

[ScriptBlock]s might contain both single and double quotes therefore it would makes sense to accept a ScriptBlock for the -ScriptDefinition parameter so that it isn't necessarily to replace either the single quotes or double quotes in e.g. (Pester) test scenario's.

Proposed technical implementation details (optional)

Invoke-ScriptAnalyzer -ScriptDefinition { Write-Host 'Test:' "$Test" }

(Workaround)

Invoke-ScriptAnalyzer -ScriptDefinition { Write-Host 'Test:' "$Test" }.ToString()

What is the latest version of PSScriptAnalyzer at the point of writing

1.21.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions