PowerShell / PSDesiredStateConfiguration

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

Get-DscResource is case sensitive to the resource name if module is not specified #11

Open TravisEz13 opened 5 years ago

TravisEz13 commented 5 years ago

On PowerShell Core:

Get-DscResource -Name PsModule

Expected

ResourceType  : MSFT_PSModule                                                                                                                                                                                            
Name          : PSModule                                                                                                                                                                                                  
FriendlyName  : PSModule                                                                                                                                                                                                  
Module        : PowerShellGet                                                                                                                                                                                             
ModuleName    : PowerShellGet                                                                                                                                                                                             
Version       : 2.2                                                                                                                                                                                                       
Path          : /usr/local/microsoft/powershell/7-preview/Modules/PowerShellGet/DscResources/MSFT_PSModule/MSFT_PSModule.psm1                                                                                             
ParentPath    : /usr/local/microsoft/powershell/7-preview/Modules/PowerShellGet/DscResources/MSFT_PSModule                                                                                                                
ImplementedAs : PowerShell                                                                                                                                                                                                
CompanyName   : Microsoft Corporation                                                                                                                                                                                     
Properties    : {Name, AllowClobber, DependsOn, Ensure…}

Actual

CheckResourceFound : The term 'psmodule' is not recognized as the name of a Resource.                                                                     
At C:\program files\powershell\7-preview\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3991 char:13                                
+             CheckResourceFound $Name $Resources                                                                                                         
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                         
+ CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException                                                                            
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,CheckResourceFound    

Workaround

Get-DscResource -Name PsModule -Module PowerShellGet