-
Notifications
You must be signed in to change notification settings - Fork 532
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
Improve PowerShell 7 support #4916
Improve PowerShell 7 support #4916
Conversation
d18a11e
to
033c268
Compare
|
||
```powershell | ||
Install-Module PSDesiredStateConfiguration -Force | ||
Install-Module PSDesiredStateConfiguration -RequiredVersion 2.0.7 -Force |
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 think it's either we add it to the manifest and remove this instruction from here, or leave it out of manifest and keep it here. I am afraid we'll end up having different versions listed in documentation and manifest otherwise.
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.
Okay, just a moment. Let me rephrase it so we don't have any ambiguity there.
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.
Updated, now using Update-M365DSCDependencies -Scope AllUsers
, which in itself goes to the manifest and installs the module if it isn't found in the current PowerShell 7 session.
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.
@NikCharlebois Can you please have a look at microsoft/DSCParser#50 as well?
Pull Request (PR) description
This Pull Request attempts to improve the support of PowerShell 7, especially the handling of the
PSDesiredStateConfiguration
module in version 1.0 with the cmdletGet-DscResource
. In PowerShell 7, the version 1.0 of this module does not return the DSC resources formatted properly. For this to work properly, the version 2.0.7 must be installed.This PR introduces a new module dependency to
PSDesiredStateConfiguration 2.0.7
and installs this one, if PowerShell Core is used. It then loads the cmdlets of this module with the PrefixPwsh
to make sure no naming conflicts happen with version 1.0.For this prefix to work, the Microsoft365DSC modules using cmdlets of the
PSDesiredStateConfiguration
module must check which PowerShell version they are running and then use the appropriate cmdlet.This PR depends on microsoft/DSCParser#50 for the best experience.
This Pull Request (PR) fixes the following issues