You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
As pointed out in the Getting Started doc, I've configured an app registration with certificate authentication , assigned the correct API permissions and granted the Global Administrator role. I have configured the VM to use certificate based authentication.
I'm trying to run the build.ps1 script after making the following changes to the source code present in the /main branch:
Adding AzTenantId, AzTenantName ,AzSubscriptionId, AzKeyVaultName, AzKeyVaultTenantId, AzKeyVaultServicePrincipalApplicationId, AzWorkerServicePrincipalApplicationId to Azure.yml
Modified Configurations.yml file to only include cAADGroup in source\1-AllTenantsConfig\AzureAd\Configurations.yml and source\2-EnvironmentConfig\Dev\AzureAd\Configurations.yml
I'm facing the following error when I run the build.ps1 file in PowerShell 5.1 as an admin
ERROR: Cannot convert argument "module", with value: "System.Object[]", for "GetCachedClassesForModule" to type "System.Management.Automation.PSModuleInfo": "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Management.Automation.PSModuleInfo"."
At C:\Git\DSC\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\CompileRootConfiguration.build.ps1:44 char:1
+ task CompileRootConfiguration {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 15 tasks, 1 errors, 0 warnings 00:01:00.5359099
C:\Git\DSC\output\RequiredModules\InvokeBuild\5.10.4\Invoke-Build.ps1 : Cannot convert argument "module", with value: "System.Object[]", for "GetCachedClassesForModule" to type "System.Management.Automation.PSModuleInfo": "Cannot
convert the "System.Object[]" value of type "System.Object[]" to type "System.Management.Automation.PSModuleInfo"."
At C:\Git\DSC\build.ps1:511 char:9
+ Invoke-Build @PSBoundParameters -Task $Tasks -File $MyInvocat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument,Invoke-Build.ps1
Sorry for the late reply. The build works fine for me so I cannot say for sure what the issue is on your side.
But, my guess is this: The method GetCachedClassesForModule expects a System.Management.Automation.PSModuleInfo object. It seems there are multiple versions of some module available on the build machine based on your error message. The input seems to be an array of System.Management.Automation.PSModuleInfo which cannot be casted into a single object of that type.
Can you run the build again, please? If the build fails again, can you share me the content of the $PSModulePath variable?
$env:pSModulePath-split';'
Do you know of any duplicate modules on your build machine?
Hello,
As pointed out in the Getting Started doc, I've configured an app registration with certificate authentication , assigned the correct API permissions and granted the Global Administrator role. I have configured the VM to use certificate based authentication.
I'm trying to run the build.ps1 script after making the following changes to the source code present in the /main branch:
I'm facing the following error when I run the build.ps1 file in PowerShell 5.1 as an admin
Attached the log file for reference
CompileRootConfiguration.log
Looking forward to hearing back
The text was updated successfully, but these errors were encountered: