私はカスタムDSCコンポジットリソースを作成して、誰かが光を当てることを望んでいたAzure Automationモジュールリストにアップロードすることに問題があります。今、もしAzure AutomationのカスタムPowerShell DSCコンポジットリソース
Configuration CompositeResource
{
Import-DscResource -ModuleName PSDesiredStateConfiguration
File ExampleFolder
{
DestinationPath = "C:\Example"
Type = "Directory"
}
}
:
$parentModulePath = 'C:\Program Files\WindowsPowerShell\Modules\CompositeExample'
mkdir $parentModulePath
New-ModuleManifest -RootModule CompositeExample –Path "$parentModulePath\CompositeExample.psd1"
$resourceModulePath = "$parentModulePath\DSCResources\CompositeResource"
mkdir $resourceModulePath
New-ModuleManifest -RootModule 'CompositeResource.schema.psm1' –Path "$resourceModulePath\CompositeResource.psd1"
Add-Content –Path "$resourceModulePath\CompositeResource.schema.psm1" –Value ''
そしてCompositeResource.schema.psm1ファイルで、私は次のコードを追加しました:私は、次のコードを実行することで、基本的なPowerShellのDSC複合リソースを作成しました私は、CompositeExample_1.0.zipとしてC:\ Program Files \ WindowsPowerShell \ Modules \ CompositeExampleフォルダを圧縮し、それを「クラシック」DSCサーバにアップロードして別の設定で参照しています。
しかし、私は(CompositeModule.zipとして)Azureのオートメーション内のモジュールとして追加する場合、私次のエラーを取得する:
Error importing the module CompositeExample. Import failed with the following error:
Orchestrator.Shared.AsyncModuleImport.ModuleImportException: An error occurred during
module validation. When importing the module to an internal PowerShell session, it was not
able to be loaded by PowerShell. There is likely an issue with the contents of the module
that results in PowerShell's not being able to load it. Please verify that the module
imports successfully in a local PowerShell session, correct any issues, and then try
importing again.
モジュールは、Azureのための別の方法で「バンドル」する必要がありますか、追加のファイルが必要ですか?