<?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 How to extract the M Query meta data from Datamashup file via Powershell in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2437704#M35348</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;We are able to manually extract the Power query data from the Datamashup file through 7-zip tool.&lt;/P&gt;&lt;P&gt;Is there any way we can automate the extraction from Powershell?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 09:15:58 GMT</pubDate>
    <dc:creator>NandanHegde</dc:creator>
    <dc:date>2022-04-05T09:15:58Z</dc:date>
    <item>
      <title>How to extract the M Query meta data from Datamashup file via Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2437704#M35348</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;We are able to manually extract the Power query data from the Datamashup file through 7-zip tool.&lt;/P&gt;&lt;P&gt;Is there any way we can automate the extraction from Powershell?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 09:15:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2437704#M35348</guid>
      <dc:creator>NandanHegde</dc:creator>
      <dc:date>2022-04-05T09:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the M Query meta data from Datamashup file via Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2444722#M35408</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226550" data-lia-user-login="NandanHegde" class="lia-mention lia-mention-user"&gt;NandanHegde&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if this will help:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/cporteou/PowerBI-Metadata" target="_self"&gt;https://github.com/cporteou/PowerBI-Metadata&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Liang&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 02:41:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2444722#M35408</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2022-04-08T02:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the M Query meta data from Datamashup file via Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2444883#M35411</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Unfortunately the above Github code is for other PowerBI detals.&lt;/P&gt;&lt;P&gt;My requirement is to extract the source queries like say Select * from table in case if SQL is the source.&lt;/P&gt;&lt;P&gt;And it seems MSFT has removed the datamashup file from PBIX.&lt;/P&gt;&lt;P&gt;So is there any other way to get the source quuery details&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 04:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2444883#M35411</guid>
      <dc:creator>NandanHegde</dc:creator>
      <dc:date>2022-04-08T04:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the M Query meta data from Datamashup file via Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2483383#M35767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226550" data-lia-user-login="NandanHegde" class="lia-mention lia-mention-user"&gt;NandanHegde&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You have a couple of options:&lt;BR /&gt;1. PBIX files&amp;nbsp;include a backup of the AS database.&amp;nbsp;In order to read the M queries you can restore the AS database either to a local AS server instance (by programmatically opening the PBIX file using Power BI Desktop then finding the localhost AS server port number) or to the Power BI Service (which can be done using &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group" target="_blank" rel="noopener"&gt;APIs&lt;/A&gt;, or it may already be published...).&lt;BR /&gt;&lt;BR /&gt;You can access an AS database using the &lt;A href="https://docs.microsoft.com/en-us/analysis-services/tom/install-distribute-and-reference-the-tabular-object-model?view=asallproducts-allversions" target="_blank" rel="noopener"&gt;AMO-TOM assemblies&lt;/A&gt;, which are built on .Net.&lt;BR /&gt;In order to connect to an AS database, you will use the XMLA endpoint. So for the Power BI service option, you will need to use &lt;SPAN&gt;premium (not needed for the local AS server instance option).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;2. If the AS database is deployed to the Power BI Service, you can also get the M queries by using the &lt;A href="https://docs.microsoft.com/en-us/power-bi/enterprise/service-admin-metadata-scanning" target="_blank" rel="noopener"&gt;Scanner APIs.&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;This option is not limited to&amp;nbsp;premium and does not require the&amp;nbsp;AMO-TOM assemblies.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;3. Another option is to convert a PBIX file to a PBIT file using Power BI Desktop. The latter contains the tabular model json representation.&amp;nbsp;You can parse it to an object using ConvertFrom-Json (or using the AMO-TOM assemblies) and extract the M queries.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-extract-the-M-Query-meta-data-from-Datamashup-file-via/m-p/2483383#M35767</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-04-28T13:16:33Z</dc:date>
    </item>
  </channel>
</rss>

