<?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 Update parameter via Powershell API call in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1524303#M26632</link>
    <description>&lt;P&gt;Hello, I am having some difficulties updating a dataset parameter via the PBI rest api. I am using PowerShell and "Import-Module MicrosoftPowerBIMgmt".&lt;BR /&gt;&lt;BR /&gt;I have based my script on these ressources:&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/td-p/1167203" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/td-p/1167203&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am pretty sure I got the syntax right, but the script *sometimes* returns an error, and I can't see any cange in the dataset after running it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have defined a string parameter named ReportVersion which I am trying to update. The parameter has "enable load" checked off and is visible in the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I attempt to do it:&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;Connect-PowerBIServiceAccount

$datasetId = "my dataset id"

$urlUpdateParams = "https://api.powerbi.com/v1.0/myorg/datasets/$($datasetId)/Default.UpdateParameters"

$body = '{
    "updateDetails": [
    {
        "name": "ReportVersion",
        "newValue": "2.0"
    }
    ]
}'

$content = 'application/json'

write-host $urlUpdateParams
                
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method POST -Body $body -ContentType $content

Disconnect-PowerBIServiceAccount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get looks like this:&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;Invoke-PowerBIRestMethod : One or more errors occurred.
At C:\...\Power BI report upload tool 10.ps1:83 char:17
+ ...             Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method PO ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
    + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me pinpoint what is going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 13:31:24 GMT</pubDate>
    <dc:creator>h4tt3n</dc:creator>
    <dc:date>2020-11-30T13:31:24Z</dc:date>
    <item>
      <title>Update parameter via Powershell API call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1524303#M26632</link>
      <description>&lt;P&gt;Hello, I am having some difficulties updating a dataset parameter via the PBI rest api. I am using PowerShell and "Import-Module MicrosoftPowerBIMgmt".&lt;BR /&gt;&lt;BR /&gt;I have based my script on these ressources:&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/td-p/1167203" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/td-p/1167203&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am pretty sure I got the syntax right, but the script *sometimes* returns an error, and I can't see any cange in the dataset after running it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have defined a string parameter named ReportVersion which I am trying to update. The parameter has "enable load" checked off and is visible in the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I attempt to do it:&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;Connect-PowerBIServiceAccount

$datasetId = "my dataset id"

$urlUpdateParams = "https://api.powerbi.com/v1.0/myorg/datasets/$($datasetId)/Default.UpdateParameters"

$body = '{
    "updateDetails": [
    {
        "name": "ReportVersion",
        "newValue": "2.0"
    }
    ]
}'

$content = 'application/json'

write-host $urlUpdateParams
                
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method POST -Body $body -ContentType $content

Disconnect-PowerBIServiceAccount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get looks like this:&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;Invoke-PowerBIRestMethod : One or more errors occurred.
At C:\...\Power BI report upload tool 10.ps1:83 char:17
+ ...             Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method PO ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
    + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me pinpoint what is going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:31:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1524303#M26632</guid>
      <dc:creator>h4tt3n</dc:creator>
      <dc:date>2020-11-30T13:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameter via Powershell API call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1527772#M26659</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/194221"&gt;@h4tt3n&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;How many requests did you send? Request data size? AFAIK, rest API has its usage limitation, you can take a look at the official document to confirm if your test has exceeded the limits.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations" target="_self"&gt;Power BI REST API limitations&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 06:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1527772#M26659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-02T06:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameter via Powershell API call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1528727#M26664</link>
      <description>&lt;P&gt;I am not POST'ing any data to the dataset, just small querys to update parameters or refresh datasets. I find it very hard to believe that these queries should exceeded the daily limit.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 12:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1528727#M26664</guid>
      <dc:creator>h4tt3n</dc:creator>
      <dc:date>2020-12-02T12:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameter via Powershell API call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1538171#M26713</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/194221"&gt;@h4tt3n&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Any other operations based on rest API with your power bi contents? In addition, you can also try to remove the front part&amp;nbsp;of the URL, this part seems not to use in the document samples:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$urlUpdateParams = "/datasets/$($datasetId)/Default.UpdateParameters"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 08:25:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameter-via-Powershell-API-call/m-p/1538171#M26713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-08T08:25:01Z</dc:date>
    </item>
  </channel>
</rss>

