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.

Issue running cmdltes from MicrosoftPowerBIMgmt Module

See original GitHub issue

System Details

System Details Output

### VSCode version: 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 x64

### VSCode extensions:
ms-vscode.powershell@2019.12.0


### PSES version:

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.14393.3383
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.3383
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with running cmdlets from MicrosoftPowerBIMgmt module. Same script works as expected in ISE but fails in Visual Studio Code. I am unable to run Get-PowerBIActivityEvent I believe the issue could be caused by version of the Newtonsoft.Json.dll that came with December version of the Powershell extension - it is 11.0.0 while the module requires 12.0.2 and higher

PS C:\Windows\system32> [Newtonsoft.Json.JsonConvert].Module

MDStreamVersion    : 131072
FullyQualifiedName : C:\Users\****\.vscode\extensions\ms-vscode.powershell-2019.12.0\modules\PowerShellEditorServices\bin\Desktop\Newtonsoft.Json.dll
ModuleVersionId    : 07e38931-19a9-45b2-9a35-e81930b1c8ad
MetadataToken      : 1
ScopeName          : Newtonsoft.Json.dll
Name               : Newtonsoft.Json.dll
Assembly           : Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
CustomAttributes   : {}
ModuleHandle       : System.ModuleHandle`

Expected Behaviour

execution the same cmdlet in ISE returns results as expected with no errors.

Actual Behaviour

I get the following error:

Get-PowerBIActivityEvent : Attempted to access an element as a type incompatible with the array.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...BIActivityEvent:GetPowerBIActivityEvent) [Get-PowerBIActivityEvent], ArrayTypeMismatchException
    + FullyQualifiedErrorId : Attempted to access an element as a type incompatible with the array.,Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEvent

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sqlchickcommented, Jun 14, 2020

Thank you, thank you, thank you @olyamusok for commenting about installation of PowerShell 7 – I also was getting blank [ ] results in VSCode when running Get-PowerBIActivityEvent, while getting results returned just fine from the ISE. At this time, version 7.0.2 (https://github.com/PowerShell/PowerShell/releases) is the latest & whatever it installed resolved the issue. (And just for completeness on this thread…the Powershell preview extension in VSCode also had no effect for me on this particular issue that I was facing.)

0reactions
TylerLeonhardtcommented, Mar 13, 2020

Can you all give the PowerShell Preview extension a try? We just did a release of it.

Don’t forget to disable the regular PowerShell extension for VS Code when you enable the PowerShell Preview extension for VS Code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install-Module -Name MicrosoftPowerBIMgmt error
Solved: Hi, powershell 5.1 version getting an error below when try install Install-Module -Name MicrosoftPowerBIMgmt. If try > GET-PSRepository.
Read more >
Power BI Cmdlets reference - Microsoft Learn
Below is a table of the Power BI PowerShell modules covered in this reference. Description, Module Name, PowerShell Gallery link. Rollup module ......
Read more >
PowerShell@2 task failing to install MicrosoftPowerBIMgmt ...
I'm using the PowerShell@2 Azure DevOps pipeline task to run a PS script that uses some Power BI cmdlets. For this I need...
Read more >
Update Power BI Cmdlet module MicrosoftPowerBIMgmt to ...
ℹ This blog post was originally posted by Microsoft in the Microsoft 365 message center. On July 30, 2021you may encounter log-in issues...
Read more >
M365 Changelog: Update Power BI Cmdlet module ...
As a result, MicrosoftPowerBIMgmt versions older than 1.0946 will ... To find out what version of the module you have, run this command...
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