PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 491 forks source link

Parsing error on DSC configuration is incorrect on OSX #263

Closed adbertram closed 5 years ago

adbertram commented 8 years ago

I see this error on a DSC configuration of mine, but I can compile MOFs from this config just fine. I'm on OSX. Is this because CIM is not on OSX? If so, DSC parsing should be disabled altogether.

System.ArgumentNullException: Value cannot be null.
Parameter name: path1
   at System.IO.Path.Combine(String path1, String path2)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.Initialize(Collection`1 errors, List`1 modulePathList)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Dictionary`2 functionsToDefine, Collection`1 errors, List`1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Collection`1 errors)
   at System.Management.Automation.Language.Parser.ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

http://www.screencast.com/t/Ce0LkPDhZF

MrsMad commented 8 years ago

System.IO.Path is incorrect, use System.I.O.Path

On Thu, Aug 25, 2016 at 11:07 AM, Adam Bertram notifications@github.com wrote:

I see this error on a DSC configuration of mine, but I can compile MOFs from this config just fine. I'm on OSX. Is this because CIM is not on OSX? If so, DSC parsing should be disabled altogether.

System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine(String path1, String path2) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache. Initialize(Collection1 errors, List1 modulePathList) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache. LoadDefaultCimKeywords(Dictionary2 functionsToDefine, Collection1 errors, List1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache. LoadDefaultCimKeywords(Collection1 errors) at System.Management.Automation.Language.Parser. ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

http://www.screencast.com/t/Ce0LkPDhZF

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PowerShell/vscode-powershell/issues/263, or mute the thread https://github.com/notifications/unsubscribe-auth/AOcACd9uJeVPLCyoMpbQhaurLh-mvW56ks5qja-VgaJpZM4JtLEK .

adbertram commented 8 years ago

I don't have this reference anywhere in the DSC configuration.

On Thu, Aug 25, 2016 at 10:20 AM, MrsMad notifications@github.com wrote:

System.IO.Path is incorrect, use System.I.O.Path

On Thu, Aug 25, 2016 at 11:07 AM, Adam Bertram notifications@github.com wrote:

I see this error on a DSC configuration of mine, but I can compile MOFs from this config just fine. I'm on OSX. Is this because CIM is not on OSX? If so, DSC parsing should be disabled altogether.

System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine(String path1, String path2) at Microsoft.PowerShell.DesiredStateConfiguration. Internal.DscClassCache. Initialize(Collection1 errors, List1 modulePathList) at Microsoft.PowerShell.DesiredStateConfiguration. Internal.DscClassCache. LoadDefaultCimKeywords(Dictionary2 functionsToDefine, Collection1 errors, List1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions) at Microsoft.PowerShell.DesiredStateConfiguration. Internal.DscClassCache. LoadDefaultCimKeywords(Collection1 errors) at System.Management.Automation.Language.Parser. ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

http://www.screencast.com/t/Ce0LkPDhZF

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PowerShell/vscode-powershell/issues/263, or mute the thread https://github.com/notifications/unsubscribe-auth/ AOcACd9uJeVPLCyoMpbQhaurLh-mvW56ks5qja-VgaJpZM4JtLEK .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PowerShell/vscode-powershell/issues/263#issuecomment-242426299, or mute the thread https://github.com/notifications/unsubscribe-auth/AEG3-upjcZuZIwBKdKAPX4IOv2J7_TWaks5qjbK_gaJpZM4JtLEK .

daviwil commented 8 years ago

I haven't seen this issue specifically but I've seen others like it related to DSC, see this thread on Twitter:

https://twitter.com/andschwa/status/767799188109221889

It might be worth filing an issue on the PowerShell/PowerShell repo to see if there's a bug there.

adbertram commented 8 years ago

I don't get this error in the ISE or PowerShell Studio on Windows.

daviwil commented 8 years ago

It's definitely caused by the open-source build of PowerShell. That's why I think it'd make sense to file a bug on PowerShell/PowerShell to see if it's a bug or just a missing dependency.

SydneyhSmith commented 5 years ago

Closing this issue as inactive, will re-open if this is still an issue.

rjmholt commented 5 years ago

Looks like this was a bug in the PowerShell parser itself. Hopefully it's been corrected in PowerShell (very likely) but if not, please open an issue in the PowerShell repo