<?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 Problems using Invoke-PowerBIRestMethod to update parameters in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2931163#M39985</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello community,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’m working with multiple workspaces, reports and using powershell script that takes simple CSV file to determine what .pbix file goes into which workspace and what parameters to update (if any).&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The script is really simple. It verifies if report name (full path has been received as a command line parameter) exists in the publisher.csv file. If exists then extract all values from a corresponding row (workspace name, dataset refresh request, parameter1 and parameter2 name, parameter1 value and parameter2 value) from the publisher.csv file (based on this &lt;A href="https://powerofbi.org/2021/01/27/powershell-script-to-publish-power-bi-reports/" target="_self"&gt;blog&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test the script, I'm using hardcoded $body and $url variables with&lt;SPAN&gt;&amp;nbsp;Invoke-PowerBIRestMethod REST POST call:&lt;BR /&gt;&lt;/SPAN&gt;&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;#Group ID and Dataset ID 
$urlbase = "groups/4bc15b4f-5dc8-49e3-aaba-XXXXXXXXXXXX/datasets/AAAAAAAA-YYYY-4cb8-898a-222261a5e0d0/"

$body = '{
	updateDetails: [
    {
      "name": "%Date",
      "newValue": "11111111"
    },
    {
      "name": "%Customer",
      "newValue": "Amazon"
    }
   ]
}'

#url and body for UpdateParameters in API call
$url = $urlbase + "UpdateParameters"

Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -ContentType application/json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;However I receive following error:&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&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:\Users\UserName\FolderPath\Publish one report.ps1:52 char:5
+     Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -Cont ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], Aggregat 
   eException
    + 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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone faced similar issues with this workflow?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;</description>
    <pubDate>Sun, 27 Nov 2022 13:14:39 GMT</pubDate>
    <dc:creator>Dom87326</dc:creator>
    <dc:date>2022-11-27T13:14:39Z</dc:date>
    <item>
      <title>Problems using Invoke-PowerBIRestMethod to update parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2931163#M39985</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello community,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’m working with multiple workspaces, reports and using powershell script that takes simple CSV file to determine what .pbix file goes into which workspace and what parameters to update (if any).&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The script is really simple. It verifies if report name (full path has been received as a command line parameter) exists in the publisher.csv file. If exists then extract all values from a corresponding row (workspace name, dataset refresh request, parameter1 and parameter2 name, parameter1 value and parameter2 value) from the publisher.csv file (based on this &lt;A href="https://powerofbi.org/2021/01/27/powershell-script-to-publish-power-bi-reports/" target="_self"&gt;blog&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test the script, I'm using hardcoded $body and $url variables with&lt;SPAN&gt;&amp;nbsp;Invoke-PowerBIRestMethod REST POST call:&lt;BR /&gt;&lt;/SPAN&gt;&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;#Group ID and Dataset ID 
$urlbase = "groups/4bc15b4f-5dc8-49e3-aaba-XXXXXXXXXXXX/datasets/AAAAAAAA-YYYY-4cb8-898a-222261a5e0d0/"

$body = '{
	updateDetails: [
    {
      "name": "%Date",
      "newValue": "11111111"
    },
    {
      "name": "%Customer",
      "newValue": "Amazon"
    }
   ]
}'

#url and body for UpdateParameters in API call
$url = $urlbase + "UpdateParameters"

Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -ContentType application/json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;However I receive following error:&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&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:\Users\UserName\FolderPath\Publish one report.ps1:52 char:5
+     Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -Cont ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], Aggregat 
   eException
    + 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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone faced similar issues with this workflow?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2022 13:14:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2931163#M39985</guid>
      <dc:creator>Dom87326</dc:creator>
      <dc:date>2022-11-27T13:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using Invoke-PowerBIRestMethod to update parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2932057#M39993</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308095"&gt;@Dom87326&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Are "&lt;STRONG&gt;%Date&lt;/STRONG&gt;" and "&lt;STRONG&gt;%Customer&lt;/STRONG&gt;" the actual paramater name? And&amp;nbsp;the names were originally preceded by a prefix "&lt;STRONG&gt;%&lt;/STRONG&gt;"? Is the date type of "%Date" &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt; &lt;/FONT&gt;type or &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/FONT&gt; type? Could you please refer the following thread to change the codes as below and check if it can work....&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/m-p/1167203" target="_self"&gt;&lt;SPAN&gt;Update parameters through Powershell&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#Group ID and Dataset ID 
$urlbase = "groups/4bc15b4f-5dc8-49e3-aaba-XXXXXXXXXXXX/datasets/AAAAAAAA-YYYY-4cb8-898a-222261a5e0d0/"

$body = '{
	updateDetails: [
    {
      "name": "%Date",
      "newValue": "11111111"
    },
    {
      "name": "%Customer",
      "newValue": "Amazon"
    }
   ]
}'

#url and body for UpdateParameters in API call
$url = $urlbase + "Default.UpdateParameters"

$content = 'application/json'

Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -ContentType $content&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 07:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2932057#M39993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-28T07:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using Invoke-PowerBIRestMethod to update parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2950337#M40142</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308095"&gt;@Dom87326&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Whether your problem has been resolved? If yes, could you please mark the helpful post as &lt;STRONG&gt;&lt;SPAN&gt;Answered&lt;/SPAN&gt;&lt;/STRONG&gt;? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 06:17:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problems-using-Invoke-PowerBIRestMethod-to-update-parameters/m-p/2950337#M40142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-06T06:17:21Z</dc:date>
    </item>
  </channel>
</rss>

