Невозможно загрузить модуль SystemLocaleDsc - PullRequest
0 голосов
/ 24 сентября 2018

Я только что импортировал модуль SystemLocaleDsc, и он сообщает об ошибке, как показано ниже

[PowerShell] Не удалось найти модуль 'SystemLocaleDsc'

Примечание. Я импортировал модуль PSCDesiredStateConfiguration и пока япопробуйте импортировать модуль SystemLocaleDsc. Я получил ошибку, о которой упоминал выше.

Ниже приведен фрагмент из моего скрипта PowerShell:

configuration EnableIISFeature
{
  Import-DSCResource -ModuleName PsDesiredStateConfiguration
  Import-Dscresource -ModuleName SystemLocale
    node localhost
    {
        WindowsFeature IIS 
        {
            Ensure = "Present"
            Name   = "Web-Server"
        }

        SystemLocale SystemLocaleExample
        {
            IsSingleInstance = 'Yes'
            SystemLocale     = 'en-AU'
        }

    }
}

Строка "Import-Dscresource -ModuleName SystemLocale" имеет видкрасный с ошибкой [PowerShell] Не удалось найти модуль 'SystemLocaleDsc'

Пожалуйста, помогите

Спасибо.

PS: Не уверен, что искатьно вот вывод Get-DscResource

PS C: \ Windows \ system32> Get-DscResource

ImplementedAs   Name                      ModuleName                     Version    Properties
-------------   ----                      ----------                     -------    ----------
Binary          File                                                                {DestinationPath, Attributes, Checksum, Conten...
Binary          SignatureValidation                                                 {SignedItemType, TrustedStorePath}
PowerShell      PackageManagement         PackageManagement              1.0.0.1    {Name, AdditionalParameters, DependsOn, Ensure...
PowerShell      PackageManagementSource   PackageManagement              1.0.0.1    {Name, ProviderName, SourceUri, DependsOn...}
PowerShell      Archive                   PSDesiredStateConfiguration    1.1        {Destination, Path, Checksum, Credential...}
PowerShell      Environment               PSDesiredStateConfiguration    1.1        {Name, DependsOn, Ensure, Path...}
PowerShell      Group                     PSDesiredStateConfiguration    1.1        {GroupName, Credential, DependsOn, Description...
Composite       GroupSet                  PSDesiredStateConfiguration    1.1        {DependsOn, PsDscRunAsCredential, GroupName, E...
Binary          Log                       PSDesiredStateConfiguration    1.1        {Message, DependsOn, PsDscRunAsCredential}
PowerShell      Package                   PSDesiredStateConfiguration    1.1        {Name, Path, ProductId, Arguments...}
Composite       ProcessSet                PSDesiredStateConfiguration    1.1        {DependsOn, PsDscRunAsCredential, Path, Creden...
PowerShell      Registry                  PSDesiredStateConfiguration    1.1        {Key, ValueName, DependsOn, Ensure...}
PowerShell      Script                    PSDesiredStateConfiguration    1.1        {GetScript, SetScript, TestScript, Credential...}
PowerShell      Service                   PSDesiredStateConfiguration    1.1        {Name, BuiltInAccount, Credential, Dependencie...
Composite       ServiceSet                PSDesiredStateConfiguration    1.1        {DependsOn, PsDscRunAsCredential, Name, Startu...
PowerShell      User                      PSDesiredStateConfiguration    1.1        {UserName, DependsOn, Description, Disabled...}
PowerShell      WaitForAll                PSDesiredStateConfiguration    1.1        {NodeName, ResourceName, DependsOn, PsDscRunAs...
PowerShell      WaitForAny                PSDesiredStateConfiguration    1.1        {NodeName, ResourceName, DependsOn, PsDscRunAs...
PowerShell      WaitForSome               PSDesiredStateConfiguration    1.1        {NodeCount, NodeName, ResourceName, DependsOn...}
PowerShell      WindowsFeature            PSDesiredStateConfiguration    1.1        {Name, Credential, DependsOn, Ensure...}
Composite       WindowsFeatureSet         PSDesiredStateConfiguration    1.1        {DependsOn, PsDscRunAsCredential, Name, Ensure...
PowerShell      WindowsOptionalFeature    PSDesiredStateConfiguration    1.1        {Name, DependsOn, Ensure, LogLevel...}
Composite       WindowsOptionalFeatureSet PSDesiredStateConfiguration    1.1        {DependsOn, PsDscRunAsCredential, Name, Ensure...
PowerShell      WindowsPackageCab         PSDesiredStateConfiguration    1.1        {Ensure, Name, SourcePath, DependsOn...}
PowerShell      WindowsProcess            PSDesiredStateConfiguration    1.1        {Arguments, Path, Credential, DependsOn...}

1 Ответ

0 голосов
/ 25 сентября 2018

Проблема решена путем импорта модуля в пространство «Модули» в моей учетной записи Azure Automation.

...