You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
PowerShell implements
Import-DscResource
as a dynamic keyword. ZeroDSC implements its ownImport-DscResource
as a function. It looks like eitherImport-DscResource
is only available within the respective configuration scriptblocks where it is used. This means that ZeroDSC does not have to export itsImport-DscResource
to operate correctly. However, ifImport-DscResource
is not exported, neither help nor intellisense works forImport-DscResource
.Pros:
Get-Command
outputhelp Import-DscResource
displays somethingCons:
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.The text was updated successfully, but these errors were encountered: