microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
349 stars 121 forks source link

Get-PowerBIActivityEvent fails to Collect Data using PowerShell Extension in VSCode #393

Open JKChai opened 1 year ago

JKChai commented 1 year ago

I am having an issue while calling Get-PowerBIActivityEvent cmdlet on PowerShell Extension in Visual Studio Code which returns empty arrays. I ran it on Windows PowerShell terminal, and it works perfectly fine. Other MicrosoftPowerBIMgmt cmdlets seem to work fine on PowerShell Extension, thus, I am suspecting that it might just be Get-PowerBIActivityEvent cmdlet issue. I might be wrong though 😶 and isn't sure if this is a bug issue 🐛.

Windows PowerShell Terminal version: 5.1.19041.3031 PowerShell Extension Terminal version: 2023.6.0

MicrosoftPowerBIMgmt info |Item|Value| |---|---| | version | 1.2.1111 | | Installed Module Path | $HOME\Documents\WindowsPowerShell\Modules |
Visual Studio Code info |Item|Value| |---|---| | Version | 1.80.1 (user setup) | | Electron | 22.3.14 | | Chromium | 108.0.5359.215 | | Node.js | 16.17.1 | | V8 | 10.8.168.25-electron.0 | | OS | Windows_NT x64 10.0.19044 |

Actual

The cmdlet returns empty arrays.

[
  {
    "Id": [],
    "RecordType": [],
    "CreationTime": [],
    "Operation": [],
    "OrganizationId": [],
    "UserType": [],
    "UserKey": [],
    "Workload": [],
    "UserId": [],
    "ClientIP": [],
    "UserAgent": [],
    "Activity": [],
    "ItemName": [],
    "WorkSpaceName": [],
    "DatasetName": [],
    "ReportName": [],
    "CapacityId": [],
    "CapacityName": [],
    "WorkspaceId": [],
    "ObjectId": [],
    "DatasetId": [],
    "ReportId": [],
    "ArtifactId": [],
    "ArtifactName": [],
    "IsSuccess": [],
    "ReportType": [],
    "RequestId": [],
    "ActivityId": [],
    "DistributionMethod": [],
    "ConsumptionMethod": [],
    "ArtifactKind": []
  }
]

Expected

I am expecting the cmdlet to collect the Activity Event data that looks like below which happens to work when running on Windows PowerShell terminal.

[
  {
    "Id": "xxxxxxxxx",
    "RecordType": 20,
    "CreationTime": "2023-07-19T00:04:42Z",
    "Operation": "ViewReport",
    "OrganizationId": "xxxxxxxxx",
    "UserType": 0,
    "UserKey": "xxxxxxxxx",
    "Workload": "PowerBI",
    "UserId": "xxxxxxxxx",
    "ClientIP": "xxxxxxxxx",
    "UserAgent": "xxxxxxxxx",
    "Activity": "ViewReport",
    "ItemName": "xxxxxxxxx",
    "WorkSpaceName": "xxxxxxxxx",
    "DatasetName": "xxxxxxxxx",
    "ReportName": "xxxxxxxxx",
    "CapacityId": "xxxxxxxxx",
    "CapacityName": "Default Capacity",
    "WorkspaceId": "xxxxxxxxx",
    "ObjectId": "xxxxxxxxx",
    "DatasetId": "xxxxxxxxx",
    "ReportId": "xxxxxxxxx",
    "ArtifactId": "xxxxxxxxx",
    "ArtifactName": "xxxxxxxxx",
    "IsSuccess": true,
    "ReportType": "PowerBIReport",
    "RequestId": "xxxxxxxxx",
    "ActivityId": "xxxxxxxxx",
    "DistributionMethod": "Shared",
    "ConsumptionMethod": "Power BI Web",
    "ArtifactKind": "Report"
  }
]
armourking commented 1 year ago

Having the same issue, but with it running inside of powershell (either the ISE or the script executed by Powershell.exe). I get all blank values. I get the expected number of items, say 364 event, but all events are blank in the fields.