<?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 Deleted reports showing up in workspace  inventory powershell in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Deleted-reports-showing-up-in-workspace-inventory-powershell/m-p/1182472#M24376</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have some powershell which gets a list of reports in their workspaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if have a report and delete it and the replace it with another report in same workspace shows the 2 entries the live one and the deleted one when shoudl onky show one - the live active one.&lt;/P&gt;&lt;P&gt;When check workspace only one report of that name is in that workspace but shows 2 entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we only show the live reports in that workspace.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Login-PowerBI&lt;/P&gt;&lt;P&gt;$Workspaces = Get-PowerBIWorkspace -Scope Organization -Include Reports | Where {($_.Name -NotLike "Personal*")}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$Reports =&lt;/P&gt;&lt;P&gt;ForEach ($workspace in $Workspaces)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;# exclude personal workspaces&lt;BR /&gt;#$SearchTerm = '*Personal*'&lt;/P&gt;&lt;P&gt;#If ($workspace -NotLike $SearchTerm)&lt;BR /&gt;#{&lt;BR /&gt;Write-Host $workspace.Name&lt;/P&gt;&lt;P&gt;ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;[pscustomobject]@{&lt;/P&gt;&lt;P&gt;#WorkspaceID = $workspace.Id&lt;/P&gt;&lt;P&gt;WorkspaceName = $workspace.Name&lt;/P&gt;&lt;P&gt;#ReportID = $report.Id&lt;/P&gt;&lt;P&gt;ReportName = $report.Name&lt;/P&gt;&lt;P&gt;ReportURL = $report.WebUrl&lt;/P&gt;&lt;P&gt;#ReportDatasetID = $report.DatasetId&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#}&lt;/P&gt;&lt;P&gt;$Reports | Export-Csv "C:\pbi_pshell\workspace_inventory.csv" -NoTypeInformation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for deleted ones when click the url&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/299856i6C0B6EA75747EC9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jun 2020 13:13:23 GMT</pubDate>
    <dc:creator>po</dc:creator>
    <dc:date>2020-06-25T13:13:23Z</dc:date>
    <item>
      <title>Deleted reports showing up in workspace  inventory powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Deleted-reports-showing-up-in-workspace-inventory-powershell/m-p/1182472#M24376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have some powershell which gets a list of reports in their workspaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if have a report and delete it and the replace it with another report in same workspace shows the 2 entries the live one and the deleted one when shoudl onky show one - the live active one.&lt;/P&gt;&lt;P&gt;When check workspace only one report of that name is in that workspace but shows 2 entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we only show the live reports in that workspace.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Login-PowerBI&lt;/P&gt;&lt;P&gt;$Workspaces = Get-PowerBIWorkspace -Scope Organization -Include Reports | Where {($_.Name -NotLike "Personal*")}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$Reports =&lt;/P&gt;&lt;P&gt;ForEach ($workspace in $Workspaces)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;# exclude personal workspaces&lt;BR /&gt;#$SearchTerm = '*Personal*'&lt;/P&gt;&lt;P&gt;#If ($workspace -NotLike $SearchTerm)&lt;BR /&gt;#{&lt;BR /&gt;Write-Host $workspace.Name&lt;/P&gt;&lt;P&gt;ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;[pscustomobject]@{&lt;/P&gt;&lt;P&gt;#WorkspaceID = $workspace.Id&lt;/P&gt;&lt;P&gt;WorkspaceName = $workspace.Name&lt;/P&gt;&lt;P&gt;#ReportID = $report.Id&lt;/P&gt;&lt;P&gt;ReportName = $report.Name&lt;/P&gt;&lt;P&gt;ReportURL = $report.WebUrl&lt;/P&gt;&lt;P&gt;#ReportDatasetID = $report.DatasetId&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#}&lt;/P&gt;&lt;P&gt;$Reports | Export-Csv "C:\pbi_pshell\workspace_inventory.csv" -NoTypeInformation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for deleted ones when click the url&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/299856i6C0B6EA75747EC9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 13:13:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Deleted-reports-showing-up-in-workspace-inventory-powershell/m-p/1182472#M24376</guid>
      <dc:creator>po</dc:creator>
      <dc:date>2020-06-25T13:13:23Z</dc:date>
    </item>
  </channel>
</rss>

