Open weyCC81 opened 2 years ago
Thanks for bringing this to our attention.
The error is due to how the API response is described in the CSDL service metadata. The metadata says the API should return a JSON object, yet it returns a CSV file:
<Function Name="getOffice365ActiveUserCounts" IsBound="true" IsComposable="true">
<Parameter Name="reportRoot" Type="graph.reportRoot" />
<Parameter Name="period" Type="Edm.String" Nullable="false" Unicode="false" />
<ReturnType Type="Collection(graph.office365ActiveUserCounts)" Nullable="false" />
</Function>
The ideal representation should be:
<Function Name="getOffice365ActiveUserCounts" IsBound="true" IsComposable="true">
<Parameter Name="bindingParameter" Type="graph.reportRoot" />
<Parameter Name="period" Type="Edm.String" Nullable="false" Unicode="false" />
<ReturnType Type="graph.Report" Nullable="false" />
</Function>
As workaround, you can use the v1.0
version of the command to download the CSV file:
Select-MgProfile v1.0
Get-MgReportOffice365ActiveUserCount -Period D30 -OutFile "ActiveUserCount.csv"
I'll transfer the issue to the metadata repository.
Output to Commandline,Pipline not possible with the following Cmdlet:
Select-MgProfile -Name "beta"
Get-MgReportOffice365ActiveUserCount -Period D30 -Debug
Error:
Environment:
Debug: