< Back

Invoke-Dsc

Wed Jan 15, 2020 7:19 am

NAME Invoke-Dsc



SYNOPSIS

Invokes Dsc resources





SYNTAX

Invoke-Dsc [-Resource] <Object[]> [-Retry <Int32>] [-Delay <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Passes PSCustomObjects to Invoke-DscResource by invoking the Test method and

if the Test method fails invokes the Set method.





PARAMETERS

-Resource <Object[]>

Specifies the PSCustomObject to be passed to Invoke-DscResource



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Retry <Int32>

Specifies the amount of times to rety when the Local Configuration Manager State is busy.



Required? false

Position? named

Default value 5

Accept pipeline input? false

Accept wildcard characters? false



-Delay <Int32>

Specifies the amount of seconds between retries when the Local Configuration Manager State is busy.



Required? false

Position? named

Default value 60

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Wraps around the native Invoke-DscResource cmdlet and invokes them as native Dsc would

by running the test method first and if the test method fails it invokes the set method.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$r = ConvertTo-Dsc -Path 'c:\\Config\\NewFile.json'



Invoke-Dsc -Resource $r









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$r = ConvertTo-Dsc -Path 'c:\\Config\\NewFile.json'



Invoke-Dsc -Resource $r -Retry 5 -Dealy 60











RELATED LINKS