Skip to content
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

Should ZeroDSC export Import-DscResource? #22

Closed
alx9r opened this issue Nov 27, 2016 · 0 comments
Closed

Should ZeroDSC export Import-DscResource? #22

alx9r opened this issue Nov 27, 2016 · 0 comments
Labels

Comments

@alx9r
Copy link
Owner

alx9r commented Nov 27, 2016

PowerShell implements Import-DscResource as a dynamic keyword. ZeroDSC implements its own Import-DscResource as a function. It looks like either Import-DscResource is only available within the respective configuration scriptblocks where it is used. This means that ZeroDSC does not have to export its Import-DscResource to operate correctly. However, if Import-DscResource is not exported, neither help nor intellisense works for Import-DscResource.

Pros:

  • intellisense works
  • appears in Get-Command output
  • help Import-DscResource displays something

Cons:

  • pollutes the namespace
  • might cause problems with intellisense (although cursory tests seem to indicate that intellisense correctly distinguishes between the dynamic keyword and function)
  • users might mistake the help output as help for the dynamic keyword

One compromise is to put an explicit note about the dynamic keyword in the help output for the ZeroDSC Import-DscResource output. I'm leaning toward this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant