-
Notifications
You must be signed in to change notification settings - Fork 40
Implement WhatIf PS adapter #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement WhatIf PS adapter #840
Conversation
Hi @SteveL-MSFT. I tried implementing the what-if on the PS adapter, but it seems the Azure artifacts are unauthorized. Could you mind taking a look, please? |
2ec2255
to
3b715ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a fundamental concern about this although I appreciate the effort. In PowerShell, scripts/cmdlets can use ShouldProcess
as a way to get -whatif
support. In this PR, you're modeling whatIf
the same way we support it for native DSC resources. This ties into the conversation we had this morning about whether we should tell PS resource authors to have a class only for schema and implement functions instead where ShouldProcess
would work. Although I suppose we COULD still support allowing a whatIf
method on a class, but I would rather not create something no one will use.
"get": { | ||
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", | ||
"type": "Microsoft.DSC/PowerShell", | ||
"version": "0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we shipped, we should probably update this to 1.0.0 and increment as we make changes going forward, same for win-ps adapter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. I haven't tried using the ShouldProcess
. I wasn't sure if that could be captured into a variable and returned to the DSC engine.
c1824b9
to
95492ce
Compare
Related issue for defining method signatures to support for DSC: |
PR Summary
This PR addresses #446 by adding WhatIf capability in the PowerShell adapter
PR Context