Skip to content

Invalid ternary operator used in PowerShell script #63

@pGriffinPower

Description

@pGriffinPower

While reviewing the PowerShell setup script provided by the observability agent, line 133:
$level = "$($env:log_level -eq $null ? 'warn' : $env:log_level)"

fails with: "Expected token '?' in expression or statement."

The problem is that PowerShell does not support the ternary ? : operator. This is invalid syntax in all versions of PowerShell, including 7+.

I strongly advise changing it to the following code "$level = $env:log_level ?? 'warn'."

I have not verified the subsequent install steps, but this should be addressed.

Thank you for your attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions