Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

New-M365DSCDeltaReport: Error Occurs When Running New-M365DSCDeltaReport

Open yoinuma opened this issue 2 years ago • 11 comments

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

image

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 avatar Aug 27 '24 09:08 yoinuma

@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.

FabienTschanz avatar Aug 27 '24 15:08 FabienTschanz

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. image

yoinuma avatar Aug 28 '24 05:08 yoinuma

@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 avatar Aug 28 '24 12:08 FabienTschanz

@FabienTschanz The current version is as follows. image

Additionally, the result of running Get-Module Microsoft365DSC -ListAvailable is as follows. image

yoinuma avatar Aug 28 '24 13:08 yoinuma

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 avatar Aug 28 '24 13:08 FabienTschanz

@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.

image

yoinuma avatar Aug 30 '24 00:08 yoinuma

@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 avatar Aug 30 '24 16:08 FabienTschanz

@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.

yoinuma avatar Sep 11 '24 08:09 yoinuma

No idea how it's working now, but I'll take it. Can you therefore close the issue? šŸ‘

FabienTschanz avatar Sep 11 '24 14:09 FabienTschanz

@FabienTschanz Sure thing! This issue has been resolved, so I'll go ahead and close it. Thank you very much for your help!

yoinuma avatar Sep 11 '24 23:09 yoinuma

@yoinuma Seems like the issue isn't yet closed. Can you please close it? Thank you šŸ‘

FabienTschanz avatar Nov 07 '24 13:11 FabienTschanz