Skip to content

DSC Script Resource Docs example not working #2724

@n-pedersen

Description

@n-pedersen

Hi,
I was writing a DSC script and I noticed that the Example #2 did not work at all.

In the TestScript section:
TestScript = { $state = $GetScript if( $state['Result'] -eq $using:version ) { Write-Verbose -Message ('{0} -eq {1}' -f $state['Result'],$using:version) return $true } Write-Verbose -Message ('Version up-to-date: {0}' -f $using:version) return $false }
The example tries in the query result of the GetScript part, by using $GetScript in the TestScript section. The $GetScript variable only contains the scriptblock/source code from GetScript. No actual results that you returned in the GetScript section.
I don't know if it's a DSC script resource bug or if the documentation is wrong.
I could not get it working.

Documentation source:
https://github.com/PowerShell/PowerShell-Docs/blob/staging/dsc/scriptResource.md

Thanks,
N

Metadata

Metadata

Assignees

Labels

area-dscArea - Desired State Configuration

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions