Cmdlet
Remove-OfficeYamlNode
Removes mapping entries or sequence items from a live YAML document by path.
Syntax
Remove-OfficeYamlNode
[-Document <YamlDocument>]
[-Select] <String[]>
[<CommonParameters>]#Parameter set:
DocumentDescription
An entry goes with its own comment lines and line; neighboring entries and section comments stay. A path with nothing at it writes a non-terminating ObjectNotFound error.
Examples
Drop a setting inside an editing block.
Open-OfficeYaml -Path ./values.yaml {
Remove-OfficeYamlNode -Select 'ingress.annotations["nginx.ingress.kubernetes.io/rewrite-target"]'
}Remove a sequence item if it is there.
Remove-OfficeYamlNode -Document $document -Select 'spec.ports[1]' -ErrorAction SilentlyContinueParameters
- -Document YamlDocument
- Gets or sets an explicit live document; omission uses the enclosing content block.
- -Select String[]
- Paths of the entries or items to remove.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.