Skip to content

Preserve structured errors in Get-LocalizedDataForInvariantCulture.ps1 #178

Description

@coderabbitai

Description

In source/Public/Get-LocalizedDataForInvariantCulture.ps1 around lines 211-212, the current Write-Error $_ call coerces the exception to a string and drops metadata.

Proposed Change

Change the Write-Error call to pass the ErrorRecord explicitly:

# Current
Write-Error $_

# Proposed
Write-Error -ErrorRecord $_

This preserves the full ErrorRecord (including category, target object, and invocation info) in the error pipeline.

References

Activity

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

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