Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

ConvertTo Yaml

Nick Spreitzer edited this page Feb 17, 2020 · 9 revisions
external help file: JournalCli.dll-Help.xml
Module Name: JournalCli
online version:
schema: 2.0.0

ConvertTo-Yaml

SYNOPSIS

Converts an object to a Yaml-formatted string.

Alias: cty

SYNTAX

ConvertTo-Yaml [-Value] <PSObject> [<CommonParameters>]

DESCRIPTION

Serializes any object into a Yaml-formatted string. This is also useful for making a complex object with nested properties human readable when printed to the screen.

EXAMPLES

Example 1

PS C:\> Get-JournalEntriesByTag 
  -Location J:\ -Tags dads-visit | 
  ConvertTo-Yaml

#### Result ####
Tag: dads-visit
Count: 1
Entries:
- FilePath: J:\2019\05 May\2019.05.09.md
  Tags:
  - dads-visit
  Headers:
  - '# Thursday, May 9, 2019'
  - '# Friday May 10, 2019'
  - '# Saturday May 11, 2019'
  - '# Sunday May 12, 2019'
  - '# Monday May 13, 2019'
  - '# Tuesday May 14, 2019'

Get all entries that are tagged dads-visit and display the results as yaml. Yaml is an easy to read format which works well for displaying text in a terminal window.

PARAMETERS

-Value

The object to serialize into yaml.

Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Management.Automation.PSObject

OUTPUTS

System.String

NOTES

RELATED LINKS