Get-PowerBIWorkspace : Attempted to access an element as a type incompatible with the array
See original GitHub issueIssue Description
I’m receiving the following error when trying to use the Get-PowerBIWorkspace cmdlet in VS Code & Azure Data Studio:
Get-PowerBIWorkspace : Attempted to access an element as a type incompatible with the array. At line:1 char:1
I do not receive this error when running the exact same command in the ISE or PowerShell.exe, and I can reproduce these results on multiple machines.
System Details
- Operating system: Windows 7
- Azure Data Studio version 1.9.0 (system setup) - July 10th build (monthly release).
- PowerShell extension version 2019.5.0
- Output from
$PSVersionTable
5.1.14409.1018
Full error message
PS C:\temp> Get-PowerBIWorkspace
Get-PowerBIWorkspace : Attempted to access an element as a type incompatible with the array.
At line:1 char:1
+ Get-PowerBIWorkspace
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...owerBIWorkspace:GetPowerBIWorkspace) [Get-PowerBIWorkspace], ArrayTypeMismatchException
+ FullyQualifiedErrorId : Attempted to access an element as a type incompatible with the array.,Microsoft.PowerBI.Commands.Workspaces.GetPowerBIWorkspace
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Get-PowerBIWorkspace : Attempted to access an element as a ...
Get -PowerBIWorkspace : Attempted to access an element as a type incompatible with the array. At line:2 char:1 + Get-PowerBIWorkspace + ...
Read more >Using Get-PowerBIWorkspace PowerShell command
... I'm trying to get a list of Workspaces using PowerShell, and I'm getting an error "Attempted to access an element as a...
Read more >"get-PowerBiWorkspace" giving error like 'incompatible with ...
get -PowerBiworkspace : Attempted to access an element as a type incompatible with the array. At line:1 char:1 + get-PowerBiworkspace
Read more >Tag: get-powerbiworkspace : attempted to access an element ...
Resolved- Attempted to access an element as type incompatible with the array Today in this article, we will cover below aspects, ...
Read more >c# array of objects System.ArrayTypeMismatchException
ArrayTypeMismatchException : 'Attempted to access an element as a type incompatible with the array.' I was looking for answer but still can't ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SQLvariant agreed that it would be nice for module authors to know which versions of Newtonsoft they should use as this can be a very complicated issue…might be best to open an issue in PowerShell/PowerShell on how to handle C# module dependency management
It appears that the issue is caused by the version of the Newtonsoft.Json DLL being outdated (relative to what the PowerBI modules require).