From 6721a153404581c5a80e74b0029f1258f86b2c2e Mon Sep 17 00:00:00 2001 From: gaelcolas Date: Fri, 12 Jul 2019 13:22:21 -0700 Subject: [PATCH 01/12] adding Invoke-DscResource RFC Draft --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md new file mode 100644 index 00000000..08250302 --- /dev/null +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -0,0 +1,126 @@ +--- +RFC: RFCXXXX +Author: Gael Colas +Status: Draft +SupersededBy: N/A +Version: 0.6 +Area: Microsoft.PowerShell.DesiredStateConfiguration +--- + +# Invoke-DscResource + +Add support for `Invoke-DscResource` in PowerShell 7+. + +This RFC addresses the need to leverage the DSC ecosystem of resources from newer versions of PowerShell, the way to decouple the execution of resources from the LCM and CIM/WMI, and the user experience from a consumer and solution vendor/integrator point of view. + +## Motivation + +1. DSC has been cited by users and solution partners as a blocker for moving from Windows PowerShell to PowerShell 7+. + +2. As part of the latest survey on DSC usage started in June 2019, the top requested feature was support for Invoke-DscResource in PSCore without WMI dependency. + +3. The DSC Ecosystem and Community would greatly benefit from enabling DSC resources to be used in imperative scripts, in current user context. + +## Specification + +### Invoke-DscResource in a module, decoupled from PowerShell + +`Invoke-DscResource` is directly related to `Get-DscResource` in terms of user experience: Get provides the discoverability before the invocation. + +`Invoke-DscResource` does not need to be part of the PowerShell engine (same as `Get-DscResource`), and we should aim to decouple PowerShell's engine from the DSC Ecosystem. While it's convenient for the `Configuration` keyword to have some of its implementation done in PowerShell's engine for parsing, `Invoke-DscResource` has no such requirements and should live in an independent module evolving in its own timeline, that will be bundled and shipped with PowerShell releases. + +Open-sourcing this module should be a priority, but is out of scope for this RFC. + +### Backward compatibility with Invoke-DscResource from PS 5.1 + +While we attempt to maintain the same command syntax, the behaviour will not be on par with `Invoke-DscResource` as found in PowerShell 5.1. + +Specifically, we already know some features that **will not be supported** in this initial scope of work: + +- Support for non-powershell resources (i.e. the Native/Binary or Python resources won't be supported) +- Running as System by default ([Discussed later in this document](#Default-Execution-Scope:-Current-runspace)) +- Schema validation of invocation/results (It will only validate against the Resource's functions' signatures) + +#### Syntax + +As we don't plan on changing the usage, plus the functions is currently not available outside of PowerShell, and there is currently no command for PowerShell 7+, there is no need to change the Syntax found in Windows PowerShell 5.1. + +The increment in PowerShell [MAJOR](https://semver.org/#spec-item-8)'s version field is enough to indicate the change of public API (as per [Semantic Versioning](https://semver.org/)). + +```text +Invoke-DscResource [-Name] [-Method] -ModuleName -Property [] +``` + +#### Default Execution Scope: Current runspace + +We aim at enabling existing scripts using `Invoke-DscResource`, written for Windows PowerShell 5.1, to "just work" in PowerShell 7+, but **in the current user context** if the **PsDscRunAsCredential** DSC common property is not supplied. + +```PowerShell +Invoke-DscResource -Name xFile -ModuleName @{ModuleName='PSDscResources';ModuleVersion='2.12.0.0'} -Method 'Set' -Properties @{ + GetScript = '<# My Get ScriptBlock #>' + SetScript = '<# My Set ScriptBlock #>' + TestScript = '<# My Test ScriptBlock #>' +} -Verbose +``` + +This should run in the current session state where the command is invoked. + +#### PsDscRunAsCredential: New Process as different user + +It's the user's responsibility to either leverage [PsDscRunAsCredential](https://docs.microsoft.com/en-us/powershell/dsc/configurations/runasuser) to execute the resource in a user context that has the required privilege, or wrapping the call in a user context that runs as system (such as using [Invoke-CommandAs](https://www.powershellgallery.com/packages/Invoke-CommandAs) by Mark Kellerman). + +`PsDscRunAsCredential` is a recommended practice to implement [least-privilege Administrative Models](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-least-privilege-administrative-models). + +Since we're now bypassing the LCM, we need to provide the feature in the `Invoke-DscResource`. + +The Parameter will be extracted from the `-Properties` argument, and used to invoke the Resource in a process running as that user. +It will be equivalent as (from within the `Invoke-DscResource` command point of view): + +So calling: +```PowerShell +Invoke-DscResource -Name Script -ModuleName @{ModuleName='PSDscResources';ModuleVersion='2.12.0.0'} -Method 'Set' -Properties @{ + GetScript = '<# My Get ScriptBlock #>' + SetScript = '<# My Set ScriptBlock #>' + TestScript = '<# My Test ScriptBlock #>' + PsDscRunAsCredential = $Credential +} -Verbose + +``` + +What will be executed will be equivalent (in terms of scope) to: + +```PowerShell +Start-Job -Credential $Credential -ScriptBlock { + Invoke-DscResource -Name Script -ModuleName @{ModuleName='PSDscResources';ModuleVersion='2.12.0.0'} -Method 'Set' -Properties @{ + GetScript = '<# My Get ScriptBlock #>' + SetScript = '<# My Set ScriptBlock #>' + TestScript = '<# My Test ScriptBlock #>' + } -Verbose +} +``` + +> NOTES: We're avoiding to take dependencies on other technologies that would require extra configurations or permissions (such as remoting), or would not be available on other OSes. + +# Out of Scope for initial work & other notes + +We're aware that some extra work or feature could be solved at the same time, but we're trying to have the MVP out as soon as possible, to help addressing the points raised in the [Motivation](#Motivation) section. + +## File Resource not supported + +Just for clarification, as the File resource is Native/Binary: + +```text +PS C:\ > Get-DscResource File + +ImplementedAs Name ModuleName Version Properties +------------- ---- ---------- ------- ---------- +Binary File {DestinationPath, Attributes, Checksum, Content... +``` + +This resource won't be supported with this initial work. Only Resources `ImplementedAs PowerShell`, will be supported. + +## Composite Resources not supported + +The **Composite resources** won't be supported for this initial scope. The support for composite would require `Invoke-DscResource` to understand and extract individual Resources called within the composite which is currently handled either in the PowerShell engine or through the `Configuration` function in the PSDesiredStateConfiguration module. + +Although it would be great to enable this scenario, decoupling the `Configuration` keyword from the MOF compilation is out of scope for this initial work. From e644c0085d66abb6a58069879bc95e0b5d981f13 Mon Sep 17 00:00:00 2001 From: Gael Date: Fri, 12 Jul 2019 13:47:53 -0700 Subject: [PATCH 02/12] Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md Co-Authored-By: Steve Lee --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 08250302..8cb5122c 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -9,7 +9,7 @@ Area: Microsoft.PowerShell.DesiredStateConfiguration # Invoke-DscResource -Add support for `Invoke-DscResource` in PowerShell 7+. +Add cross-platform support for `Invoke-DscResource` in PowerShell 7+ without dependency on LCM and WMI. This RFC addresses the need to leverage the DSC ecosystem of resources from newer versions of PowerShell, the way to decouple the execution of resources from the LCM and CIM/WMI, and the user experience from a consumer and solution vendor/integrator point of view. From 187426d7a9f00220c2e64b503ae7a9cfc8776148 Mon Sep 17 00:00:00 2001 From: Gael Date: Fri, 19 Jul 2019 16:02:11 +0200 Subject: [PATCH 03/12] cosmetic change - capitalization thanks Joey Co-Authored-By: Joey Aiello --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 8cb5122c..a8d9b5aa 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -37,7 +37,7 @@ While we attempt to maintain the same command syntax, the behaviour will not be Specifically, we already know some features that **will not be supported** in this initial scope of work: -- Support for non-powershell resources (i.e. the Native/Binary or Python resources won't be supported) +- Support for non-PowerShell resources (i.e. the native/binary or Python resources won't be supported) - Running as System by default ([Discussed later in this document](#Default-Execution-Scope:-Current-runspace)) - Schema validation of invocation/results (It will only validate against the Resource's functions' signatures) From 5ba72670d3ad61947a6380cd49473faec6084612 Mon Sep 17 00:00:00 2001 From: gaelcolas Date: Wed, 24 Jul 2019 23:28:38 +0200 Subject: [PATCH 04/12] updating RFC as per comments from Travis, Steve & Kevin --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 08250302..5692986a 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -33,7 +33,9 @@ Open-sourcing this module should be a priority, but is out of scope for this RFC ### Backward compatibility with Invoke-DscResource from PS 5.1 -While we attempt to maintain the same command syntax, the behaviour will not be on par with `Invoke-DscResource` as found in PowerShell 5.1. +It is **not the intention to have feature parity** between the version found with Windows PowerShell 5.1 and the one described in this RFC. + +While we attempt to maintain the same command syntax, the behavior will not be on par with `Invoke-DscResource` as found in PowerShell 5.1. Specifically, we already know some features that **will not be supported** in this initial scope of work: @@ -53,7 +55,7 @@ Invoke-DscResource [-Name] [-Method] -ModuleName NOTES: We're avoiding to take dependencies on other technologies that would require extra configurations or permissions (such as remoting), or would not be available on other OSes. +#### Independent and isolated execution + +`Invoke-DscResource` in PowerShell 7+ will not be aware of other instances being executed, and as such it will be possible to execute several instances in parallel when isolated in their own runspaces, or run in parallel with the LCM. + +This means that it enables concurrent execution, but also risks conflict if two conflicting resources are run simultaneously. + +It is up to the user to sequence the execution safely, or to create appropriate resources. + # Out of Scope for initial work & other notes We're aware that some extra work or feature could be solved at the same time, but we're trying to have the MVP out as soon as possible, to help addressing the points raised in the [Motivation](#Motivation) section. +## Invoke-DscResource will not clear the Builtin Provider Cache + +The Built-in provider cache, located in `$env:ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache`, is currently cleared by the LCM (in WMF 5.1). + +With an Invoke-DscResource advanced function as described in this RFC, it is not guaranteed to have enough permissions to that path (it's running in the current user context unless using `PSDscRunAsCredential`), nor do we assume exclusivity (LCM might be in use and running). + +For those reasons, it is not reasonable to expect `Invoke-DscResource` for PowerShell 7 to clear the cache, at least for scope of the MVP. + +DSC Resources that rely on this may experience unexpected behavior (compared to running `Invoke-DscResource` in WMF 5.1). It is up to the maintainers of those resource modules to handle (or not) this new possibility. + ## File Resource not supported Just for clarification, as the File resource is Native/Binary: From 2b53485a631dfbb0c8cbdd8a6d542075fa93038b Mon Sep 17 00:00:00 2001 From: gaelcolas Date: Wed, 24 Jul 2019 23:34:33 +0200 Subject: [PATCH 05/12] typ fix, spelled MVP --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 5692986a..15824a61 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -114,7 +114,7 @@ It is up to the user to sequence the execution safely, or to create appropriate # Out of Scope for initial work & other notes -We're aware that some extra work or feature could be solved at the same time, but we're trying to have the MVP out as soon as possible, to help addressing the points raised in the [Motivation](#Motivation) section. +We're aware that some extra work or feature could be solved at the same time, but we're trying to have the MVP (minimum viable product) out as soon as possible, to help addressing the points raised in the [Motivation](#Motivation) section. ## Invoke-DscResource will not clear the Builtin Provider Cache @@ -122,7 +122,7 @@ The Built-in provider cache, located in `$env:ProgramData\Microsoft\Windows\Powe With an Invoke-DscResource advanced function as described in this RFC, it is not guaranteed to have enough permissions to that path (it's running in the current user context unless using `PSDscRunAsCredential`), nor do we assume exclusivity (LCM might be in use and running). -For those reasons, it is not reasonable to expect `Invoke-DscResource` for PowerShell 7 to clear the cache, at least for scope of the MVP. +For those reasons, it is not reasonable to expect `Invoke-DscResource` for PowerShell 7 to clear the cache, at least for the scope of the MVP. DSC Resources that rely on this may experience unexpected behavior (compared to running `Invoke-DscResource` in WMF 5.1). It is up to the maintainers of those resource modules to handle (or not) this new possibility. From 1f1e3d68c561029e484ef5cbc67e8a586257c260 Mon Sep 17 00:00:00 2001 From: gaelcolas Date: Mon, 29 Jul 2019 11:35:07 +0200 Subject: [PATCH 06/12] adding alternate proposals & consideration from template --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 5efef622..61719c8a 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -3,7 +3,7 @@ RFC: RFCXXXX Author: Gael Colas Status: Draft SupersededBy: N/A -Version: 0.6 +Version: 0.8 Area: Microsoft.PowerShell.DesiredStateConfiguration --- @@ -145,3 +145,7 @@ This resource won't be supported with this initial work. Only Resources `Impleme The **Composite resources** won't be supported for this initial scope. The support for composite would require `Invoke-DscResource` to understand and extract individual Resources called within the composite which is currently handled either in the PowerShell engine or through the `Configuration` function in the PSDesiredStateConfiguration module. Although it would be great to enable this scenario, decoupling the `Configuration` keyword from the MOF compilation is out of scope for this initial work. + +# Alternate Proposals and Considerations + +none From c4519031813d753fdedd1446bf4db3d7b3910eb7 Mon Sep 17 00:00:00 2001 From: Gael Date: Tue, 13 Aug 2019 19:27:14 +0200 Subject: [PATCH 07/12] updating RFC with updated discussion/comments (#3) * updating RFC with updated discussion/comments * Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md Co-Authored-By: Travis Plunk * Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md * updating GET result as per Travis comment --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 137 ++++++++++++++++++---- 1 file changed, 116 insertions(+), 21 deletions(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 61719c8a..407e314c 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -3,7 +3,7 @@ RFC: RFCXXXX Author: Gael Colas Status: Draft SupersededBy: N/A -Version: 0.8 +Version: 0.9 Area: Microsoft.PowerShell.DesiredStateConfiguration --- @@ -45,7 +45,7 @@ Specifically, we already know some features that **will not be supported** in th #### Syntax -As we don't plan on changing the usage, plus the functions is currently not available outside of PowerShell, and there is currently no command for PowerShell 7+, there is no need to change the Syntax found in Windows PowerShell 5.1. +As we don't plan on changing the usage much, plus the functions is currently not available outside of PowerShell, and there is currently no command for PowerShell 7+, so there is no need to change the Syntax found in Windows PowerShell 5.1. The increment in PowerShell [MAJOR](https://semver.org/#spec-item-8)'s version field is enough to indicate the change of public API (as per [Semantic Versioning](https://semver.org/)). @@ -58,7 +58,7 @@ Invoke-DscResource [-Name] [-Method] -ModuleName NOTES: We're avoiding to take dependencies on other technologies that would require extra configurations or permissions (such as remoting), or would not be available on other OSes. #### Independent and isolated execution -`Invoke-DscResource` in PowerShell 7+ will not be aware of other instances being executed, and as such it will be possible to execute several instances in parallel when isolated in their own runspaces, or run in parallel with the LCM. +`Invoke-DscResource` in PowerShell 7+ will not be aware of other instances being executed, and as such it will be possible to execute several instances in parallel when isolated in their own runspace, or run in parallel with the LCM. This means that it enables concurrent execution, but also risks conflict if two conflicting resources are run simultaneously. It is up to the user to sequence the execution safely, or to create appropriate resources. +#### Output & Types + +##### Get + +The `GET` function invoked via the LCM (WMF 5.1) returns a CIM representation of a hashtable, +and will be a `hashtable` for `Invoke-DscResource` in PS7+. + +##### Test + +The `TEST` function in WMF 5.1 returns a CIM object, with a `[bool]` NoteProperty +`InDesiredState` that has the boolean result of the test. + +```PowerShell +InDesiredState +-------------- +True +``` + +In PS7+, `Invoke-DscResource -Method Test ...` will return an object (not CIM) +that has the same `InDesiredState` Property. + +##### Set + +The `SET` function in WMF 5.1 returns a CIM object, with a `[bool]` NoteProperty +`RebootRequired`, corresponding whether the `$global:DSCMachineStatus` has been +set to 1. + +```PowerShell +RebootRequired +-------------- +False +``` + +In PS7+, `Invoke-DscResource -Method Set ...` will return an object (not CIM) that +has the same `RebootRequired` Property, based on whether `$global:DSCMachineStatus` +has been set to 1. + # Out of Scope for initial work & other notes We're aware that some extra work or feature could be solved at the same time, but we're trying to have the MVP (minimum viable product) out as soon as possible, to help addressing the points raised in the [Motivation](#Motivation) section. +## DSC Resource Parameters & Supported Types + +As the `Invoke-DscResource` does not need to serialize and deserialize parameters +using CIM (via MOF objects), it is not limiting the types it can accept for the +DSC Resource functions (Get, Set, Test). + +In simple words, a resource could in theory accept an `[hashtable]` as a parameter +type, instead of a `[Microsoft.Management.Infrastructure.CimInstance[]]`. + +The downside here is that it's not backward compatible, for this reason, we +can't recommend any other type to be used for now. + +Also, not all types are easily serializable and deserializable, so be careful +when the Configuration Data has to be passed to the resource invocation over +the network. + +## PsDscRunAsCredential Support not built-in + +Here's why we've decided to not handle the `PsDscRunAsCredential` from the `Invoke-DscResource` +advanced function, and instead will try to publish a wrapper on the PS Gallery. + +To be truly cross platform and support invoking a resource's method under another +credential, Linux/Unix OSes creates another process under that user. In Windows +it is also possible to Impersonate a user, using `Win32.AdvApi32` for instance. + +In WMF 5.1, the LCM is in charge of this. But in PowerShell 7+, the only cross platform +way to do this is by using PowerShell Jobs, which are relatively slow, heavy, and +a bit more tricky to troubleshoot, as they need a way to serialize and deserialize +objects. + +In PowerShell, executing commands as job returns what we informally call "dead objects": +the object after it was serialized and then deserialized, pertaining most of its +properties but not an "live" object that still has its methods available. + +Here, we could have `Invoke-DscResource` to always use Jobs, but that would severely +impact performance, and would make troubleshooting difficult. + +We could, as initially thought, handle both case: directly as the current user when +`PsDscRunAsCredential` is not specified, and as Job when specified, but it would +then have two different behavior, depending on the `-Properties` value (and not +the command's actual signature), obfuscating the potential issue to the user. + +In the end, this is very much an Agent feature, and each agent author may want to +(and already do) support this themselves, so it's unnecessary code and complexity +for them. + +For those reasons, and with the possibility that an elegant or standardized solution +emerges from the community, we believe it's best to leave it outside the scope of +the `Invoke-DscResource` MVP. + +In order to enable existing users to support the same behavior than the LCM, +we will try to provide, separately, a function that wraps around this `Invoke-DscResource` +and creates a job when `PsRunAsCredential` is specified, but this won't be part +of the `PSDesiredStateConfiguration` module work. + ## Invoke-DscResource will not clear the Builtin Provider Cache The Built-in provider cache, located in `$env:ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache`, is currently cleared by the LCM (in WMF 5.1). From 83e99d0111729be37bedbfd2383b6941c0c9c996 Mon Sep 17 00:00:00 2001 From: Gael Date: Thu, 15 Aug 2019 20:47:40 +0200 Subject: [PATCH 08/12] Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md properties to property Co-Authored-By: Travis Plunk --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 407e314c..2997002f 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -195,7 +195,7 @@ impact performance, and would make troubleshooting difficult. We could, as initially thought, handle both case: directly as the current user when `PsDscRunAsCredential` is not specified, and as Job when specified, but it would -then have two different behavior, depending on the `-Properties` value (and not +then have two different behavior, depending on the `-Property` value (and not the command's actual signature), obfuscating the potential issue to the user. In the end, this is very much an Agent feature, and each agent author may want to From d2ff944a4439e6fe76c8fab5bc6dc944f4c69706 Mon Sep 17 00:00:00 2001 From: Gael Date: Thu, 15 Aug 2019 20:47:53 +0200 Subject: [PATCH 09/12] Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md properties to property Co-Authored-By: Travis Plunk --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 2997002f..43d43acb 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -94,7 +94,7 @@ the `PsDscRunAsCredential` key/value pair from the properties. So calling: ```PowerShell -Invoke-DscResource -Name Script -ModuleName @{ModuleName='PSDscResources';ModuleVersion='2.12.0.0'} -Method 'Set' -Properties @{ +Invoke-DscResource -Name Script -ModuleName @{ModuleName='PSDscResources';ModuleVersion='2.12.0.0'} -Method 'Set' -Property @{ GetScript = '<# My Get ScriptBlock #>' SetScript = '<# My Set ScriptBlock #>' TestScript = '<# My Test ScriptBlock #>' From fb52e686e62007c5c42982b8586846375b6ac11a Mon Sep 17 00:00:00 2001 From: Gael Date: Thu, 15 Aug 2019 20:48:46 +0200 Subject: [PATCH 10/12] Update 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md properties to property Co-Authored-By: Travis Plunk --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 43d43acb..6c29af03 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -86,7 +86,7 @@ on the PowerShell Gallery to proxy this command, so that it handles `PsDscRunAsC to invoke the resource in a different user context, using PowerShell Jobs. If the key `PsDscRunAsCredential` is to be found amongst the keys of the -`-Properties` parameter, then `Invoke-DscResource` will throw an exception, +`-Property` parameter, then `Invoke-DscResource` will throw an exception, unless the `Invoke-DscResource` is invoked with the (new) switch parameter `-IgnorePsDscRunAsCredential`, in which case it will invoke the DSC Resource method after stripping the `PsDscRunAsCredential` key/value pair from the properties. From 8be61ff37ccceb8c1eddf5824a067d97f7366aa8 Mon Sep 17 00:00:00 2001 From: gaelcolas Date: Thu, 22 Aug 2019 21:55:19 +0800 Subject: [PATCH 11/12] updating according to comments - expanding LCM/WMI - reboot and $Global:DSCMachineStatus - superfluous text --- 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md index 6c29af03..d7edd670 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md @@ -9,9 +9,15 @@ Area: Microsoft.PowerShell.DesiredStateConfiguration # Invoke-DscResource -Add cross-platform support for `Invoke-DscResource` in PowerShell 7+ without dependency on LCM and WMI. +Add cross-platform support for `Invoke-DscResource` in PowerShell 7+ without dependency +on the [Local Configuration Manager](https://docs.microsoft.com/en-us/powershell/dsc/managing-nodes/metaconfig) +(LCM), the +[Common Information Model (CIM) or Windows Management Instrumentation (WMI)](https://devblogs.microsoft.com/scripting/should-i-use-cim-or-wmi-with-windows-powershell/). -This RFC addresses the need to leverage the DSC ecosystem of resources from newer versions of PowerShell, the way to decouple the execution of resources from the LCM and CIM/WMI, and the user experience from a consumer and solution vendor/integrator point of view. +This RFC addresses the need to leverage the DSC ecosystem of resources from newer +versions of PowerShell, the way to decouple the execution of resources from the +LCM and CIM/WMI, and the user experience from a consumer and solution vendor/integrator +point of view. ## Motivation @@ -55,7 +61,9 @@ Invoke-DscResource [-Name] [-Method] -ModuleName Date: Wed, 23 Oct 2019 15:21:15 -0700 Subject: [PATCH 12/12] Prepare Invoke-DscResource (RFC0047) for acceptance --- .../RFC0047-RFC-Invoke-DscResource.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md => 4-Experimental-Accepted/RFC0047-RFC-Invoke-DscResource.md (99%) diff --git a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md b/4-Experimental-Accepted/RFC0047-RFC-Invoke-DscResource.md similarity index 99% rename from 1-Draft/RFCXXXX-RFC-Invoke-DscResource.md rename to 4-Experimental-Accepted/RFC0047-RFC-Invoke-DscResource.md index d7edd670..d5a30191 100644 --- a/1-Draft/RFCXXXX-RFC-Invoke-DscResource.md +++ b/4-Experimental-Accepted/RFC0047-RFC-Invoke-DscResource.md @@ -1,7 +1,7 @@ --- -RFC: RFCXXXX +RFC: RFC0047 Author: Gael Colas -Status: Draft +Status: Experimental-Accepted SupersededBy: N/A Version: 0.9 Area: Microsoft.PowerShell.DesiredStateConfiguration