<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API Get Groups As Admin does Not Return a CapacityId in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1642069#M27655</link>
    <description>&lt;P&gt;Calls which did not expand the related entities had the same result.&amp;nbsp; I did further testing and modified the original post with updated info.&amp;nbsp; Is more a powershell issue then a Power BI API issue. &amp;nbsp; I guess this is why the cmdlets exist, I am going to turn back to the PS cmdlets as the issue I was having with them is easier to workaround than this issue.&amp;nbsp; Thanks for taking a look &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 13:47:41 GMT</pubDate>
    <dc:creator>TravisKale</dc:creator>
    <dc:date>2021-02-03T13:47:41Z</dc:date>
    <item>
      <title>PowerShell ConvertFrom-Json Does not Create All Properties of API Result</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1637129#M27603</link>
      <description>&lt;P&gt;I am issuing the following via PowerShell&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$apiResult = Invoke-PowerBIRestMethod -Url 'https://api.powerbi.com/v1.0/myorg/admin/groups?$expand=dashboards,users,reports,datasets,dataflows,workbooks&amp;amp;$top=5000' -Method Get | ConvertFrom-Json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The call works and everything is returned, however, on the Group object there is only a boolean "IsOnDedicatedCapcity" field, and not a CapacityId.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I exclude the | ConvertFrom-Json, and look at the Raw JSON, the property is there.&amp;nbsp;&amp;nbsp; I'm guessing since the first object returned does not have a CapacityId, when PowerShell tries to create an ojbect to store the result that the CapcityId property is excluded.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test this theory I changed the API call to use a filter to only return groups on a capacity via...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'https://api.powerbi.com/v1.0/myorg/admin/groups?$filter=isOnDedicatedCapacity eq true &amp;amp; $expand=dashboards,users,reports,datasets,dataflows,workbooks&amp;amp;$top=10'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, when I issue the ConvertFrom-Json, the CapacityId property is present on the object PowerShell creates for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is probably more of a PowerShell question at this point but is there a way to force the ConvertFrom-Json method to include all properties in the object array even if the first element property is not present?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:51:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1637129#M27603</guid>
      <dc:creator>TravisKale</dc:creator>
      <dc:date>2021-02-03T13:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: API Get Groups As Admin does Not Return a CapacityId</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1637621#M27604</link>
      <description>&lt;P&gt;wonder what happens when you don't expand the related entities?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 04:51:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1637621#M27604</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-02-02T04:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: API Get Groups As Admin does Not Return a CapacityId</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1642069#M27655</link>
      <description>&lt;P&gt;Calls which did not expand the related entities had the same result.&amp;nbsp; I did further testing and modified the original post with updated info.&amp;nbsp; Is more a powershell issue then a Power BI API issue. &amp;nbsp; I guess this is why the cmdlets exist, I am going to turn back to the PS cmdlets as the issue I was having with them is easier to workaround than this issue.&amp;nbsp; Thanks for taking a look &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:47:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-ConvertFrom-Json-Does-not-Create-All-Properties-of/m-p/1642069#M27655</guid>
      <dc:creator>TravisKale</dc:creator>
      <dc:date>2021-02-03T13:47:41Z</dc:date>
    </item>
  </channel>
</rss>

