Skip to content

Latest commit

 

History

History
150 lines (116 loc) · 3.44 KB

Initialize-PsDscConfigDocument.md

File metadata and controls

150 lines (116 loc) · 3.44 KB
external help file GeneratedBy Module Name online version schema
PSDSC-help.xml
Sampler update_help_source task
PSDSC
2.0.0

Initialize-PsDscConfigDocument

SYNOPSIS

Initialize a DSC configuration document.

SYNTAX

Initialize-PsDscConfigDocument [-ResourceName] <String> [[-ResourceInput] <Hashtable>]
 [[-ResourceDescription] <String>] [-IsPwsh] [-IsWindowsPowerShell] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

The function Initialize-PsDscConfigDocument initializes a DSC configuration document. It can pick up 'resource' and 'adapter' from PowerShell or Windows PowerShell.

EXAMPLES

EXAMPLE 1

Initialize-PsDscConfigDocument -ResourceName 'Microsoft.Windows/Registry' -ResourceInput @{'keyPath' = 'HKCU\1'} -ResourceDescription 'Registry'

Returns: {"$schema":"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json","resources":\[{"name":"Registry","type":"Microsoft.Windows/Registry","properties":"@{keyPath=HKCU\\\\1}"}\]}

EXAMPLE 2

Init-PsDscConfigDocument -ResourceName Microsoft.WinGet.DSC/WinGetPackage -IsPwsh -ResourceInput @{ Id = 'Microsoft.PowerShell.Preview'} -ResourceDescription 'WinGetPackage'

Returns: {"$schema":"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json","resources":\[{"name":"Using Pwsh","type":"Microsoft.DSC/PowerShell","properties":"@{resources=}"}]}

PARAMETERS

-IsPwsh

Switch to indicate if the resource is using PowerShell. Adds 'Microsoft.DSC/PowerShell' type.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-IsWindowsPowerShell

Switch to indicate if the resource is using Windows PowerShell. Adds 'Microsoft.Windows/WindowsPowerShell' type.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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

-ResourceDescription

The resource description to provide.

Type: String
Parameter Sets: (All)
Aliases:

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

-ResourceInput

The resource input to provide. Supports PowerShell hash table.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-ResourceName

The resource name to execute.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
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

OUTPUTS

System.String

NOTES

For more details, go to module repository at: https://github.com/Gijsreyn/PSDSC.

RELATED LINKS