PowerShell / PSDesiredStateConfiguration

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

fix bug in Get-DscResource #13

Closed TravisEz13 closed 5 years ago

TravisEz13 commented 5 years ago

sometimes we would fail on

GetResourceFromKeyword -keyword $_ -patterns $patterns -modules $modules

if modules was empty

fix for #11 should be merged first and test enabled

TravisEz13 commented 5 years ago

VERBOSE:           Expected an exception, with message 'Invalid Resource Name 'santoheusnaasonteuhsantoheu' or module specification.', with FullyQualifiedErrorId 'InvalidResourceSpecification,Invoke-DscResource' to be thrown, but the message was 'Cannot bind argument to parameter 'modules' because it is null.' and the FullyQualifiedErrorId was 'ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ForEachObjectCommand'. from D:\a\1\s\out\PSDesiredStateConfiguration\2.0.0\PSDesiredStateConfiguration.psm1:4002 char:13 |  
-- | --
  | VERBOSE:               +             ForEach-Object -Process { |  
  | VERBOSE:               +             ~~~~~~~~~~~~~~~~~~~~~~~~~ |  
  | VERBOSE:           97:                     Should -Throw -ErrorId 'InvalidResourceSpecification,Invoke-DscResource' -ExpectedMessage 'Invalid Resource Name ''santoheusnaasonteuhsantoheu'' or module specification.' |  
  | VERBOSE:           at <ScriptBlock>, D:\a\1\s\test\PSDesiredStateConfiguration.Tests.ps1: line 94