dsccommunity / dsccommunity/SqlServerDsc

SqlServerDscHelper: Get-LocalizedData fails on cmdlet Import-LocalizedData if the path does not exist

Open
#1,219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Details of the scenario you tried and the problem that is occurring

The helper function Get-LocalizedData fails on cmdlet Import-LocalizedData if the path does not exist, for example when falling back to en-US.

https://github.com/PowerShell/SqlServerDsc/blob/80172377320659488f0b45595264c29da58ae448/DSCResources/CommonResourceHelper.psm1#L239-L255

Verbose logs showing the problem
Import-LocalizedData : Cannot find the PowerShell data file 'myResource.strings.psd1' in directory 'C:\Source\...\en-US\en-US', or in any parent culture directories.
Suggested solution to the issue

The helper function Get-LocalizedData should check if the path exist after it has fallen back to en-US and throw a correct error message, instead of letting Import-LocalizedData fail.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

n/a

SQL Server edition and version the target node is running

n/a

SQL Server PowerShell modules present on the target node

n/a

The operating system the target node is running

n/a

Version and build of PowerShell the target node is running

n/a

Version of the DSC module that was used ('dev' if using current dev branch)

dev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DSCResources/CommonResourceHelper.psm1 at lines 239-255 and inspect how Get-LocalizedData falls back to en-US before calling Import-LocalizedData. Reproduce the missing-path case described in the issue, then verify that the helper checks the resulting path and reports the intended error instead of exposing Import-LocalizedData's failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
localization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.