-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M365TenantConfig.PS1 Unexpected token if displayname contains ' or , #3479
Comments
This is a challenging one. Within M365DSC there is no escaping of characters that might break the configuration. This is something we should look at. For now, I would recommend, to run search/replace within the configuration to add proper escaping to these values. |
Actually, what resource is exhibiting this behavior (e.g., AADApplication, TeamsMeetingPolicy, etc.) We should be able to handle this inside the resource itself. Thanks |
That's fine if it's a small export but going through 32,759 lines of the m365tenant.ps1 powershell every time you do an export makes it unusable and unfortunately not a solution. I've just done another export for the workload "intune" and the modules affected are: MSFT_IntuneGroupPolicyDefinitionValue and is limited to: |
I didn't mean that you should do this manually. It was meant for developers :D |
I've updated to the latest version 1.23.809.1 (it has fixed the exporting when using the app secret) and still have the same issue once exported. please see above comment as it's almost unusable when i'm planning on doing an export every time a change has been done to the environment. Thanks |
I am facing similar issue. Major Minor Build Revision 5 1 17763 1971 I did an export of the following components Exporting the config of tenant using the following command: .\M365TenantConfig.ps1 -Credential $TargetCredential throws below error: At C:\M365DSC\M365TenantConfig.ps1:115 char:63
The string is missing the terminator: ".
Unexpected token 'AADGroupsSettings"
Missing closing '}' in statement block or type definition.
|
@Ngims Hi, that is a different issue happening on ReverseDSC module, please raise a separate issue for this and attach your config file again as well. |
@ricmestre thanks for the response. Will do as requested. |
I'm still having the same issue using the current release C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1004.1 1.23.1004.1 once i've changed the displayname form ' to " i still can't get a full export as getting other errors about telemetry (i did # out the line) then errors about having the & in the name. I've attached a copy of the errors. PLease can you look into this as i cannot get a complete working mof created. Thanks |
I gave it up and using EntraExporter now :D |
I've revisited this and have changed all the non-standard displaynames (20 profiles) and i'm almost at the point where i can do a full export! |
Details of the scenario you tried and the problem that is occurring
exporting the config of tenant using the following command:
.\M365TenantConfig.ps1
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:44
Unexpected token 't' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:44
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:43
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1452 char:21
Missing closing ')' in subexpression.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:44
Unexpected token 't' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:44
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:43
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:2091 char:17
Unexpected token '}' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:2382 char:85
Missing argument in parameter list.
At C:\ll2_july2023\M365TenantConfig.ps1:4269 char:101
Missing argument in parameter list.
Not all parse errors were reported. Correct the reported errors and try again.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
Verbose logs showing the problem
.\M365TenantConfig.ps1
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:44
Unexpected token 't' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:44
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1294 char:43
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1452 char:21
Missing closing ')' in subexpression.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:44
Unexpected token 't' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:44
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:1814 char:43
There is an incomplete property assignment block in the instance definition.
At C:\ll2_july2023\M365TenantConfig.ps1:2091 char:17
Unexpected token '}' in expression or statement.
At C:\ll2_july2023\M365TenantConfig.ps1:2382 char:85
Missing argument in parameter list.
At C:\ll2_july2023\M365TenantConfig.ps1:4269 char:101
Missing argument in parameter list.
Not all parse errors were reported. Correct the reported errors and try again.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
Suggested solution to the issue
Please can you allow for the displayname to contain any characters that will not stop the localhost.mof being created?
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
1.23.517.1 i've updated to 1.23.712.1 and still have the same issue
The text was updated successfully, but these errors were encountered: