Empty resolution precedence layer throws error
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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