Creating XMLA file from tabular editor 2 with Powershell not working

330 Views Asked by At

According to the documentation of tabular editor 2, it should be possible to create an xmla file which you can use for later deployments.

But the -X argument never give any results.

Using the -X argument does not give any results. I have tried the next Powershell commands:

There is no XMLA file in target folder created and no error message of using wrong syntax in Powershell is shown. Somebody any ideas?

Without Start-Process it won't work either:

1

There are 1 best solutions below

0
On

I'm seeing a bunch of issues in your screen print.

First, I would use a CMD command prompt over a PowerShell prompt. You won't have to fight any PowerShell specific issues. The command line options are tied to TabularEditor.exe as an executable program.

Second, looking at the switches available via "TabularEditor.exe /?", they are a little complex and not very intuitive. The switches are indented to show that you have to use some only after using others. So in order to use -X xmla_script, you have to use -D server database first.

If you have more errors after adding that, please update your question with the whole command you are using and a screen shot of the result.

Tabular Editor 2.16.4 (build 2.16.7940.23396)
--------------------------------
Loading custom actions from: C:\Users\rudzimj\AppData\Local\TabularEditor\CustomActions.json
Usage:

TABULAREDITOR ( file | server database | -L [name] ) [-S script1 [script2] [...]]
    [-SC] [-A [rules] | -AX rules] [(-B | -F) output [id]] [-V] [-T resultsfile]
    [-D [server database [-L user pass] [-O [-C [plch1 value1 [plch2 value2 [...]]]]
        [-P [-Y]] [-R [-M]]]
        [-X xmla_script]] [-W] [-E]]

file                Full path of the Model.bim file or database.json model folder to load.
server              Server\instance name or connection string from which to load the model
database            Database ID of the model to load. If blank (") picks the first available database on the server.
-L / -LOCAL         Connects to a Power BI Desktop (local) instance of Analysis Services. If no
                      name is specified, this assumes that exactly 1 instance is running. Otherwise,
                      name should match the name of the .pbix file loaded in Power BI Desktop.
-S / -SCRIPT        Execute the specified script on the model after loading.
  scriptN             Full path of one or more files containing a C# script to execute or an inline
                      script.
-SC / -SCHEMACHECK  Attempts to connect to all Provider Data Sources in order to detect table schema
                    changes. Outputs...
                      ...warnings for mismatched data types and unmapped source columns
                      ...errors for unmapped model columns.
-A / -ANALYZE       Runs Best Practice Analyzer and outputs the result to the console.
  rules               Optional path of file or URL of additional BPA rules to be analyzed. If
                      specified, model is not analyzed against local user/local machine rules,
                      but rules defined within the model are still applied.
-AX / -ANALYZEX     Same as -A / -ANALYZE but excludes rules specified in the model annotations.
-B / -BIM / -BUILD  Saves the model (after optional script execution) as a Model.bim file.
  output              Full path of the Model.bim file to save to.
  id                  Optional id/name to assign to the Database object when saving.
-F / -FOLDER        Saves the model (after optional script execution) as a Folder structure.
  output              Full path of the folder to save to. Folder is created if it does not exist.
  id                  Optional id/name to assign to the Database object when saving.
-V / -VSTS          Output Visual Studio Team Services logging commands.
-T / -TRX         Produces a VSTEST (trx) file with details on the execution.
  resultsfile       File name of the VSTEST XML file.
-D / -DEPLOY        Command-line deployment
                      If no additional parameters are specified, this switch will save model metadata
                      back to the source (file or database).
  server              Name of server to deploy to or connection string to Analysis Services.
  database            ID of the database to deploy (create/overwrite).
  -L / -LOGIN         Disables integrated security when connecting to the server. Specify:
    user                Username (must be a user with admin rights on the server)
    pass                Password
  -O / -OVERWRITE     Allow deploy (overwrite) of an existing database.
    -C / -CONNECTIONS   Deploy (overwrite) existing data sources in the model. After the -C switch, you
                        can (optionally) specify any number of placeholder-value pairs. Doing so, will
                        replace any occurrence of the specified placeholders (plch1, plch2, ...) in the
                        connection strings of every data source in the model, with the specified values
                        (value1, value2, ...).
    -P / -PARTITIONS    Deploy (overwrite) existing table partitions in the model.
      -Y / -SKIPPOLICY    Do not overwrite partitions that have Incremental Refresh Policies defined.
    -R / -ROLES         Deploy roles.
      -M / -MEMBERS       Deploy role members.
  -X / -XMLA        No deployment. Generate XMLA/TMSL script for later deployment instead.
    xmla_script       File name of the new XMLA/TMSL script output.
  -W / -WARN        Outputs information about unprocessed objects as warnings.
  -E / -ERR         Returns a non-zero exit code if Analysis Services returns any error messages after
                      the metadata was deployed / updated.