I received a message from the PowerShell Gallery script analyzer (PSScriptAnalyzer) that the DSC Configuration scripts I posted contain an error regarding loading xPSDesiredStateConfiguration (error below, same error for all 4 Configuration Scripts).
While I’m not entirely sure, it appears to me that the issue is due to the host running the script analyzer not having the module loaded in it’s $env:PSModulePath- I can run all of my own DSC Configuration Scripts on a Windows 10 development VM that has xPSDesiredStateConfiguration so I never encountered this issue in development.
I’d really like to do what I can to resolve this so I am trying to figure out if I can correct this on my end or if I just have no control over what modules the analyzer’s host has loaded. Please note that xPSDesiredStateConfiguration is the same module being loaded by xChrome and xFirefox, both currently on the gallery.
The lines that are triggering the script analyzer to return this error are:
Import-DscResource -ModuleName xPSDesiredStateConfiguration
as well as a call to xRemoteFile which is part of xPSDesiredStateConfiguration
ERROR: Invoke-ScriptAnalyzer : Parse error in file
C:\Users\psgadmin\Documents\WindowsPowerShell\Modules\xThunderbird\1.0.6\DSCResources\VH_xThunderbird\VH_xThunderbird.schema.psm1: Unable to load module
‘xPSDesiredStateConfiguration’: module not found at line 17 column 3.