Cmdlet
Save-OfficeYaml
Saves a live YAML document and keeps it available.
Syntax
Save-OfficeYaml
-Document <YamlDocument>
[-PassThru]
[[-Path] <String>]
[-WriteOptions <YamlSaveOptions>]
[<CommonParameters>]#Parameter set:
DocumentDescription
The default save is minimal-change: untouched text is copied from the source, in the encoding and byte-order mark it was loaded with, and only edited nodes are written anew. WriteOptions with Reformat rewrites the whole document through the writer.
Examples
Save to the file the document was opened from.
Save-OfficeYaml -Document $documentWrite a reformatted copy with four-space mappings.
Save-OfficeYaml -Document $document -Path ./out/values.yaml -WriteOptions @{ Reformat = $true; WriterOptions = [OfficeIMO.Yaml.YamlWriterOptions]@{ MappingIndent = 4 } } -PassThruParameters
- -Document YamlDocument
- YAML document to save.
- -PassThru SwitchParameter
- Return the saved file.
- -Path String
- Optional destination, which becomes the document's FilePath; omission saves to its FilePath.
- -WriteOptions YamlSaveOptions
- Native save settings or a hashtable of their properties.
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.