Skip to content

Latest commit

 

History

History
124 lines (101 loc) · 2.76 KB

ConvertTo-DscYaml.md

File metadata and controls

124 lines (101 loc) · 2.76 KB
external help file GeneratedBy Module Name online version schema
PSDSC-help.xml
Sampler update_help_source task
PSDSC
2.0.0

ConvertTo-DscYaml

SYNOPSIS

Convert DSC Configuration (v1/v2) Document to YAML.

SYNTAX

Path (Default)

ConvertTo-DscYaml -Path <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]

Content

ConvertTo-DscYaml -Content <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The function ConvertTo-DscYaml converts a DSC Configuration Document (v1/v2) to YAML.

EXAMPLES

EXAMPLE 1

$path = 'myConfig.ps1'
PS C:\> ConvertTo-DscYaml -Path $path

PARAMETERS

-Content

The content to a valid DSC Configuration Document.

Type: String
Parameter Sets: Content
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

The file path to a valid DSC Configuration Document.

Type: String
Parameter Sets: Path
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

Input a valid DSC Configuration Document

configuration MyConfiguration {

Import-DscResource -ModuleName PSDesiredStateConfiguration

Node localhost

{

Environment CreatePathEnvironmentVariable

{

Name = 'TestPathEnvironmentVariable'

Value = 'TestValue'

Ensure = 'Present'

Path = $true

Target = @('Process')

}

}

}

OUTPUTS

Returns a YAML string

resources:

name: MyConfiguration

type: Microsoft.DSC/PowerShell

properties:

resources:

- name: CreatePathEnvironmentVariable

type: PSDscResources/Environment

properties:

Value: TestValue

Path: true

Name: TestPathEnvironmentVariable

Ensure: Present

Target:

- Process

NOTES

RELATED LINKS