New-M365DSCDeltaReport: Error Occurs When Running New-M365DSCDeltaReport
Description of the issue
I encountered an error when running the New-M365DSCDeltaReport command.
Invoke-Expression : At line:1 char:63
+ ... $typeStaticMethods = [] | gm - ...
+ ~
Missing type name after '['.
At line:4 char:46
+ []::TryParse($subExpressi ...
+ ~
Missing type name after '['.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.6\Modules\DSCParser.psm1:279 char:25
+ ... Invoke-Expression -Command $scriptBlock | Out-N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : MissingTypename,Microsoft.PowerShell.Commands.InvokeExpressionCommand
The version details are as follows:
1.24.703.1 Microsoft365DSC
Command :
New-M365DSCDeltaReport -Source "c:\temp\dsc\M365TenantConfig20240820.ps1" -Destination "c:\temp\dsc\InitialM365TenantConfig.ps1" -OutputPath "c:\temp\dsc\delta20240820.html"
Microsoft 365 DSC Version
1.24.703.1
Which workloads are affected
other
The DSC configuration
No response
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
@yoinuma Please update to the latest Microsoft365DSC module version and then try again in a fresh elevated Windows PowerShell session. The issue might be caused because the modules can't be loaded.
Thank you for the support @FabienTschanz,
I have updated the Microsoft365DSC module to the latest version and tested it in a new elevated PowerShell session, but the same error persists and the issue has not been resolved.
@yoinuma The message just under the command indicates that there is still a newer version available. What version of it are you running? --> Get-Module Microsoft365DSC -ListAvailable.
Did you update it with Update-M365DSCModule? If not, please run that command as well in an elevated Windows PowerShell session.
@FabienTschanz The current version is as follows.
Additionally, the result of running Get-Module Microsoft365DSC -ListAvailable is as follows.
Can you try the command Install-Module Microsoft365DSC -Force -AllowClobber, restart the PowerShell session, and run Get-Module Microsoft365DSC -ListAvailable again? Then a new version should be installed. After that, please run Update-M365DSCModule again.
If it still doesn't work, run Uninstall-Module Microsoft365DSC -Force, and install it again.
@FabienTschanz Thank you for your response. I followed the steps you provided, but unfortunately, Iām still encountering an error. It seems to be occurring during the parsing of the SPOTheme.
@yoinuma Can you share a part of the configuration that's failing? Maybe you can narrow it down by using only a subset of the resources in the configuration. If you find one that definitely fails, please share it here for us to have a look at it. Thank you.
@FabienTschanz Sorry for the delayed response.
I was able to successfully complete the New-M365DSCDeltaReport command without any errors by taking the following steps:
- Upgraded the microsoft365dsc version to 1.24.904.1
- Created a new comparison file by running Export-M365DSCConfiguration
- Executed New-M365DSCDeltaReport
Thank you for your support. Thanks to your help, the issue has been resolved.
No idea how it's working now, but I'll take it. Can you therefore close the issue? š
@FabienTschanz Sure thing! This issue has been resolved, so I'll go ahead and close it. Thank you very much for your help!
@yoinuma Seems like the issue isn't yet closed. Can you please close it? Thank you š