microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.56k stars 486 forks source link

Trying to compile DSC config file into MOF using Azure Automation runbook #3853

Open sdfarquhar opened 11 months ago

sdfarquhar commented 11 months ago

Description of the issue

Hello, I'm trying to setup a DSC config compile to create the MOF file in an Azure Automation runbook and running into issues. I'm able to pull the config files down to the runbook session however when I call the M365TenantConfig.ps1 I get the following error:

"The term 'True' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

Microsoft 365 DSC Version

1.23.1004.1

Which workloads are affected

SharePoint Online

The DSC configuration

No response

Verbose logs showing the problem

"The term 'True' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

Environment Information + PowerShell Version

Running in an Azure Automation runbook version 5.1.
sdfarquhar commented 11 months ago

I believe I found my issue. The extract of SPO to the M36TenantConfig.ps1 creates the line below "ManagedIdentity = True;". Notice there is no dollar sign like there is in the other sections. I edited the file and ran again and it appears to work. I assume this is a bug with the SPO extract.

SPOHomeSite "SPOHomeSite" { Ensure = "Absent"; IsSingleInstance = "Yes"; ManagedIdentity = True; TenantId = $OrganizationName; }