I'd like a detailed example how to create a resource #977
Replies: 8 comments 9 replies
-
Here is my resource manifest ... it will not respond well when in included in a cofiguration # feature.dsc.resource.yaml
$schema: https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json
kind: resource
type: Visity.DSC.Windows/Feature
description: Windows OS Edition agnostic feature handling (WindowsFeature for Server & WindowsOptionalFeature for Clients)
version: 0.1.0
tags:
- os
- windows
- client
- server
- agnostic
- feature
- optional I get this error: 2025-07-17T07:29:26.929480Z ERROR dsc_lib::dscresources::command_resource: 878: trace_message="PID 66692: Failed to deserialize Include input: no variant of enum IncludeKind found in flattened data at line 1 column 57"
2025-07-17T07:29:26.930669Z DEBUG dsc_lib::dscresources::command_resource: 660: Process 'dsc' id 66692 exited with code 2
2025-07-17T07:29:26.932596Z ERROR dsc::subcommand: 208: Command: Resource 'dsc' [exit code 2] manifest description: Resource error |
Beta Was this translation helpful? Give feedback.
-
Nope, it is on my computer. If you are interested I can publish the code to my GitHub account
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Thursday, July 17, 2025 11:04:40 AM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
@IlleNilsson<https://github.com/IlleNilsson> do you have a repository were this is stored?
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4DMBBZWKC6SPJY5K7L3I5RKRAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZYHA4DMNI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You can find it at IlleNilsson, project called Microsoft.DSC.v3.Resorces.Venture
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Thursday, July 17, 2025 11:26:24 AM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
Yeah, would love to see what you're working on!
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4HPZBJGM3IZZRUYTHD3I5T4BAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZYHEYDSNA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
when you run dsc.exe test or configure
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Thursday, July 17, 2025 3:29:37 PM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
I'm not fully sure were you got the error, but if I'm looking at the resource manifest first:
get:
executable: pwsh
args:
- -NoLogo
- -NonInteractive
- -NoProfile
- -NoProfileLoadTime
- -CommandWithArgs
- |
$vars = Get-Variable
$vars
return ($vars | ConvertTo-Json -Compress)
input: stdin
It should be:
get:
executable: pwsh
args: [
"-NoLogo"
"-NonInteractive"
etc....
]
input: stdin
For a better example, check out the: https://github.com/PowerShell/DSC/blob/main/powershell-adapter/powershell.dsc.resource.json
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4APC4CCLR3VYELURIL3I6QMDAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZZGIYDAMI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, are you saying that only configuration documents can be written in YAML or JSON. Resources has to be JSON?
From: Gijs Reijn ***@***.***>
Sent: Thursday, 17 July 2025 16:28
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
Can you change with the suggestion I made and try again?
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4AJA5VKFYAIAQCOBC33I6XHHAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZZGI4TAOA>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I’m not trying to build an adapter,I’m trying to build a pwsh resource.
But what do I know
From: Gijs Reijn ***@***.***>
Sent: Sunday, 20 July 2025 16:55
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
Quite the opposite. Both should be able to accept JSON and YAML, even thought most resource examples are written in JSON.
What I was mainly looking at, was how your resource manifest was build up. If you look to the PsAdapter one, the arguments are different. Can you take a look to that one and try to pass the arguments the same way in your resource manifest? That might do the trick or point you in the right direction.
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4F7NFYOTAV2CYPO4D33JOUTBAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOBSGQ2TCNQ>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I would like to pick your bran. Maybe a podcast like dotnet rocks or run as radio. You might heard of the guys?
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Sunday, July 20, 2025 5:22:21 PM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
Class-based? That would mean you don't need a resource manifest.
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4HGCKFY26QOSIWAJX33JOX23AVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOBSGQ3DENY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I don’t discord but may be I should.
I just thought it would be good to have a podcast session since the tech is and it’s docs are young
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Sunday, July 20, 2025 5:55:46 PM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] I'd like a detailed example how to create a resource (Discussion #977)
I heard about run as radio. Wasn't Jason on there also? I've got something (probably) in the future planned with Andrew Pla, but you can always hit me up on Discord or LinkedIn.
—
Reply to this email directly, view it on GitHub<#977 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4ADWN2KTOCHTK42L4L3JO3YFAVCNFSM6AAAAACBW6PWB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOBSGQ3TOMQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
OSInfo, TSToy and others examples are not covering it all.
How do you pass paramets, arguments if you wish between the config yaml and the resource yaml file.
Im looking to do inline PowerShell 7+ in the resources
Beta Was this translation helpful? Give feedback.
All reactions