<?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 Power Shell script to push data to Power BI API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-Shell-script-to-push-data-to-Power-BI-API/m-p/787434#M20694</link>
    <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: I am not a developer, trying to do the below from an online example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following power shell script to push data to a power BI API and data set. It used to work fine, but then I started getting the following error&lt;/P&gt;&lt;P&gt;======================================&lt;/P&gt;&lt;P&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;BR /&gt;At line:28 char:5&lt;BR /&gt;+ Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo- ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestM&lt;BR /&gt;ethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMeth&lt;BR /&gt;odCommand&lt;/P&gt;&lt;P&gt;=================================&lt;/P&gt;&lt;P&gt;Script is pretty simple - just getting local machine stats and posting to power BI API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$endpoint = "&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;while($true)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;$ComputerCPU = (Get-WmiObject -Class win32_processor -ErrorAction Stop | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average&lt;/P&gt;&lt;P&gt;$ComputerMemory = Get-WmiObject -Class win32_operatingsystem -ErrorAction Stop&lt;BR /&gt;$UsedMemory = $ComputerMemory.TotalVisibleMemorySize - $ComputerMemory.FreePhysicalMemory&lt;BR /&gt;$Memory = (($UsedMemory/ $ComputerMemory.TotalVisibleMemorySize)*100)&lt;BR /&gt;$RoundMemory = [math]::Round($Memory, 2)&lt;/P&gt;&lt;P&gt;$Date = Get-Date -DisplayHint Date -Format MM/dd/yyyy&lt;/P&gt;&lt;P&gt;$Time = Get-Date -DisplayHint Time -Format HH:mm:ss&lt;/P&gt;&lt;P&gt;#$RoundMemory&lt;BR /&gt;#$ComputerCPU&lt;BR /&gt;#$Date&lt;BR /&gt;#$Time&lt;/P&gt;&lt;P&gt;$payload = @{&lt;BR /&gt;"Date" =$Date&lt;BR /&gt;"Time" =$Time&lt;BR /&gt;"CPU" = $ComputerCPU&lt;BR /&gt;"Memory" = $RoundMemory&lt;BR /&gt;}&lt;BR /&gt;Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))&lt;/P&gt;&lt;P&gt;Write-Host "Date: " $Date " Time: " $Time " CPU: " $ComputerCPU " Memory: " $RoundMemory&lt;BR /&gt;&lt;BR /&gt;sleep 2&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;============================&lt;/P&gt;&lt;P&gt;Why would this suddenly stop working?&lt;/P&gt;&lt;P&gt;If I hit the full url :&amp;nbsp;&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I get a 404&lt;/P&gt;&lt;P&gt;If I hit :&amp;nbsp;&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I get a 403&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone help me fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ravina&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2019 16:19:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-09T16:19:49Z</dc:date>
    <item>
      <title>Power Shell script to push data to Power BI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Shell-script-to-push-data-to-Power-BI-API/m-p/787434#M20694</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: I am not a developer, trying to do the below from an online example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following power shell script to push data to a power BI API and data set. It used to work fine, but then I started getting the following error&lt;/P&gt;&lt;P&gt;======================================&lt;/P&gt;&lt;P&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;BR /&gt;At line:28 char:5&lt;BR /&gt;+ Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo- ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestM&lt;BR /&gt;ethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMeth&lt;BR /&gt;odCommand&lt;/P&gt;&lt;P&gt;=================================&lt;/P&gt;&lt;P&gt;Script is pretty simple - just getting local machine stats and posting to power BI API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$endpoint = "&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;while($true)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;$ComputerCPU = (Get-WmiObject -Class win32_processor -ErrorAction Stop | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average&lt;/P&gt;&lt;P&gt;$ComputerMemory = Get-WmiObject -Class win32_operatingsystem -ErrorAction Stop&lt;BR /&gt;$UsedMemory = $ComputerMemory.TotalVisibleMemorySize - $ComputerMemory.FreePhysicalMemory&lt;BR /&gt;$Memory = (($UsedMemory/ $ComputerMemory.TotalVisibleMemorySize)*100)&lt;BR /&gt;$RoundMemory = [math]::Round($Memory, 2)&lt;/P&gt;&lt;P&gt;$Date = Get-Date -DisplayHint Date -Format MM/dd/yyyy&lt;/P&gt;&lt;P&gt;$Time = Get-Date -DisplayHint Time -Format HH:mm:ss&lt;/P&gt;&lt;P&gt;#$RoundMemory&lt;BR /&gt;#$ComputerCPU&lt;BR /&gt;#$Date&lt;BR /&gt;#$Time&lt;/P&gt;&lt;P&gt;$payload = @{&lt;BR /&gt;"Date" =$Date&lt;BR /&gt;"Time" =$Time&lt;BR /&gt;"CPU" = $ComputerCPU&lt;BR /&gt;"Memory" = $RoundMemory&lt;BR /&gt;}&lt;BR /&gt;Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))&lt;/P&gt;&lt;P&gt;Write-Host "Date: " $Date " Time: " $Time " CPU: " $ComputerCPU " Memory: " $RoundMemory&lt;BR /&gt;&lt;BR /&gt;sleep 2&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;============================&lt;/P&gt;&lt;P&gt;Why would this suddenly stop working?&lt;/P&gt;&lt;P&gt;If I hit the full url :&amp;nbsp;&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/rows?key=olVUwVXCfPo9etfcHofuq4cBU3mhTUoevK4JMxrGrnSGRTPECYb7tHCDOLrtRRZbZjQwtDOJORpiFHsYqe5wBg%3D%3D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I get a 404&lt;/P&gt;&lt;P&gt;If I hit :&amp;nbsp;&lt;A href="https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-09407c7fadff/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I get a 403&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone help me fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ravina&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 16:19:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Shell-script-to-push-data-to-Power-BI-API/m-p/787434#M20694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-09T16:19:49Z</dc:date>
    </item>
  </channel>
</rss>

