PSDesiredStateConfiguration
PSDesiredStateConfiguration copied to clipboard
Get-DscResource is case sensitive to the resource name if module is not specified
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