PowerShell / PSDesiredStateConfiguration

Source for https://www.powershellgallery.com/packages/PSDesiredStateConfiguration module
MIT License
58 stars 14 forks source link

Invoke-DSCResource requires to exit powershell session to read any changes to powershell resource #68

Open bagajjal opened 3 years ago

bagajjal commented 3 years ago

I'm using 7.2.0-preview.6.

Repro steps - 1) Have a test powershell resource that's working fine. 2) inside powershell session, run invoke-dscresource 3) Now add a write-verbose / write-host / write-debug statement in the execution flow. 4) in the same powershell session, run invoke-dscresource again. 5) You wouldn't see the log added in step 3

To see the log added in step 3, you need to completely exit the powershell session and launch powershell session again.

Invoke-DscResource doesn't see the latest changes unless I completely exit the powershell session. This makes developer life very difficult to debug.

As far as I remember, this scenario worked before DSC code is pulled from powershell repository.