question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-PowerBIWorkspace : Attempted to access an element as a type incompatible with the array

See original GitHub issue

Issue 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:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SydneyhSmithcommented, Aug 20, 2019

@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

1reaction
rapidpulsecommented, Aug 7, 2019

It appears that the issue is caused by the version of the Newtonsoft.Json DLL being outdated (relative to what the PowerBI modules require).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found