Skip to content

Path navigation with XML nodes #1518

@BernieWhite

Description

@BernieWhite

Description of the issue

There appears to be some inconsistencies handling some XML nodes/ elements in PowerShell assertions (YAML/ JSON) also need to be tested.

To Reproduce

Steps to reproduce the issue:

<policies><inbound><ip-filter action="allow"><address-range from="51.175.196.187" to="51.175.196.187" /></ip-filter></inbound><backend><base /></backend><outbound><base /></outbound><on-error><base /></on-error></policies>

The following code passes, but should not because the base element is not a child of inbound.

$Assert.HasField($policy, 'inbound.base')

Expected behaviour

PSRule

Module in use and version:

  • Module: PSRule
  • Version: 2.8.1

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfeature: coreIssues that affect the core engine

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions