none
Desired State Configuration Manager Caching Custom Resource Scripts

    Question

  • It seems like DSC is somehow caching the custom resource scripts.

    Repro steps:

    1. Add a custom DSC resource
    2. Run Start-DscConfiguration to exercise my new resource
    3. Modify the resource in c:\windows\system32\Windows PowerShell\.. (adding Write-Verbose statements for example)
    4. Run Start-DscConfiguration again
    5. The new Write-Verbose statements are not executed

    If I reboot the computer, I do see the Write-Verbose statements executed.

    Feels like I'm missing something obvious...


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    Friday, September 27, 2013 3:30 PM

Answers

  • Received help on this offline, bringing the answer back to the thread:

    "DSC runs in the WMI Provider Host Process (WmiPrvSE). Mostly there are many instances of WmiPrvSE running. In order to find out in which of these the DSC engine is hosted, you can do this (below).  This will list the process ID of the WmiPrvSE which is hosting the DSC engine.  In order to update your provider, you would need to kill the WmiPrvSE process and begin again."

    ###
    ### find the Process that is hosting the DSC engine
    ###
    $dscProcessID = Get-WmiObject msft_providers | 
    Where-Object {$_.provider -like 'dsccore'} | 
    Select-Object -ExpandProperty HostProcessIdentifier 
    
    ###
    ### Kill it
    ###
    Get-Process -Id $dscProcessID | Stop-Process
    


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    • Marked as answer by Craig Martin Tuesday, October 15, 2013 9:07 PM
    Tuesday, October 15, 2013 9:06 PM

All replies

  • Hi,

    Thank you for your question.  

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

    TechNet Subscriber Support

    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.


    Cataleya Li
    TechNet Community Support

    Monday, September 30, 2013 7:36 AM
    Moderator
  • Hi,

    For this issue, please check the below link to get more information about it

    Build Custom Windows PowerShell Desired State Configuration Resources

    http://technet.microsoft.com/en-us/library/dn249927.aspx

    Hope this helpful.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. 

    Wednesday, October 02, 2013 7:49 AM
  • Received help on this offline, bringing the answer back to the thread:

    "DSC runs in the WMI Provider Host Process (WmiPrvSE). Mostly there are many instances of WmiPrvSE running. In order to find out in which of these the DSC engine is hosted, you can do this (below).  This will list the process ID of the WmiPrvSE which is hosting the DSC engine.  In order to update your provider, you would need to kill the WmiPrvSE process and begin again."

    ###
    ### find the Process that is hosting the DSC engine
    ###
    $dscProcessID = Get-WmiObject msft_providers | 
    Where-Object {$_.provider -like 'dsccore'} | 
    Select-Object -ExpandProperty HostProcessIdentifier 
    
    ###
    ### Kill it
    ###
    Get-Process -Id $dscProcessID | Stop-Process
    


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    • Marked as answer by Craig Martin Tuesday, October 15, 2013 9:07 PM
    Tuesday, October 15, 2013 9:06 PM