|
| 1 | +## Usage |
| 2 | + |
| 3 | + pbi-tools.core <action> -options |
| 4 | + |
| 5 | +_pbi-tools (Core), 1.1.0 - https://pbi.tools/_ |
| 6 | + |
| 7 | +### Actions |
| 8 | + |
| 9 | +#### compile |
| 10 | + |
| 11 | + compile <folder> [<outPath>] [<format>] [<overwrite>] |
| 12 | + |
| 13 | +Generates a PBIX/PBIT file from sources in the specified PbixProj folder. Currently, the PBIX output is supported only for report-only projects ("thin" reports), and PBIT for projects containing a data model. |
| 14 | + |
| 15 | +| Option | Default Value | Is Switch | Description | |
| 16 | +| --- | --- | --- | --- | |
| 17 | +| folder* | | | The PbixProj folder to generate the PBIX from. | |
| 18 | +| outPath | | | The path for the output file. If not provided, creates the file in the current working directory, using the foldername. A directory or file name can be provided. The full output path is created if it does not exist. | |
| 19 | +| format | `PBIX` | | The target file format. <br> `PBIX` - Creates a file using the PBIX format. Only supported for "thin" reports - use the PBIT format if the project contains a data model. This is the default format. <br> `PBIT` - Creates a file using the PBIT format. Use for data models. When opened in Power BI Desktop, parameters and/or credentials need to be provided and a refresh is triggered. | |
| 20 | +| overwrite | `False` | X | Overwrite the destination file if it already exists, fail otherwise. | |
| 21 | + |
| 22 | +#### convert |
| 23 | + |
| 24 | + convert <source> [<outPath>] [<modelSerialization>] [<mashupSerialization>] [<settingsFile>] [<updateSettings>] [<modelOnly>] [<overwrite>] |
| 25 | + |
| 26 | +Performs an offline conversion of PbixProj or Tabular model sources into another format, either in-place or into another destination. |
| 27 | + |
| 28 | +| Option | Default Value | Is Switch | Description | |
| 29 | +| --- | --- | --- | --- | |
| 30 | +| source* | | | The source(s) to convert. Can be a PbixProj folder, a Model/TE folder, or a TMSL json file. | |
| 31 | +| outPath | | | The (optional) destination. Can be a folder or a file, depending on the conversion mode. Must be a folder if the source is a TMSL json file. | |
| 32 | +| modelSerialization | | | The model serialization mode. <br> `Default` - The default serialization format, effective if no option is specified. The default is TMDL. <br> `Raw` - Serializes the tabular model into a single JSON file containing the full TMSL payload from the PBIX model. No transformations are applied. <br> `Legacy` - Serializes the tabular model into the default PbixProj folder structure and performs various transformations to optimize file contents for source control. <br> `Tmdl` - Serializes the tabular model into TMDL format. Annotation settings are applied. | |
| 33 | +| mashupSerialization | | | The mashup serialization mode. <br> `Default` - Similar to 'Raw' mode, with the exception that QueryGroups are extracted into a separate file for readability. <br> `Raw` - Serializes all Mashup parts with no transformations applied. <br> `Expanded` - Serializes the Mashup metadata part into a Json document, and embedded M queries into separate files. This mode is not supported for compilation. | |
| 34 | +| settingsFile | | | An external .pbixproj.json file containing serialization settings. Serialization modes specified as command-line arguments take precedence. | |
| 35 | +| updateSettings | `False` | X | If set, updates the effective PbixProj settings file used for this conversion. | |
| 36 | +| modelOnly | `False` | X | If set, converts the model only and leaves other artifacts untouched. Only effective in combination with a PbixProj source folder. | |
| 37 | +| overwrite | `False` | X | Allows overwriting of existing files in the destination. The conversion fails if the destination is not empty and this flag is not set. | |
| 38 | + |
| 39 | +#### deploy |
| 40 | + |
| 41 | + deploy <folder> <label> [<environment>] [<basePath>] [<whatIf>] |
| 42 | + |
| 43 | +Deploys artifacts (reports, datasets) to Power BI Service using a deployment manifest. |
| 44 | + |
| 45 | +| Option | Default Value | Is Switch | Description | |
| 46 | +| --- | --- | --- | --- | |
| 47 | +| folder* | | | The PbixProj folder containing the deployment manifest. | |
| 48 | +| label* | | | Name of a profile in the deployment manifest. | |
| 49 | +| environment | `Development` | | The target deployment environment. | |
| 50 | +| basePath | | | When specified, resolves all deployment source paths relative to this path (and basePath relative to the current working directory), instead of the location of the PbixProj manifest. | |
| 51 | +| whatIf | `False` | X | When enabled, simulates the deployment actions and provides diagnostic output. Useful to test source path expressions and parameters. Authentication credentials are validated. | |
| 52 | + |
| 53 | +#### export-data |
| 54 | + |
| 55 | + export-data [<port>] [<outPath>] [<dateTimeFormat>] |
| 56 | + |
| 57 | +Exports data from all tables in a live Power BI Desktop session. |
| 58 | + |
| 59 | +| Option | Default Value | Is Switch | Description | |
| 60 | +| --- | --- | --- | --- | |
| 61 | +| port | | | The port number of a local Tabular Server instance. | |
| 62 | +| outPath | | | The output directory. Uses PBIX file directory if not provided, or the current working directory when connecting to Tabular Server instance. | |
| 63 | +| dateTimeFormat | `s` | | The format to use for DateTime values. Must be a valid .Net format string, see: https://docs.microsoft.com/dotnet/standard/base-types/standard-date-and-time-format-strings. | |
| 64 | + |
| 65 | +**Export data from local workspace instance** |
| 66 | + |
| 67 | + pbi-tools.core export-data -port 12345 |
| 68 | + |
| 69 | +_Extracts all records from each table from a local Power BI Desktop or SSAS Tabular instance running on port 12345 (get actual port via 'info' command). Each table is extracted into a UTF-8 CSV file with the same name into the current working directory._ |
| 70 | + |
| 71 | +#### generate-bim |
| 72 | + |
| 73 | + generate-bim <folder> [<transforms>] |
| 74 | + |
| 75 | +Generates a TMSL/BIM file from Model sources in a folder. The output path is derived from the source folder. |
| 76 | + |
| 77 | +| Option | Default Value | Is Switch | Description | |
| 78 | +| --- | --- | --- | --- | |
| 79 | +| folder* | | | The PbixProj folder to export the BIM file from. | |
| 80 | +| transforms | | | List transformations to be applied to TMSL document. <br> `RemovePBIDataSourceVersion` - Removes the 'defaultPowerBIDataSourceVersion' model property, making the exported BIM file compatible with Azure Analysis Services. | |
| 81 | + |
| 82 | +#### git |
| 83 | + |
| 84 | + git <action> |
| 85 | + |
| 86 | +Integrates with git and exposes certain actions to perform in the current working directory. |
| 87 | + |
| 88 | +| Option | Default Value | Is Switch | Description | |
| 89 | +| --- | --- | --- | --- | |
| 90 | +| action* | | | The git action to perform. <br> `Branch` - Displays the active git branch in the current working directory. | |
| 91 | + |
| 92 | + pbi-tools git branch |
| 93 | + |
| 94 | +_Displays the active git branch in the current working directory. Automatically detects the root of the current git repository._ |
| 95 | + |
| 96 | +#### info |
| 97 | + |
| 98 | + info [<checkDownloadVersion>] |
| 99 | + |
| 100 | +Collects diagnostic information about the local system and writes a JSON object to StdOut. |
| 101 | + |
| 102 | +| Option | Default Value | Is Switch | Description | |
| 103 | +| --- | --- | --- | --- | |
| 104 | +| checkDownloadVersion | | X | When specified, checks the latest Power BI Desktop version available from download.microsoft.com. | |
| 105 | + |
| 106 | + pbi-tools info check |
| 107 | + |
| 108 | +_Prints information about the active version of pbi-tools, all Power BI Desktop versions on the local system, any running Power BI Desktop instances, and checks the latest version of Power BI Desktop available from Microsoft Downloads._ |
| 109 | + |
| 110 | +#### init |
| 111 | + |
| 112 | + init <action> [<folder>] |
| 113 | + |
| 114 | +Initializes a PbixProj workpace. |
| 115 | + |
| 116 | +| Option | Default Value | Is Switch | Description | |
| 117 | +| --- | --- | --- | --- | |
| 118 | +| action* | | | The initialize action to perform. <br> `Deployments` - Generates a sample deployment manifest in the specified location if none exists. | |
| 119 | +| folder | | | The PbixProj folder to operation in. Uses current working directory if not specified. | |
| 120 | + |
0 commit comments