gaelcolas / gaelcolas/datum

Empty resolution precedence layer throws error

Open
#166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
166
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Conditional entries in the resolution precedence throw an error:

ResolutionPrecedence:
  - AllNodes\$($Node.Environment)\$($Node.NodeName)
  - Environment\$($Node.Environment)
  - Locations\$($Node.Location)
  - Roles\$($Node.Role)
  - Baselines\Security
  - Baselines\$($Node.Baseline)
  - Baselines\DscLcm
  - |
    '[x= {
      if ($node.Name -notlike "*file*")
      {
        'Somevalue'
      }
      else
      {
        #nothing
      }
    } =]'

The error is:

System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is an empty string.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at Resolve-Datum(Closure, FunctionContext)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.CommandProcessorBase.Complete()

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

Reproduce the error with the ResolutionPrecedence YAML shown in the issue, then start at the Resolve-Datum entry point named in the stack trace. Trace how the conditional expression produces an empty value and how it is passed to the Path parameter. Done means an empty resolution-precedence layer no longer raises the parameter-binding error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.