<?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: Update parameters through Powershell in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1176556#M24336</link>
    <description>&lt;P&gt;I found it out:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Update Parameters URL
$urlUpdateParams = '/datasets/{datasetId}/Default.UpdateParameters'


# Update Parameters Body
$body = '{
  "updateDetails": [
    {
      "name": "EndDate",
      "newValue": "2020-06-14"
    },
    {
      "name": "StartDate",
      "newValue": "2020-06-01"
    }
  ]
}'

$content = 'application/json'

Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content # Updates Dataset Parameters&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 23 Jun 2020 13:15:13 GMT</pubDate>
    <dc:creator>RogerSteinberg</dc:creator>
    <dc:date>2020-06-23T13:15:13Z</dc:date>
    <item>
      <title>Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1167203#M24233</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help in creating a simple PowerShell script that will update my PBI report parameter.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Body:
{
  "updateDetails": [
    {
      "name": "EndDate",
      "newValue": "2020-06-08"
    },
    {
      "name": "StartDate",
      "newValue": "2020-06-01"
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;I'm not sure how to followup this code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoke-PowerBIRestMethod -Url "/datasets/datasetID" -Method Post -Body .....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is provided by the Microsoft documentation but i'm having trouble putting it into practice&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoke-PowerBIRestMethod
      -Url &amp;lt;String&amp;gt;
      -Method &amp;lt;PowerBIWebRequestMethod&amp;gt;
      [-Body &amp;lt;String&amp;gt;]
      [-OutFile &amp;lt;String&amp;gt;]
      [-ContentType &amp;lt;String&amp;gt;]
      [-Headers &amp;lt;Hashtable&amp;gt;]
      [-Organization &amp;lt;String&amp;gt;]
      [-Version &amp;lt;String&amp;gt;]
      [&amp;lt;CommonParameters&amp;gt;]&lt;/LI-CODE&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 21:50:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1167203#M24233</guid>
      <dc:creator>RogerSteinberg</dc:creator>
      <dc:date>2020-06-17T21:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1167248#M24236</link>
      <description>&lt;P&gt;Your API call is incomplete.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters&lt;/A&gt;&amp;nbsp;(for regular workspaces)&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup&lt;/A&gt;&amp;nbsp;(for Premium)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you are not updating report parameters. You are updating dataset parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 22:27:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1167248#M24236</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-17T22:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1176556#M24336</link>
      <description>&lt;P&gt;I found it out:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Update Parameters URL
$urlUpdateParams = '/datasets/{datasetId}/Default.UpdateParameters'


# Update Parameters Body
$body = '{
  "updateDetails": [
    {
      "name": "EndDate",
      "newValue": "2020-06-14"
    },
    {
      "name": "StartDate",
      "newValue": "2020-06-01"
    }
  ]
}'

$content = 'application/json'

Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content # Updates Dataset Parameters&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Jun 2020 13:15:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/1176556#M24336</guid>
      <dc:creator>RogerSteinberg</dc:creator>
      <dc:date>2020-06-23T13:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610748#M59837</link>
      <description>&lt;P&gt;Did you run this through Powershell?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:36:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610748#M59837</guid>
      <dc:creator>roncruiser</dc:creator>
      <dc:date>2025-03-14T18:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610791#M59839</link>
      <description>&lt;P&gt;yes, after authenticating, for example with Login-PowerBI&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 19:18:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610791#M59839</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-14T19:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610796#M59840</link>
      <description>&lt;P&gt;I authenticated then attempted to run, but does not work for me.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 19:27:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610796#M59840</guid>
      <dc:creator>roncruiser</dc:creator>
      <dc:date>2025-03-14T19:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update parameters through Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610801#M59841</link>
      <description>&lt;P&gt;I grabbed this script from github.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/Update-Dataset-Parameters.ps1" target="_self"&gt;https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/Update-Dataset-Parameters.ps1&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;I modify the script using my entries.&lt;BR /&gt;I run it using Powershell.&lt;BR /&gt;No errors are thrown up but the parameters are not changing in the dataset.&lt;BR /&gt;Can you please inspect this script please.&lt;BR /&gt;I left comments after some of the lines below.&lt;BR /&gt;I'm totally new to running commands using Powershell.&amp;nbsp; I'm trying to learn.&lt;BR /&gt;My goal is update the Parameters for a particular dataset.&lt;BR /&gt;&lt;BR /&gt;Write-Host&lt;/P&gt;&lt;P&gt;Connect-PowerBIServiceAccount | Out-Null&lt;/P&gt;&lt;P&gt;$workspaceName = "me"&amp;nbsp; //for myworkspace, do I use "me", or "My Workpace"?&lt;BR /&gt;$datasetName = "dataset123"&lt;BR /&gt;$workspaceId = $workspace.Id&lt;BR /&gt;$datasetId = $dataset.Id&amp;nbsp; // is dataset.ID grabbed automatically?&lt;/P&gt;&lt;P&gt;$workspace = Get-PowerBIWorkspace -Name $workspaceName&lt;/P&gt;&lt;P&gt;$dataset = Get-PowerBIDataset | Where-Object Name -eq $datasetName&lt;/P&gt;&lt;P&gt;$workspaceId = $workspace.Id&lt;BR /&gt;$datasetId = $dataset.Id&lt;/P&gt;&lt;P&gt;$datasetParametersUrl = "groups/$workspaceId/datasets/$datasetId/Default.UpdateParameters"&lt;/P&gt;&lt;P&gt;$parameterName = "DirectPath_NonOneDrive_JSON"&lt;BR /&gt;$newParameterValue = "NewPath"&lt;BR /&gt;$postBody = "{updateDetails:[{name:'$parameterName', newValue:'$newParameterValue'}]}"&lt;/P&gt;&lt;P&gt;Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 19:35:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-parameters-through-Powershell/m-p/4610801#M59841</guid>
      <dc:creator>roncruiser</dc:creator>
      <dc:date>2025-03-14T19:35:59Z</dc:date>
    </item>
  </channel>
</rss>

