├── .gitattributes ├── .gitignore ├── .vs └── VSWorkspaceState.json ├── .vscode └── launch.json ├── Images └── PowerBIPS.PNG ├── LICENSE ├── Modules ├── PowerBIPS.Tools │ ├── CsvHelper.dll │ ├── GenerateDocs.ps1 │ ├── Microsoft.AnalysisServices.Core.dll │ ├── Microsoft.AnalysisServices.SPClient.Interfaces.dll │ ├── Microsoft.AnalysisServices.Tabular.Json.dll │ ├── Microsoft.AnalysisServices.Tabular.dll │ ├── Microsoft.AnalysisServices.dll │ ├── PowerBIPS.Tools.md │ ├── PowerBIPS.Tools.psd1 │ ├── PowerBIPS.Tools.psm1 │ ├── SQLHelper.psm1 │ ├── _ExportODCConnection.ContextMenu.Demo.gif │ ├── _ExportODCConnection.ContextMenu.reg │ └── doc │ │ ├── Convert-PowerBIDesktopToASTabular.md │ │ ├── Export-PBIDesktopODCConnection.md │ │ ├── Export-PBIDesktopToCSV.md │ │ ├── Export-PBIDesktopToSQL.md │ │ ├── Get-PBIDataSetFromPBIDesktop.md │ │ ├── Get-PBIDesktopTCPPort.md │ │ └── PowerBIPS.Tools.md └── PowerBIPS │ ├── .vscode │ └── launch.json │ ├── GenerateDocs.ps1 │ ├── Microsoft.IdentityModel.Clients.ActiveDirectory.dll │ ├── Microsoft.IdentityModel.Clients.ActiveDirectory.xml │ ├── PowerBIPS-Automation.json │ ├── PowerBIPS.md │ ├── PowerBIPS.psd1 │ ├── PowerBIPS.psm1 │ ├── Samples │ ├── CSVData │ │ ├── Sales.201501.csv │ │ ├── Sales.201502.csv │ │ ├── Sales.201503.csv │ │ ├── Sales.201504.csv │ │ ├── Sales.201505.csv │ │ ├── Sales.201506.csv │ │ └── _Aux │ │ │ └── CSVGenerator.ps1 │ ├── Modules │ │ └── InvokeTwitterAPIs.psm1 │ ├── PBIX │ │ └── MyMovies.pbix │ ├── PowerBIPS.OutPowerBI.ps1 │ ├── PowerBIPS.Sample.CSVUpload.ps1 │ ├── PowerBIPS.Sample.CopyReport.ps1 │ ├── PowerBIPS.Sample.DeleteDatasets.ps1 │ ├── PowerBIPS.Sample.DeleteReports.ps1 │ ├── PowerBIPS.Sample.DownloadReport.ps1 │ ├── PowerBIPS.Sample.Get.ps1 │ ├── PowerBIPS.Sample.GetRefreshHistory.ps1 │ ├── PowerBIPS.Sample.GetReportAndDashboard.ps1 │ ├── PowerBIPS.Sample.Groups.ps1 │ ├── PowerBIPS.Sample.ITRealTimeMonitor.ps1 │ ├── PowerBIPS.Sample.ImportPBIX.ps1 │ ├── PowerBIPS.Sample.RebindReportDataset.ps1 │ ├── PowerBIPS.Sample.RefreshDataset.1.ps1 │ ├── PowerBIPS.Sample.SetParameters.ps1 │ ├── PowerBIPS.Sample.Simple.ps1 │ ├── PowerBIPS.Sample.UpdateReportContent.ps1 │ ├── PowerBIPS.ServicePrincipal.ps1 │ ├── PowerBIPS.TestAuth.ps1 │ ├── PowerBIPS.Tests.ps1 │ └── PowerBIPS.TwitterRealTime.ps1 │ └── doc │ ├── Add-PBITableRows.md │ ├── Clear-PBITableRows.md │ ├── Copy-PBIReports.md │ ├── Export-PBIReport.md │ ├── Get-PBIAuthToken.md │ ├── Get-PBIAuthTokenHttp.md │ ├── Get-PBIDashboard.md │ ├── Get-PBIDashboardTile.md │ ├── Get-PBIDataSet.md │ ├── Get-PBIDataSetTables.md │ ├── Get-PBIDatasetParameters.md │ ├── Get-PBIDatasetRefreshHistory.md │ ├── Get-PBIDatasources.md │ ├── Get-PBIGroup.md │ ├── Get-PBIGroupUsers.md │ ├── Get-PBIImports.md │ ├── Get-PBIModuleConfig.md │ ├── Get-PBIReport.md │ ├── Import-PBIFile.md │ ├── Invoke-PBIRequest.md │ ├── New-PBIDashboard.md │ ├── New-PBIDataSet.md │ ├── New-PBIGroup.md │ ├── New-PBIGroupUser.md │ ├── Out-PowerBI.md │ ├── PowerBIPS.md │ ├── Remove-PBIDataSet.md │ ├── Remove-PBIReport.md │ ├── Request-PBIDatasetRefresh.md │ ├── Set-PBIDatasetParameters.md │ ├── Set-PBIGroup.md │ ├── Set-PBIModuleConfig.md │ ├── Set-PBIReportContent.md │ ├── Set-PBIReportsDataset.md │ ├── Test-PBIDataSet.md │ ├── Update-PBIDatasetDatasources.md │ └── Update-PBITableSchema.md └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto 3 | *.ps1 text diff eol=crlf 4 | *.psm1 text diff eol=crlf 5 | *.psd1 text diff eol=crlf 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Images/Thumbs.db 2 | *.user 3 | UpgradeLog.htm 4 | *.suo 5 | Modules/.vs/config/applicationhost.config 6 | Modules/PowerBIPS/PublishToGallery.ps1 7 | Modules/PowerBIPS/Publish/* 8 | Modules/PowerBIPS/Samples/*test*.ps1 9 | Modules/PowerBIPS/Samples/PowerBIPS.TestChangeConnection.ps1 10 | #Modules/PowerBIPS/GenerateDocs.ps1 11 | 12 | Modules/PowerBIPS.Tools/Samples/* 13 | Modules/PowerBIPS.Tools/Publish/* 14 | Modules/PowerBIPS.Tools/PublishToGallery.ps1 15 | #Modules/PowerBIPS.Tools/GenerateDocs.ps1 16 | 17 | Modules/PowerBIETL/Publish/* 18 | Modules/PowerBIETL/PublishToGallery.ps1 19 | /Modules/PowerBIETL/Samples/Output 20 | 21 | /.vs/slnx.sqlite 22 | /.vs 23 | ImportPBIStuff.ps1 24 | -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "PreviewInSolutionExplorer": false 6 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "PowerShell", 6 | "type": "PowerShell", 7 | "request": "launch", 8 | "program": "${file}", 9 | "args": [], 10 | "cwd": "${file}" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /Images/PowerBIPS.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Images/PowerBIPS.PNG -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 DevScope SA 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/CsvHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/CsvHelper.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/GenerateDocs.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | 4 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 5 | 6 | Import-Module platyPS 7 | 8 | Import-Module "$currentPath\PowerBIPS.Tools.psd1" -Force 9 | 10 | $outputPath = "$currentPath\doc" 11 | 12 | Remove-Item $outputPath -Force -Recurse 13 | 14 | if (!(Test-Path $outputPath)) 15 | { 16 | New-MarkdownHelp -Module PowerBIPS.Tools -OutputFolder $outputPath -WithModulePage 17 | } 18 | else 19 | { 20 | Update-MarkdownHelpModule -Path $outputPath -RefreshModulePage 21 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Core.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.SPClient.Interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.SPClient.Interfaces.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Tabular.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Tabular.Json.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Tabular.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.Tabular.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/Microsoft.AnalysisServices.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/PowerBIPS.Tools.md: -------------------------------------------------------------------------------- 1 | --- 2 | Module Name: PowerBIPS.Tools 3 | Module Guid: 4380560b-ec14-4627-af81-635405ceb29f 4 | Version: 1.0.0.1 5 | --- 6 | 7 | # PowerBIPS.Tools Module 8 | ## Description 9 | This module is a collection of very useful tools for Power BI. 10 | For example: 11 | - Export PBI Desktop into CSV/SQL 12 | - Convert from PBI Desktop into AS Tabular 13 | - Get a dataset schema from a Power BI Desktop file (to create a REST DataSet) 14 | 15 | ## Available on PowerShell Gallery: 16 | 17 | https://www.powershellgallery.com/packages/PowerBIPS.Tools 18 | 19 | 20 | ### Install from PowerShell Gallery 21 | 22 | ```powershell 23 | Install-Module -Name PowerBIPS.Tools 24 | # Or without admin priviledge: 25 | Install-Module -Name PowerBIPS.Tools -Scope CurrentUser 26 | ``` 27 | 28 | ## Sample Script - Convert PBIX to AS Tabular 29 | 30 | ```powershell 31 | 32 | Convert-PowerBIDesktopToASTabular -pbiDesktopWindowName "*VanArsdel - Sales*" -outputPath "$currentPath\SSAS" 33 | 34 | ``` 35 | 36 | ## Sample Script - Export PBI Desktop to SQL Server or CSV 37 | 38 | ```powershell 39 | 40 | # Export to SQL Server 41 | Export-PBIDesktopToSQL -pbiDesktopWindowName "*PowerBIETLSample*" -sqlConnStr "Data Source=.\sql2017; Initial Catalog=Dummy; Integrated Security=true" -sqlSchema "stg" 42 | 43 | # Export to CSV Files 44 | Export-PBIDesktopToCSV -pbiDesktopWindowName "*PowerBIETLSample*" -outputPath ".\outputFolder" 45 | 46 | ``` 47 | 48 | ## Sample Script - Create a REST API DataSet using Power BI Desktop 49 | 50 | ```powershell 51 | 52 | $dataSetSchema = Get-PBIDataSetFromPBIDesktop -datasetName $datasetName -pbiDesktopWindowName "*RealTime*" 53 | 54 | $dataSetSchema = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -ignoreIfDataSetExists 55 | 56 | ``` 57 | 58 | ## Sample Script - Create a PushDataset from Power BI Desktop 59 | 60 | ```powershell 61 | 62 | # Get a PBIDataSet schema from PBIDesktop 63 | $dataSet = Get-PBIDataSetFromPBIDesktop -pbiDesktopWindowName "*PBI Window*" -datasetName "PushDataSet" 64 | 65 | # Create the REST API dataset on powerbi.com 66 | $dataSet = New-PBIDataSet -dataSet $dataSet -groupId "workspace Id" 67 | 68 | ``` 69 | 70 | ## PowerBIPS.Tools Cmdlets 71 | ### [Convert-PowerBIDesktopToASTabular](doc/Convert-PowerBIDesktopToASTabular.md) 72 | Convert from a Power BI Desktop into AS Tabular Project 73 | 74 | ### [Get-PBIDataSetFromPBIDesktop](doc/Get-PBIDataSetFromPBIDesktop.md) 75 | Get's a PowerBI Dataset Schema from Power BI Desktop to create a Push DataSet 76 | 77 | ### [Export-PBIDesktopToCSV](doc/Export-PBIDesktopToCSV.md) 78 | Exports the tables from a Power BI Desktop model into CSV files 79 | 80 | ### [Export-PBIDesktopToSQL](doc/Export-PBIDesktopToSQL.md) 81 | Exports the tables from a Power BI Desktop model into a SQL Server Database (automatically creates the tables) 82 | 83 | ### [Get-PBIDesktopTCPPort](doc/Get-PBIDesktopTCPPort.md) 84 | Discover the TCP Port of the Analysis Services instance on Power BI Desktop 85 | 86 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/PowerBIPS.Tools.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | 3 | # Script module or binary module file associated with this manifest. 4 | RootModule = 'PowerBIPS.Tools.psm1' 5 | 6 | # Version number of this module. 7 | ModuleVersion = '1.0.2.2' 8 | 9 | # ID used to uniquely identify this module 10 | GUID = '4380560b-ec14-4627-af81-635405ceb29f' 11 | 12 | # Author of this module 13 | Author = 'DevScope' 14 | 15 | # Company or vendor of this module 16 | CompanyName = 'DevScope' 17 | 18 | # Copyright statement for this module 19 | Copyright = '(c) 2017 DevScope. All rights reserved.' 20 | 21 | # Description of the functionality provided by this module 22 | Description = 'This module is a collection of very useful tools for Power BI. 23 | For example: 24 | - Export PBI Desktop into CSV/SQL 25 | - Convert from PBI Desktop into AS Tabular 26 | - Get a dataset schema from a Power BI Desktop file (to create a REST DataSet)' 27 | 28 | # Minimum version of the Windows PowerShell engine required by this module 29 | # PowerShellVersion = '' 30 | 31 | # Name of the Windows PowerShell host required by this module 32 | # PowerShellHostName = '' 33 | 34 | # Minimum version of the Windows PowerShell host required by this module 35 | # PowerShellHostVersion = '' 36 | 37 | # Minimum version of Microsoft .NET Framework required by this module 38 | DotNetFrameworkVersion = '4.5' 39 | 40 | # Minimum version of the common language runtime (CLR) required by this module 41 | # CLRVersion = '' 42 | 43 | # Processor architecture (None, X86, Amd64) required by this module 44 | # ProcessorArchitecture = '' 45 | 46 | # Modules that must be imported into the global environment prior to importing this module 47 | RequiredModules = @() 48 | 49 | # Assemblies that must be loaded prior to importing this module 50 | RequiredAssemblies = @(".\Microsoft.AnalysisServices.dll" 51 | , ".\Microsoft.AnalysisServices.Tabular.dll" 52 | , ".\Microsoft.AnalysisServices.Core.dll" 53 | , ".\Microsoft.AnalysisServices.SPClient.Interfaces.dll" 54 | , ".\Microsoft.AnalysisServices.Tabular.Json.dll" 55 | ".\CsvHelper.dll" 56 | ) 57 | 58 | # Script files (.ps1) that are run in the caller's environment prior to importing this module. 59 | # ScriptsToProcess = @() 60 | 61 | # Type files (.ps1xml) to be loaded when importing this module 62 | # TypesToProcess = @() 63 | 64 | # Format files (.ps1xml) to be loaded when importing this module 65 | # FormatsToProcess = @() 66 | 67 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess 68 | NestedModules = @(".\SQLHelper.psm1") 69 | 70 | # Functions to export from this module 71 | FunctionsToExport = @( 72 | "Get-PBIDesktopTCPPort", "Convert-PowerBIDesktopToASTabular", "Export-PBIDesktopToSQL", "Export-PBIDesktopToCSV","Get-PBIDataSetFromPBIDesktop" 73 | , "Export-PBIDesktopODCConnection" 74 | ) 75 | 76 | # Cmdlets to export from this module 77 | CmdletsToExport = @() 78 | 79 | # Variables to export from this module 80 | VariablesToExport = @() 81 | 82 | # Aliases to export from this module 83 | AliasesToExport = '*' 84 | 85 | # List of all modules packaged with this module 86 | ModuleList = @(".\SQLHelper.psm1") 87 | 88 | # List of all files packaged with this module 89 | FileList = @("Microsoft.AnalysisServices.Core.dll" 90 | , "Microsoft.AnalysisServices.dll" 91 | , "Microsoft.AnalysisServices.SPClient.Interfaces.dll" 92 | , "Microsoft.AnalysisServices.Tabular.dll" 93 | , "Microsoft.AnalysisServices.Tabular.Json.dll" 94 | , "CsvHelper.dll" 95 | ) 96 | 97 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. 98 | PrivateData = @{ 99 | 100 | PSData = @{ 101 | 102 | # Tags applied to this module. These help with module discovery in online galleries. 103 | Tags = @('data', 'analysisservices', 'azure', 'ssas', 'as', 'tabular', 'powerbi') 104 | 105 | # A URL to the license for this module. 106 | # LicenseUri = '' 107 | 108 | # A URL to the main website for this project. 109 | ProjectUri = 'https://github.com/DevScope/powerbi-powershell-modules' 110 | 111 | # A URL to an icon representing this module. 112 | # IconUri = '' 113 | 114 | # ReleaseNotes of this module 115 | # ReleaseNotes = '' 116 | 117 | } # End of PSData hashtable 118 | 119 | } # End of PrivateData hashtable 120 | 121 | # HelpInfo URI of this module 122 | HelpInfoURI = 'https://github.com/DevScope/powerbi-powershell-modules' 123 | 124 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. 125 | # DefaultCommandPrefix = '' 126 | 127 | } 128 | 129 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/_ExportODCConnection.ContextMenu.Demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/_ExportODCConnection.ContextMenu.Demo.gif -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/_ExportODCConnection.ContextMenu.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS.Tools/_ExportODCConnection.ContextMenu.reg -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Convert-PowerBIDesktopToASTabular.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Convert-PowerBIDesktopToASTabular 9 | 10 | ## SYNOPSIS 11 | A quick way to convert a Power BI Desktop file into an Analysis Services Tabular Project 12 | 13 | ## SYNTAX 14 | 15 | ### pbiDesktopWindowName 16 | ``` 17 | Convert-PowerBIDesktopToASTabular -pbiDesktopWindowName -outputPath 18 | [-removeInternalPBITables] [] 19 | ``` 20 | 21 | ### pbiDesktopPbiTemplatePath 22 | ``` 23 | Convert-PowerBIDesktopToASTabular -pbiDesktopPbiTemplatePath -outputPath 24 | [-removeInternalPBITables] [] 25 | ``` 26 | 27 | ## DESCRIPTION 28 | A quick way to convert a Power BI Desktop file into an Analysis Services Tabular Project 29 | 30 | ## EXAMPLES 31 | 32 | ### EXAMPLE 1 33 | ``` 34 | Convert-PowerBIDesktopToASTabular -pbiDesktopWindowName "*VanArsdel - Sales*" -outputPath ".\SSASProj" 35 | ``` 36 | 37 | ## PARAMETERS 38 | 39 | ### -pbiDesktopWindowName 40 | Power BI Desktop window name, wildcards can be used. 41 | Ex: "*name*" 42 | 43 | ```yaml 44 | Type: String 45 | Parameter Sets: pbiDesktopWindowName 46 | Aliases: 47 | 48 | Required: True 49 | Position: Named 50 | Default value: None 51 | Accept pipeline input: False 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### -pbiDesktopPbiTemplatePath 56 | Path to PowerBI Template 57 | 58 | ```yaml 59 | Type: String 60 | Parameter Sets: pbiDesktopPbiTemplatePath 61 | Aliases: 62 | 63 | Required: True 64 | Position: Named 65 | Default value: None 66 | Accept pipeline input: False 67 | Accept wildcard characters: False 68 | ``` 69 | 70 | ### -outputPath 71 | Path to the output folder 72 | 73 | ```yaml 74 | Type: String 75 | Parameter Sets: (All) 76 | Aliases: 77 | 78 | Required: True 79 | Position: Named 80 | Default value: None 81 | Accept pipeline input: False 82 | Accept wildcard characters: False 83 | ``` 84 | 85 | ### -removeInternalPBITables 86 | This remove internal tables like "Localdate_XXXXXX" 87 | 88 | ```yaml 89 | Type: SwitchParameter 90 | Parameter Sets: (All) 91 | Aliases: 92 | 93 | Required: False 94 | Position: Named 95 | Default value: False 96 | Accept pipeline input: False 97 | Accept wildcard characters: False 98 | ``` 99 | 100 | ### CommonParameters 101 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 102 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 103 | 104 | ## INPUTS 105 | 106 | ## OUTPUTS 107 | 108 | ## NOTES 109 | 110 | ## RELATED LINKS 111 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Export-PBIDesktopODCConnection.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-PBIDesktopODCConnection 9 | 10 | ## SYNOPSIS 11 | Exports a PBIDesktop ODC connection file 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-PBIDesktopODCConnection [[-pbiDesktopWindowName] ] [[-path] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Exports a PBIDesktop ODC connection file 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Export-PBIDesktopODCConnection -pbiDesktopWindowName "*VanArsdel - Sales*" 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -pbiDesktopWindowName 32 | Power BI Desktop window name, wildcards can be used. 33 | Ex: "*name*" 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -path 48 | ODC file path to be created 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 64 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 65 | 66 | ## INPUTS 67 | 68 | ## OUTPUTS 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Export-PBIDesktopToCSV.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-PBIDesktopToCSV 9 | 10 | ## SYNOPSIS 11 | A way to export all your Power BI Desktop model tables into CSV files 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-PBIDesktopToCSV [-pbiDesktopWindowName] [[-tables] ] [-outputPath] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | A way to export all your Power BI Desktop model tables into CSV files 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Export-PBIDesktopToCSV -pbiDesktopWindowName "*Van Arsdel*" -outputPath ".\CSVOutput" 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -pbiDesktopWindowName 33 | Power BI Desktop window name, wildcards can be used. 34 | Ex: "*name*" 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -tables 49 | The tables to be exported - if empty all the tables get exported 50 | 51 | ```yaml 52 | Type: String[] 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -outputPath 64 | Path to the output folder 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: True 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 80 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 81 | 82 | ## INPUTS 83 | 84 | ## OUTPUTS 85 | 86 | ## NOTES 87 | 88 | ## RELATED LINKS 89 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Export-PBIDesktopToSQL.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-PBIDesktopToSQL 9 | 10 | ## SYNOPSIS 11 | A way to export all your Power BI Desktop model tables into a SQL Server Database 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-PBIDesktopToSQL [-pbiDesktopWindowName] [[-tables] ] [-sqlConnStr] 17 | [[-sqlSchema] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | A way to export all your Power BI Desktop model tables into a SQL Server Database 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Export-PBIDesktopToSQL -pbiDesktopWindowName "*Van Arsdel*" -sqlConnStr "Data Source=.\sql2017; Initial Catalog=Dummy; Integrated Security=true" -sqlSchema "stg" -Verbose 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -pbiDesktopWindowName 33 | Power BI Desktop window name, wildcards can be used. 34 | Ex: "*name*" 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -tables 49 | The tables to be exported - if empty all the tables get exported 50 | 51 | ```yaml 52 | Type: String[] 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -sqlConnStr 64 | The SQL Server connection string 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: True 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -sqlSchema 79 | The target sql server schema where all the tables will be created (if not exists) 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: Dbo 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### CommonParameters 94 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 95 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 96 | 97 | ## INPUTS 98 | 99 | ## OUTPUTS 100 | 101 | ## NOTES 102 | 103 | ## RELATED LINKS 104 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Get-PBIDataSetFromPBIDesktop.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDataSetFromPBIDesktop 9 | 10 | ## SYNOPSIS 11 | A quick way to convert a Power BI Desktop file in a REST API enabled dataset 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDataSetFromPBIDesktop [-pbiDesktopWindowName] [-datasetName] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | A quick way to convert a Power BI Desktop file in a REST API enabled dataset 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-PBIDataSetFromPBIDesktop -datasetName $datasetName -pbiDesktopWindowName "*RealTime*" 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -pbiDesktopWindowName 32 | Power BI Desktop window name, wildcards can be used. 33 | Ex: "*name*" 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -datasetName 48 | Name to Dataset 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: True 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 64 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 65 | 66 | ## INPUTS 67 | 68 | ## OUTPUTS 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/Get-PBIDesktopTCPPort.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS.Tools-help.xml 3 | Module Name: PowerBIPS.Tools 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDesktopTCPPort 9 | 10 | ## SYNOPSIS 11 | Returns the Power BI Desktop Analysis Services Instance TCP Port 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDesktopTCPPort [[-pbiDesktopWindowName] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Returns the Power BI Desktop Analysis Services Instance TCP Port 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-PBIDesktopTCPPort -pbiDesktopWindowName "*VanArsdel - Sales*" 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -pbiDesktopWindowName 32 | Power BI Desktop window name, wildcards can be used. 33 | Ex: "*name*" 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### CommonParameters 48 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 49 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 50 | 51 | ## INPUTS 52 | 53 | ## OUTPUTS 54 | 55 | ## NOTES 56 | 57 | ## RELATED LINKS 58 | -------------------------------------------------------------------------------- /Modules/PowerBIPS.Tools/doc/PowerBIPS.Tools.md: -------------------------------------------------------------------------------- 1 | --- 2 | Module Name: PowerBIPS.Tools 3 | Module Guid: 4380560b-ec14-4627-af81-635405ceb29f 4 | Download Help Link: {{Please enter FwLink manually}} 5 | Help Version: {{Please enter version of help manually (X.X.X.X) format}} 6 | Locale: en-US 7 | --- 8 | 9 | # PowerBIPS.Tools Module 10 | ## Description 11 | {{Manually Enter Description Here}} 12 | 13 | ## PowerBIPS.Tools Cmdlets 14 | ### [Convert-PowerBIDesktopToASTabular](Convert-PowerBIDesktopToASTabular.md) 15 | {{Manually Enter Convert-PowerBIDesktopToASTabular Description Here}} 16 | 17 | ### [Export-PBIDesktopODCConnection](Export-PBIDesktopODCConnection.md) 18 | {{Manually Enter Export-PBIDesktopODCConnection Description Here}} 19 | 20 | ### [Export-PBIDesktopToCSV](Export-PBIDesktopToCSV.md) 21 | {{Manually Enter Export-PBIDesktopToCSV Description Here}} 22 | 23 | ### [Export-PBIDesktopToSQL](Export-PBIDesktopToSQL.md) 24 | {{Manually Enter Export-PBIDesktopToSQL Description Here}} 25 | 26 | ### [Get-PBIDataSetFromPBIDesktop](Get-PBIDataSetFromPBIDesktop.md) 27 | {{Manually Enter Get-PBIDataSetFromPBIDesktop Description Here}} 28 | 29 | ### [Get-PBIDesktopTCPPort](Get-PBIDesktopTCPPort.md) 30 | {{Manually Enter Get-PBIDesktopTCPPort Description Here}} 31 | 32 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "type": "PowerShell", 10 | "request": "launch", 11 | "name": "PowerShell Launch Current File", 12 | "script": "${file}", 13 | "args": [], 14 | "cwd": "${file}" 15 | }, 16 | { 17 | "type": "PowerShell", 18 | "request": "launch", 19 | "name": "PowerShell Launch Current File in Temporary Console", 20 | "script": "${file}", 21 | "args": [], 22 | "cwd": "${file}", 23 | "createTemporaryIntegratedConsole": true 24 | }, 25 | { 26 | "type": "PowerShell", 27 | "request": "launch", 28 | "name": "PowerShell Launch Current File w/Args Prompt", 29 | "script": "${file}", 30 | "args": [ 31 | "${command:SpecifyScriptArgs}" 32 | ], 33 | "cwd": "${file}" 34 | }, 35 | { 36 | "type": "PowerShell", 37 | "request": "attach", 38 | "name": "PowerShell Attach to Host Process", 39 | "processId": "${command:PickPSHostProcess}", 40 | "runspaceId": 1 41 | }, 42 | { 43 | "type": "PowerShell", 44 | "request": "launch", 45 | "name": "PowerShell Interactive Session", 46 | "cwd": "${workspaceRoot}" 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/GenerateDocs.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | 4 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 5 | 6 | Import-Module platyPS 7 | 8 | Import-Module "$currentPath\PowerBIPS.psd1" -Force 9 | 10 | $outputPath = "$currentPath\doc" 11 | 12 | Remove-Item $outputPath -Force -Recurse 13 | 14 | if (!(Test-Path $outputPath)) 15 | { 16 | New-MarkdownHelp -Module PowerBIPS -OutputFolder $outputPath -WithModulePage 17 | } 18 | else 19 | { 20 | Update-MarkdownHelpModule -Path $outputPath -RefreshModulePage 21 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/Microsoft.IdentityModel.Clients.ActiveDirectory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS/Microsoft.IdentityModel.Clients.ActiveDirectory.dll -------------------------------------------------------------------------------- /Modules/PowerBIPS/PowerBIPS-Automation.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionFields": [ 3 | { 4 | "IsEncrypted": false, 5 | "IsOptional": false, 6 | "Name": "ClientId", 7 | "TypeName": "System.String" 8 | }, 9 | { 10 | "IsEncrypted": false, 11 | "IsOptional": false, 12 | "Name": "UserName", 13 | "TypeName": "System.String" 14 | }, 15 | { 16 | "IsEncrypted": true, 17 | "IsOptional": false, 18 | "Name": "Password", 19 | "TypeName": "System.String" 20 | } 21 | ], 22 | "ConnectionTypeName": "PowerBI", 23 | "IntegrationModuleName": "PowerBIPS" 24 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/PowerBIPS.md: -------------------------------------------------------------------------------- 1 | --- 2 | Module Name: PowerBIPS 3 | Module Guid: 163a1640-a4f2-4b1f-a3af-2796ad56200b 4 | Version: 2.0.1.3 5 | --- 6 | 7 | # PowerBIPS Module 8 | ## Description 9 | A PowerShell module that wrap's the Power BI REST API 10 | 11 | More samples of usage here: 12 | 13 | * https://ruiromanoblog.wordpress.com/2015/03/03/create-a-real-time-it-dashboard-with-powerbips/ 14 | * https://github.com/DevScope/powerbi-powershell-modules/blob/master/Modules/PowerBIPS/Samples 15 | 16 | ## Available on PowerShell Gallery: 17 | 18 | https://www.powershellgallery.com/packages/PowerBIPS 19 | 20 | ### Install from PowerShell Gallery 21 | 22 | ```powershell 23 | Install-Module -Name PowerBIPS 24 | # Or without admin priviledge: 25 | Install-Module -Name PowerBIPS -Scope CurrentUser 26 | ``` 27 | 28 | ## Sample Script - The most easy way to send data to Power BI 29 | 30 | ```powershell 31 | 32 | Get-Process | Out-PowerBI -verbose 33 | 34 | ``` 35 | 36 | ## Sample Script - Export ALL Pbix from a Workspace 37 | 38 | ```powershell 39 | 40 | Set-PBIWorkspace -id "GUID" 41 | 42 | Get-PBIReport | Export-PBIReport -destinationFolder ".\Output" 43 | 44 | ``` 45 | 46 | ## Sample Script - Rebind All Reports to a different DataSet 47 | 48 | ```powershell 49 | 50 | Get-PBIReport -groupId "WorkspaceId" | Set-PBIReportsDataset -targetDatasetId "DataSetId" 51 | 52 | ``` 53 | 54 | ## Sample Script - Authenticate with Service Principal 55 | 56 | ```powershell 57 | 58 | $tenantId = "MyTenant.onmicrosoft.com" 59 | $clientId = "App Id" 60 | $clientSecret = "App Secret" 61 | 62 | $authToken = Get-PBIAuthToken -clientId $clientId -clientSecret $clientSecret -tenantId $tenantId 63 | 64 | $reports = Get-PBIReport -authToken $authToken -groupId "Workspace Id" -Verbose 65 | 66 | $reports 67 | 68 | ``` 69 | 70 | ## Sample Script - Monitor a list of computers in Real-Time 71 | 72 | ```powershell 73 | # Get the authentication token using ADAL library (OAuth) 74 | 75 | $authToken = Get-PBIAuthToken -Verbose 76 | 77 | $workspaceId = "GUID" 78 | $datasetName = "Computer Monitoring" 79 | $reset = $false 80 | $computers = @($env:COMPUTERNAME) 81 | 82 | # Change to the destination workspace 83 | 84 | Set-PBIWorkspace -id $workspaceId 85 | 86 | # Test the existence of the dataset and if exists retrieve the metadata 87 | 88 | $dataSetSchema = Get-PBIDataSet -authToken $authToken -name $datasetName -Verbose 89 | 90 | if (-not $dataSetSchema) 91 | { 92 | # If cannot find the DataSet create a new one with this schema 93 | 94 | $dataSetSchema = @{name = $datasetName 95 | ; tables = @( 96 | @{name = "Counters" 97 | ; columns = @( 98 | @{ name = "ComputerName"; dataType = "String"; isHidden = "true" } 99 | , @{ name = "TimeStamp"; dataType = "DateTime" } 100 | , @{ name = "CounterSet"; dataType = "String" } 101 | , @{ name = "CounterName"; dataType = "String" } 102 | , @{ name = "CounterValue"; dataType = "Double" } 103 | ) 104 | } 105 | , 106 | @{name = "Computers" 107 | ; columns = @( 108 | @{ name = "ComputerName"; dataType = "String" } 109 | , @{ name = "Domain"; dataType = "string" } 110 | , @{ name = "Manufacturer"; dataType = "string" } 111 | ) 112 | ;measures = @( 113 | @{name="Average CPU"; expression="CALCULATE(AVERAGE('Counters'[CounterValue]) / 100, FILTER('Counters', 'Counters'[CounterSet] = ""Processor(_Total)"" && 'Counters'[CounterName] = ""% Processor Time""))"; formatString="0.00%"} 114 | ) 115 | } 116 | ) 117 | ; relationships = @( 118 | @{ 119 | name = [guid]::NewGuid().ToString() 120 | ; fromTable = "Computers" 121 | ; fromColumn = "ComputerName" 122 | ; toTable = "Counters" 123 | ; toColumn = "ComputerName" 124 | ; crossFilteringBehavior = "oneDirection" 125 | 126 | }) 127 | } 128 | 129 | $dataSetSchema = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -Verbose 130 | } 131 | else 132 | { 133 | # If a dataset exists, delete all its data 134 | if ($reset) 135 | { 136 | Clear-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Counters" -Verbose 137 | Clear-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Computers" -Verbose 138 | } 139 | } 140 | 141 | # Get Computer Info 142 | 143 | $computers |% { 144 | 145 | $computerInfo = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $_ 146 | 147 | @{ 148 | ComputerName = $_ 149 | ; Domain = $computerInfo.Domain 150 | ; Manufacturer = $computerInfo.Manufacturer 151 | } | Add-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Computers" -batchSize 100 -Verbose 152 | 153 | } 154 | 155 | # Collect data from continuosly in intervals of 5 seconds 156 | 157 | $counters = Get-Counter -ComputerName $computers -ListSet @("processor", "memory", "physicaldisk") 158 | 159 | $counters | Get-Counter -Continuous -SampleInterval 5 |%{ 160 | 161 | # Parse the Counters into the schema of the PowerBI dataset 162 | 163 | $pbiData = $_.CounterSamples | Select @{Name = "ComputerName"; Expression = {$_.Path.Split('\')[2]}} ` 164 | , @{Name="TimeStamp"; Expression = {$_.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss")}} ` 165 | , @{Name="CounterSet"; Expression = {$_.Path.Split('\')[3]}} ` 166 | , @{Name="CounterName"; Expression = {$_.Path.Split('\')[4]}} ` 167 | , @{Name="CounterValue"; Expression = {$_.CookedValue}} 168 | 169 | $pbiData | Add-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Counters" -batchSize 100 -Verbose 170 | 171 | Write-Output "Sleeping..." 172 | } 173 | 174 | ``` 175 | 176 | ## PowerBIPS Cmdlets 177 | ### [Add-PBITableRows](doc/Add-PBITableRows.md) 178 | 179 | 180 | ### [Clear-PBITableRows](doc/Clear-PBITableRows.md) 181 | 182 | 183 | ### [Copy-PBIReports](doc/Copy-PBIReports.md) 184 | 185 | 186 | ### [Export-PBIReport](doc/Export-PBIReport.md) 187 | 188 | 189 | ### [Get-PBIAuthToken](doc/Get-PBIAuthToken.md) 190 | 191 | 192 | ### [Get-PBIDashboard](doc/Get-PBIDashboard.md) 193 | 194 | 195 | ### [Get-PBIDashboardTile](doc/Get-PBIDashboardTile.md) 196 | 197 | 198 | ### [Get-PBIDataSet](doc/Get-PBIDataSet.md) 199 | 200 | 201 | ### [Get-PBIDatasetParameters](doc/Get-PBIDatasetParameters.md) 202 | 203 | 204 | ### [Get-PBIDatasetRefreshHistory](doc/Get-PBIDatasetRefreshHistory.md) 205 | 206 | 207 | ### [Get-PBIDataSetTables](doc/Get-PBIDataSetTables.md) 208 | 209 | 210 | ### [Get-PBIDatasources](doc/Get-PBIDatasources.md) 211 | 212 | 213 | ### [Get-PBIGroup](doc/Get-PBIGroup.md) 214 | 215 | 216 | ### [Get-PBIGroupUsers](doc/Get-PBIGroupUsers.md) 217 | 218 | 219 | ### [Get-PBIImports](doc/Get-PBIImports.md) 220 | 221 | 222 | ### [Get-PBIModuleConfig](doc/Get-PBIModuleConfig.md) 223 | 224 | 225 | ### [Get-PBIReport](doc/Get-PBIReport.md) 226 | 227 | 228 | ### [Import-PBIFile](doc/Import-PBIFile.md) 229 | 230 | 231 | ### [Invoke-PBIRequest](doc/Invoke-PBIRequest.md) 232 | 233 | 234 | ### [New-PBIDataSet](doc/New-PBIDataSet.md) 235 | 236 | 237 | ### [New-PBIGroup](doc/New-PBIGroup.md) 238 | 239 | 240 | ### [New-PBIGroupUser](doc/New-PBIGroupUser.md) 241 | 242 | 243 | ### [Out-PowerBI](doc/Out-PowerBI.md) 244 | 245 | 246 | ### [Request-PBIDatasetRefresh](doc/Request-PBIDatasetRefresh.md) 247 | 248 | 249 | ### [Set-PBIDatasetParameters](doc/Set-PBIDatasetParameters.md) 250 | 251 | 252 | ### [Set-PBIGroup](doc/Set-PBIGroup.md) 253 | 254 | 255 | ### [Set-PBIModuleConfig](doc/Set-PBIModuleConfig.md) 256 | 257 | 258 | ### [Set-PBIReportsDataset](doc/Set-PBIReportsDataset.md) 259 | 260 | 261 | ### [Test-PBIDataSet](doc/Test-PBIDataSet.md) 262 | 263 | 264 | ### [Update-PBIDatasetDatasources](doc/Update-PBIDatasetDatasources.md) 265 | 266 | 267 | ### [Update-PBITableSchema](doc/Update-PBITableSchema.md) 268 | 269 | ### [Set-PBIReportContent](doc/Set-PBIReportContent.md) 270 | 271 | ### [New-PBIDashboard](doc/New-PBIDashboard.md) 272 | 273 | ### [Remove-PBIDataSet](doc/Remove-PBIDataSet.md) 274 | 275 | ### [Remove-PBIReport](doc/Remove-PBIReport.md) 276 | 277 | 278 | 279 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/PowerBIPS.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | 3 | # Script module or binary module file associated with this manifest. 4 | RootModule = 'PowerBIPS.psm1' 5 | 6 | # Version number of this module. 7 | ModuleVersion = '2.0.4.11' 8 | 9 | # ID used to uniquely identify this module 10 | GUID = '163A1640-A4F2-4B1F-A3AF-2796AD56200B' 11 | 12 | # Author of this module 13 | Author = '"DevScope"' 14 | 15 | # Company or vendor of this module 16 | CompanyName = 'DevScope' 17 | 18 | # Copyright statement for this module 19 | Copyright = '(c) 2015 DevScope. All rights reserved.' 20 | 21 | # Description of the functionality provided by this module 22 | Description = 'A lightweight powershell module with cmdlets to interact with PowerBI developer APIs' 23 | 24 | # Minimum version of the Windows PowerShell engine required by this module 25 | PowerShellVersion = '3.0' 26 | 27 | # Name of the Windows PowerShell host required by this module 28 | # PowerShellHostName = '' 29 | 30 | # Minimum version of the Windows PowerShell host required by this module 31 | # PowerShellHostVersion = '' 32 | 33 | # Minimum version of Microsoft .NET Framework required by this module 34 | DotNetFrameworkVersion = '4.5' 35 | 36 | # Minimum version of the common language runtime (CLR) required by this module 37 | # CLRVersion = '' 38 | 39 | # Processor architecture (None, X86, Amd64) required by this module 40 | # ProcessorArchitecture = '' 41 | 42 | # Modules that must be imported into the global environment prior to importing this module 43 | # RequiredModules = @() 44 | 45 | # Assemblies that must be loaded prior to importing this module 46 | RequiredAssemblies = @(".\Microsoft.IdentityModel.Clients.ActiveDirectory.dll") 47 | 48 | # Script files (.ps1) that are run in the caller's environment prior to importing this module. 49 | # ScriptsToProcess = @() 50 | 51 | # Type files (.ps1xml) to be loaded when importing this module 52 | # TypesToProcess = @() 53 | 54 | # Format files (.ps1xml) to be loaded when importing this module 55 | # FormatsToProcess = @() 56 | 57 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess 58 | #NestedModules = @() 59 | 60 | # Functions to export from this module 61 | FunctionsToExport = @( 62 | "Get-PBIAuthToken" 63 | , "Set-PBIGroup", "Get-PBIGroup", "Get-PBIGroupUsers", "New-PBIGroup", "New-PBIGroupUser" 64 | , "Out-PowerBI" 65 | , "Get-PBIDataSet", "Get-PBIDataSetTables", "Test-PBIDataSet", "New-PBIDataSet", "Request-PBIDatasetRefresh" 66 | , "Get-PBIDatasetRefreshHistory", "Update-PBIDatasetDatasources" 67 | , "Get-PBIDatasetParameters", "Set-PBIDatasetParameters" 68 | , "Add-PBITableRows", "Clear-PBITableRows", "Update-PBITableSchema" 69 | , "Get-PBIImports", "Import-PBIFile" 70 | , "Get-PBIDashboard", "Get-PBIDashboardTile", "New-PBIDashboard" 71 | , "Get-PBIReport", "Export-PBIReport", "Copy-PBIReports", "Set-PBIReportsDataset" 72 | , "Get-PBIDatasources", "Invoke-PBIRequest", "Get-PBIModuleConfig", "Set-PBIModuleConfig" 73 | , "Set-PBIReportContent", "Get-PBIAuthTokenHttp", "Remove-PBIDataSet" 74 | , "Remove-PBIReport", "Get-PBIActivityEvents" 75 | , "Grant-AppTenantPermission" 76 | ) 77 | 78 | # Cmdlets to export from this module 79 | CmdletsToExport = @() 80 | 81 | # Variables to export from this module 82 | VariablesToExport = @() 83 | 84 | # Aliases to export from this module 85 | AliasesToExport = '*' 86 | 87 | # List of all modules packaged with this module 88 | #ModuleList = @(".\PowerBIPS.psm1", ".\PowerBIPS.Tools.psm1") 89 | 90 | # List of all files packaged with this module 91 | FileList = @("Microsoft.IdentityModel.Clients.ActiveDirectory.dll") 92 | 93 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. 94 | PrivateData = @{ 95 | 96 | PSData = @{ 97 | 98 | # Tags applied to this module. These help with module discovery in online galleries. 99 | Tags = @('data', 'powerbi', 'bi', 'rest', 'api', 'developer') 100 | 101 | # A URL to the license for this module. 102 | # LicenseUri = '' 103 | 104 | # A URL to the main website for this project. 105 | ProjectUri = 'https://github.com/DevScope/powerbi-powershell-modules' 106 | 107 | # A URL to an icon representing this module. 108 | # IconUri = '' 109 | 110 | # ReleaseNotes of this module 111 | # ReleaseNotes = '' 112 | 113 | } # End of PSData hashtable 114 | 115 | } # End of PrivateData hashtable 116 | 117 | # HelpInfo URI of this module 118 | HelpInfoURI = 'https://github.com/DevScope/powerbi-powershell-modules' 119 | 120 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. 121 | # DefaultCommandPrefix = '' 122 | 123 | } 124 | 125 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/CSVData/_Aux/CSVGenerator.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "C:\Users\Romano\Work\GitHub\sql-powershell-modules\Modules\SQLHelper" -Force 8 | 9 | $connStr = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=AdventureWorksDW2012;Data Source=.\sql2014" 10 | 11 | $productsQuery = "select p.EnglishProductName Product, p.Color, isnull(p.DealerPrice,0) DealerPrice, isnull(p.ListPrice, 0) ListPrice, p.ModelName, ps.EnglishProductSubcategoryName SubCategory, pc.EnglishProductCategoryName Category 12 | from DimProduct p 13 | join DimProductSubcategory ps on ps.ProductSubcategoryKey = p.ProductSubcategoryKey 14 | join DimProductCategory pc on pc.ProductCategoryKey = ps.ProductCategoryKey" 15 | 16 | $table = Invoke-SQLCommand -executeType QueryAsTable -connectionString $connStr -commandText $productsQuery 17 | 18 | $fileName = "$currentPath\Products.csv" 19 | 20 | if (Test-Path $fileName) 21 | { 22 | Remove-Item $fileName -Force 23 | } 24 | 25 | $table | Export-Csv -Delimiter "," -NoTypeInformation -NoClobber -Path $fileName 26 | 27 | $salesQuery = "select p.EnglishProductName Product, ps.EnglishProductSubcategoryName SubCategory, pc.EnglishProductCategoryName Category 28 | , dateadd(yy, 7, s.OrderDate) OrderDate 29 | , isnull(s.SalesAmount,0) SalesAmount, isnull(s.Freight, 0) Freight 30 | , g.EnglishCountryRegionName Country, g.City, g.PostalCode 31 | from [dbo].[FactInternetSales] s 32 | join DimProduct p on s.ProductKey = p.ProductKey 33 | join DimProductSubcategory ps on ps.ProductSubcategoryKey = p.ProductSubcategoryKey 34 | join DimProductCategory pc on pc.ProductCategoryKey = ps.ProductCategoryKey 35 | join DimCustomer c on s.CustomerKey = c.CustomerKey 36 | join DimGeography g on g.GeographyKey = c.GeographyKey 37 | where Year(s.OrderDate) = 2008 38 | and pc.EnglishProductCategoryName = 'Bikes' 39 | order by OrderDate desc" 40 | 41 | $table = Invoke-SQLCommand -executeType QueryAsTable -connectionString $connStr -commandText $salesQuery 42 | 43 | $table | Group-Object { 44 | $_.OrderDate.Year * 100 + $_.OrderDate.Month 45 | } |% { 46 | 47 | $fileName = "$currentPath\Sales.$($_.Name).csv" 48 | 49 | if (Test-Path $fileName) 50 | { 51 | Remove-Item $fileName -Force 52 | } 53 | 54 | $_.Group | Select Product, SubCategory, Category, @{N="OrderDate";E={$_.OrderDate.ToString("yyyy-MM-dd HH:mm:ss")}}, SalesAmount, Freight, Country, City, PostalCode | Export-Csv -Delimiter "," -NoTypeInformation -NoClobber -Path $fileName 55 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/Modules/InvokeTwitterAPIs.psm1: -------------------------------------------------------------------------------- 1 | <# 2 | =========================================================================== 3 | Created on: 2/11/2015 1:04 PM 4 | Created by: Shannon Conley & Mehmet Kaya 5 | Filename: InvokeTwitterAPIs.psm1 6 | ------------------------------------------------------------------------- 7 | Module Name: InvokeTwitterAPIs 8 | Description: Provides a command to call any Twitter REST API, 9 | a command to access any of the Twitter Streaming APIs, 10 | and a command to upload media to Twitter. 11 | 12 | 13 | List of Twitter REST APIs: 14 | https://dev.twitter.com/rest/public 15 | 16 | Twitter Streamings APIs Info: 17 | https://dev.twitter.com/streaming/overview 18 | 19 | To use these commands, you must obtain a Twitter API key, API secret, 20 | access token and access token secret 21 | https://twittercommunity.com/t/how-to-get-my-api-key/7033 22 | 23 | This was developed using Windows PowerShell 4.0. 24 | 25 | =========================================================================== 26 | #> 27 | 28 | function Get-OAuth { 29 | <# 30 | .SYNOPSIS 31 | This function creates the authorization string needed to send a POST or GET message to the Twitter API 32 | 33 | .PARAMETER AuthorizationParams 34 | This hashtable should the following key value pairs 35 | HttpEndPoint - the twitter resource url [Can be found here: https://dev.twitter.com/rest/public] 36 | RESTVerb - Either 'GET' or 'POST' depending on the action 37 | Params - A hashtable containing the rest parameters (key value pairs) associated that method 38 | OAuthSettings - A hashtable that must contain only the following keys and their values (Generate here: https://dev.twitter.com/oauth) 39 | ApiKey 40 | ApiSecret 41 | AccessToken 42 | AccessTokenSecret 43 | .LINK 44 | This function evolved from code found in Adam Betram's Get-OAuthAuthorization function in his MyTwitter module. 45 | The MyTwitter module can be found here: https://gallery.technet.microsoft.com/scriptcenter/Tweet-and-send-Twitter-DMs-8c2d6f0a 46 | Adam Betram's blogpost here: http://www.adamtheautomator.com/twitter-powershell/ provides a detailed explanation 47 | about how to generate an access token needed to create the authorization string 48 | 49 | .EXAMPLE 50 | $OAuth = @{'ApiKey' = 'yourapikey'; 'ApiSecret' = 'yourapisecretkey';'AccessToken' = 'yourapiaccesstoken';'AccessTokenSecret' = 'yourapitokensecret'} 51 | $Parameters = @{'q'='rumi'} 52 | $AuthParams = @{} 53 | $AuthParams.Add('HttpEndPoint', 'https://api.twitter.com/1.1/search/tweets.json') 54 | $AuthParams.Add('RESTVerb', 'GET') 55 | $AuthParams.Add('Params', $Parameters) 56 | $AuthParams.Add('OAuthSettings', $OAuth) 57 | $AuthorizationString = Get-OAuth -AuthorizationParams $AuthParams 58 | 59 | 60 | #> 61 | [OutputType('System.Management.Automation.PSCustomObject')] 62 | Param($AuthorizationParams) 63 | process{ 64 | try { 65 | 66 | ## Generate a random 32-byte string. I'm using the current time (in seconds) and appending 5 chars to the end to get to 32 bytes 67 | ## Base64 allows for an '=' but Twitter does not. If this is found, replace it with some alphanumeric character 68 | $OauthNonce = [System.Convert]::ToBase64String(([System.Text.Encoding]::ASCII.GetBytes("$([System.DateTime]::Now.Ticks.ToString())12345"))).Replace('=', 'g') 69 | ## Find the total seconds since 1/1/1970 (epoch time) 70 | $EpochTimeNow = [System.DateTime]::UtcNow - [System.DateTime]::ParseExact("01/01/1970", "dd/MM/yyyy", $null) 71 | $OauthTimestamp = [System.Convert]::ToInt64($EpochTimeNow.TotalSeconds).ToString(); 72 | ## Build the signature 73 | $SignatureBase = "$([System.Uri]::EscapeDataString($AuthorizationParams.HttpEndPoint))&" 74 | $SignatureParams = @{ 75 | 'oauth_consumer_key' = $AuthorizationParams.OAuthSettings.ApiKey; 76 | 'oauth_nonce' = $OauthNonce; 77 | 'oauth_signature_method' = 'HMAC-SHA1'; 78 | 'oauth_timestamp' = $OauthTimestamp; 79 | 'oauth_token' = $AuthorizationParams.OAuthSettings.AccessToken; 80 | 'oauth_version' = '1.0'; 81 | } 82 | $AuthorizationParams.Params.Keys | % { $SignatureParams.Add($_ , [System.Net.WebUtility]::UrlEncode($AuthorizationParams.Params.Item($_)).Replace('+','%20'))} 83 | 84 | 85 | ## Create a string called $SignatureBase that joins all URL encoded 'Key=Value' elements with a & 86 | ## Remove the URL encoded & at the end and prepend the necessary 'POST&' verb to the front 87 | $SignatureParams.GetEnumerator() | sort name | foreach { $SignatureBase += [System.Uri]::EscapeDataString("$($_.Key)=$($_.Value)&") } 88 | 89 | $SignatureBase = $SignatureBase.Substring(0,$SignatureBase.Length-1) 90 | $SignatureBase = $SignatureBase.Substring(0,$SignatureBase.Length-1) 91 | $SignatureBase = $SignatureBase.Substring(0,$SignatureBase.Length-1) 92 | $SignatureBase = $AuthorizationParams.RESTVerb+'&' + $SignatureBase 93 | 94 | ## Create the hashed string from the base signature 95 | $SignatureKey = [System.Uri]::EscapeDataString($AuthorizationParams.OAuthSettings.ApiSecret) + "&" + [System.Uri]::EscapeDataString($AuthorizationParams.OAuthSettings.AccessTokenSecret); 96 | 97 | $hmacsha1 = new-object System.Security.Cryptography.HMACSHA1; 98 | $hmacsha1.Key = [System.Text.Encoding]::ASCII.GetBytes($SignatureKey); 99 | $OauthSignature = [System.Convert]::ToBase64String($hmacsha1.ComputeHash([System.Text.Encoding]::ASCII.GetBytes($SignatureBase))); 100 | 101 | ## Build the authorization headers using most of the signature headers elements. This is joining all of the 'Key=Value' elements again 102 | ## and only URL encoding the Values this time while including non-URL encoded double quotes around each value 103 | $AuthorizationParams = $SignatureParams 104 | $AuthorizationParams.Add('oauth_signature', $OauthSignature) 105 | 106 | 107 | $AuthorizationString = 'OAuth ' 108 | $AuthorizationParams.GetEnumerator() | sort name | foreach { $AuthorizationString += $_.Key + '="' + [System.Uri]::EscapeDataString($_.Value) + '", ' } 109 | $AuthorizationString = $AuthorizationString.TrimEnd(', ') 110 | Write-Verbose "Using authorization string '$AuthorizationString'" 111 | $AuthorizationString 112 | 113 | } 114 | catch { 115 | Write-Error $_.Exception.Message 116 | } 117 | 118 | } 119 | 120 | } 121 | 122 | 123 | function Invoke-TwitterMediaUpload{ 124 | 125 | <# 126 | .SYNOPSIS 127 | This function uploads a media file to twitter and returns the media file id. 128 | 129 | .PARAMETER ResourceURL 130 | The desired twitter media upload resource url For API 1.1 https://upload.twitter.com/1.1/media/upload.json [REST APIs can be found here: https://dev.twitter.com/rest/public] 131 | 132 | .PARAMETER MediaFilePath 133 | Local path of media 134 | 135 | .PARAMETER OAuthSettings 136 | A hashtable that must contain only the following keys and their values (Generate here: https://dev.twitter.com/oauth) 137 | ApiKey 138 | ApiSecret 139 | AccessToken 140 | AccessTokenSecret 141 | .LINK 142 | This function evolved from the following blog post https://devcentral.f5.com/articles/introducing-poshtwitpic-ndash-use-powershell-to-post-your-images-to-twitter-via-twitpic 143 | #> 144 | [CmdletBinding()] 145 | param ( 146 | [parameter(Mandatory)][System.IO.FileInfo] $MediaFilePath, 147 | [parameter(Mandatory)] [System.URI] $ResourceURL, 148 | [Parameter(Mandatory)]$OAuthSettings 149 | ) 150 | 151 | process{ 152 | 153 | try{ 154 | $Parameters = @{} 155 | $AuthParams = @{} 156 | $AuthParams.Add('HttpEndPoint', $ResourceURL) 157 | $AuthParams.Add('RESTVerb', "POST") 158 | $AuthParams.Add('Params', $Parameters) 159 | $AuthParams.Add('OAuthSettings', $o) 160 | $AuthorizationString = Get-OAuth -AuthorizationParams $AuthParams 161 | $boundary = [System.Guid]::NewGuid().ToString(); 162 | $header = "--{0}" -f $boundary; 163 | $footer = "--{0}--" -f $boundary; 164 | [System.Text.StringBuilder]$contents = New-Object System.Text.StringBuilder 165 | [void]$contents.AppendLine($header); 166 | $bytes = [System.IO.File]::ReadAllBytes($MediaFilePath) 167 | $enc = [System.Text.Encoding]::GetEncoding("iso-8859-1") 168 | $filedata = $enc.GetString($bytes) 169 | $contentTypeMap = @{ 170 | ".jpg" = "image/jpeg"; 171 | ".jpeg" = "image/jpeg"; 172 | ".gif" = "image/gif"; 173 | ".png" = "image/png"; 174 | } 175 | $fileContentType = $contentTypeMap[$MediaFilePath.Extension.ToLower()] 176 | $fileHeader = "Content-Disposition: file; name=""{0}""; filename=""{1}""" -f "media", $file.Name 177 | [void]$contents.AppendLine($fileHeader) 178 | [void]$contents.AppendLine("Content-Type: {0}" -f $fileContentType) 179 | [void]$contents.AppendLine() 180 | [void]$contents.AppendLine($fileData) 181 | [void]$contents.AppendLine($footer) 182 | $z = $contents.ToString() 183 | $response = Invoke-RestMethod -Uri $ResourceURL -Body $z -Method Post -Headers @{ 'Authorization' = $AuthorizationString } -ContentType "multipart/form-data; boundary=`"$boundary`"" 184 | $response.media_id 185 | } 186 | catch [System.Net.WebException] { 187 | Write-Error( "FAILED to reach '$URL': $_" ) 188 | $_ 189 | throw $_ 190 | } 191 | } 192 | } 193 | 194 | 195 | 196 | function Invoke-TwitterRestMethod{ 197 | <# 198 | .SYNOPSIS 199 | This function sends a POST or GET message to the Twitter API and returns the JSON response. 200 | 201 | .PARAMETER ResourceURL 202 | The desired twitter resource url [REST APIs can be found here: https://dev.twitter.com/rest/public] 203 | 204 | .PARAMETER RestVerb 205 | Either 'GET' or 'POST' depending on the resource URL 206 | 207 | .PARAMETER Parameters 208 | A hashtable containing the rest parameters (key value pairs) associated that resource url. Pass empty hash if no paramters needed. 209 | 210 | .PARAMETER OAuthSettings 211 | A hashtable that must contain only the following keys and their values (Generate here: https://dev.twitter.com/oauth) 212 | ApiKey 213 | ApiSecret 214 | AccessToken 215 | AccessTokenSecret 216 | 217 | .EXAMPLE 218 | $OAuth = @{'ApiKey' = 'yourapikey'; 'ApiSecret' = 'yourapisecretkey';'AccessToken' = 'yourapiaccesstoken';'AccessTokenSecret' = 'yourapitokensecret'} 219 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/mentions_timeline.json' -RestVerb 'GET' -Parameters @{} -OAuthSettings $OAuth 220 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/user_timeline.json' -RestVerb 'GET' -Parameters @{'count' = '1'} -OAuthSettings $OAuth 221 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/home_timeline.json' -RestVerb 'GET' -Parameters @{'count' = '1'} -OAuthSettings $OAuth 222 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/retweets_of_me.json' -RestVerb 'GET' -Parameters @{} -OAuthSettings $OAuth 223 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/search/tweets.json' -RestVerb 'GET' -Parameters @{'q'='powershell';'count' = '1'}} -OAuthSettings $OAuth 224 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/account/settings.json' -RestVerb 'POST' -Parameters @{'lang'='tr'} -OAuthSettings $OAuth 225 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/retweets/509457288717819904.json' -RestVerb 'GET' -Parameters @{} -OAuthSettings $OAuth 226 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/show.json' -RestVerb 'GET' -Parameters @{'id'='123'} -OAuthSettings $OAuth 227 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/destroy/240854986559455234.json' -RestVerb 'GET' -Parameters @{} -OAuthSettings $OAuth 228 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/update.json' -RestVerb 'POST' -Parameters @{'status'='@FollowBot'} -OAuthSettings $OAuth 229 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/direct_messages.json' -RestVerb 'GET' -Parameters @{} -OAuthSettings $OAuth 230 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/direct_messages/destroy.json' -RestVerb 'POST' -Parameters @{'id' = '559298305029844992'} -OAuthSettings $OAuth 231 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/direct_messages/new.json' -RestVerb 'POST' -Parameters @{'text' = 'hello, there'; 'screen_name' = 'ruminaterumi' } -OAuthSettings $OAuth 232 | $mediaId = Invoke-TwitterMEdiaUpload -MediaFilePath 'C:\Books\pic.png' -ResourceURL 'https://upload.twitter.com/1.1/media/upload.json' -OAuthSettings $OAuth 233 | Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/statuses/update.json' -RestVerb 'POST' -Parameters @{'status'='FollowBot'; 'media_ids' = $mediaId } -OAuthSettings $OAuth 234 | 235 | #> 236 | [CmdletBinding()] 237 | [OutputType('System.Management.Automation.PSCustomObject')] 238 | Param( 239 | [Parameter(Mandatory)] 240 | [string]$ResourceURL, 241 | [Parameter(Mandatory)] 242 | [string]$RestVerb, 243 | [Parameter(Mandatory)] 244 | $Parameters, 245 | [Parameter(Mandatory)] 246 | $OAuthSettings 247 | 248 | ) 249 | 250 | process{ 251 | try{ 252 | 253 | $AuthParams = @{} 254 | $AuthParams.Add('HttpEndPoint', $ResourceURL) 255 | $AuthParams.Add('RESTVerb', $RestVerb) 256 | $AuthParams.Add('Params', $Parameters) 257 | $AuthParams.Add('OAuthSettings', $OAuthSettings) 258 | $AuthorizationString = Get-OAuth -AuthorizationParams $AuthParams 259 | $HTTPEndpoint= $ResourceURL 260 | if($Parameters.Count -gt 0) 261 | { 262 | $HTTPEndpoint = $HTTPEndpoint + '?' 263 | $Parameters.Keys | % { $HTTPEndpoint = $HTTPEndpoint + $_ +'='+ [System.Net.WebUtility]::UrlEncode($Parameters.Item($_)).Replace('+','%20') + '&'} 264 | $HTTPEndpoint = $HTTPEndpoint.Substring(0,$HTTPEndpoint.Length-1) 265 | 266 | } 267 | Invoke-RestMethod -URI $HTTPEndpoint -Method $RestVerb -Headers @{ 'Authorization' = $AuthorizationString } -ContentType "application/x-www-form-urlencoded" 268 | } 269 | catch{ 270 | Write-Error $_.Exception.Message 271 | } 272 | } 273 | } 274 | 275 | function Invoke-ReadFromTwitterStream{ 276 | <# 277 | .SYNOPSIS 278 | This function can be used to download info from the Twitter Streaming APIs and record the json ouptut in a text file. 279 | 280 | .PARAMETER ResourceURL 281 | The desired twitter resource url [Streaming APIs can be found here: https://dev.twitter.com/streaming/overview] 282 | 283 | .PARAMETER RestVerb 284 | Either 'GET' or 'POST' depending on the resource URL 285 | 286 | .PARAMETER Parameters 287 | A hashtable containing the rest parameters (key value pairs) associated that resource url. Pass empty hash if no paramters needed. 288 | 289 | .PARAMETER OAuthSettings 290 | A hashtable that must contain only the following keys and their values (Generate here: https://dev.twitter.com/oauth) 291 | ApiKey 292 | ApiSecret 293 | AccessToken 294 | AccessTokenSecret 295 | 296 | .PARAMETER MinsToCollectStream 297 | The number of minutes you want to attempt to stream content. Use -1 to run infinte loop. 298 | 299 | .PARAMETER OutFilePath 300 | The location of the out file text. Will create file if dne yet. 301 | 302 | .EXAMPLE 303 | $OAuth = @{'ApiKey' = 'yourapikey'; 'ApiSecret' = 'yourapisecretkey';'AccessToken' = 'yourapiaccesstoken';'AccessTokenSecret' = 'yourapitokensecret'} 304 | Invoke-ReadFromTwitterStream -OAuthSettings $o -OutFilePath 'C:\books\foo.txt' -ResourceURL 'https://stream.twitter.com/1.1/statuses/filter.json' -RestVerb 'POST' -Parameters @{'track' = 'foo'} -MinsToCollectStream 1 305 | 306 | .LINK 307 | This function evolved from the following blog posts http://thoai-nguyen.blogspot.com.tr/2012/03/consume-twitter-stream-oauth-net.html, https://code.google.com/p/pstwitterstream/ 308 | #> 309 | [CmdletBinding()] 310 | Param( 311 | [Parameter(Mandatory)] 312 | $OAuthSettings, 313 | [Parameter(Mandatory)] 314 | [String] $OutFilePath, 315 | [Parameter(Mandatory)] 316 | [string]$ResourceURL, 317 | [Parameter(Mandatory)] 318 | [string]$RestVerb, 319 | [Parameter(Mandatory)] 320 | $Parameters, 321 | [Parameter(Mandatory)] 322 | $MinsToCollectStream 323 | ) 324 | 325 | process{ 326 | $Ti = Get-Date 327 | while($true) 328 | { 329 | $NewD = Get-Date 330 | if(($MinsToCollectStream -ne -1) -and (($NewD-$Ti).Minutes -gt $MinsToCollectStream)) 331 | { return "Finished"} 332 | 333 | try 334 | { 335 | $AuthParams = @{} 336 | $AuthParams.Add('HttpEndPoint', $ResourceURL) 337 | $AuthParams.Add('RESTVerb', $RestVerb) 338 | $AuthParams.Add('Params', $Parameters) 339 | $AuthParams.Add('OAuthSettings', $OAuthSettings) 340 | $AuthorizationString = Get-OAuth -AuthorizationParams $AuthParams 341 | 342 | [System.Net.HttpWebRequest]$Request = [System.Net.WebRequest]::Create($ResourceURL) 343 | $Request.Timeout = [System.Threading.Timeout]::Infinite 344 | $Request.Method = $RestVerb 345 | $Request.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip, [System.Net.DecompressionMethods]::Deflate 346 | $Request.Headers.Add('Authorization', $AuthorizationString) 347 | $Request.Headers.Add('Accept-Encoding', 'deflate,gzip') 348 | $filter = $Null 349 | if($Parameters.Count -gt 0) 350 | { 351 | $Parameters.Keys | % { $filter = $filter + $_ +'='+ [System.Net.WebUtility]::UrlEncode($Parameters.Item($_)).Replace('+','%20') + '&'} 352 | $filter = $filter.Substring(0, $filter.Length-1) 353 | $POSTData = [System.Text.Encoding]::UTF8.GetBytes($filter) 354 | $Request.ContentType = "application/x-www-form-urlencoded" 355 | $Request.ContentLength = $POSTData.Length 356 | $RequestStream = $Request.GetRequestStream() 357 | $RequestStream.Write($POSTData, 0, $POSTData.Length) 358 | $RequestStream.Close() 359 | } 360 | 361 | $Response = [System.Net.HttpWebResponse]$Request.GetResponse() 362 | [System.IO.StreamReader]$ResponseStream = $Response.GetResponseStream() 363 | 364 | while ($true) 365 | { 366 | $NewDt = Get-Date 367 | if(($MinsToCollectStream -ne -1) -and (($NewDt-$Ti).Minutes -gt $MinsToCollectStream)) 368 | { return "Finished"} 369 | 370 | $Line = $ResponseStream.ReadLine() 371 | if($Line -eq '') 372 | { continue } 373 | Add-Content $OutFilePath $Line 374 | $PowerShellRepresentation = $Line | ConvertFrom-Json 375 | $PowerShellRepresentation 376 | If ($ResponseStream.EndOfStream) { Throw "Stream closed." } 377 | } 378 | } 379 | catch{ 380 | Write-Error $_.Exception.Message 381 | } 382 | } 383 | } 384 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PBIX/MyMovies.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevScope/powerbi-powershell-modules/fd5948835454813ae73c98bf78f091e6d56c58ff/Modules/PowerBIPS/Samples/PBIX/MyMovies.pbix -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.OutPowerBI.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $testType = 2 10 | 11 | if ($testType -eq 1) 12 | { 13 | Get-Process | Out-PowerBI -verbose 14 | } 15 | elseif ($testType -eq 2) 16 | { 17 | $data = 1..50 |% { 18 | @{ 19 | Id = $_ 20 | ; Name = "Record $_" 21 | ; Date = [datetime]::Now.ToString("yyyy-MM-dd") 22 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 23 | ; Xpto = (Get-Random -Minimum 10 -Maximum 1000) 24 | } 25 | } 26 | 27 | $data | Out-PowerBI -verbose -types @{"Table.Date" = "datetime"; "Table.DateModified"="datetime"} -dataSetName "TestChangeTable2" -forceTableSchemaUpdate 28 | } 29 | elseif ($testType -eq 3) 30 | { 31 | @{Table1 = (1..50 |% { 32 | @{ 33 | Id = $_ 34 | ; Name = "Record $_" 35 | ; Date = [datetime]::Now.ToString("yyyy-MM-dd") 36 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 37 | } 38 | }) 39 | ; 40 | Table2 = (1..20 |% { 41 | @{ 42 | Id = $_ 43 | ; Category = "Category $_" 44 | ; SubCategory = "SubCategory $_" 45 | ; DateModified = [datetime]::Now.ToString("yyyy-MM-dd HH:mm:ss") 46 | ; AveragePrice = (Get-Random -Minimum 10 -Maximum 1000) 47 | } 48 | })} | Out-PowerBI -multipleTables -verbose -types @{"{Table1.Date" = "datetime"; "Table2.DateModified"="datetime"} -dataSetName "TestChangeTable" -forceTableSchemaUpdate 49 | } 50 | elseif ($testType -eq 4) 51 | { 52 | while($true) 53 | { 54 | # Iterate each CSV file and add to a hashtable with a key for each table that will later be sent to PowerBI 55 | 56 | Get-ChildItem "$currentPath\CSVData" -Filter "*.csv" |% { 57 | 58 | $tableName = $_.BaseName.Split('.')[0] 59 | 60 | $data = Import-Csv $_.FullName 61 | 62 | # Send data to PowerBI 63 | 64 | $data | Out-PowerBI -dataSetName "CSVSales" -tableName "Sales" -types @{"Sales.OrderDate"="datetime"; "Sales.SalesAmount"="double"; "Sales.Freight"="double"} -batchSize 300 -verbose 65 | 66 | # Archive the file 67 | 68 | Move-Item $_.FullName "$currentPath\CSVData\Archive" -Force 69 | } 70 | 71 | Write-Output "Sleeping..." 72 | 73 | Sleep -Seconds 5 74 | } 75 | } 76 | elseif ($testType -eq 5) 77 | { 78 | Import-Module "C:\Users\Romano\Work\GitHub\sql-powershell-modules\Modules\SQLHelper" -Force 79 | 80 | $sqlConnStr = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=AdventureWorksDW2012;Data Source=.\sql2014" 81 | 82 | $query = "select top 100 ProductKey, [EnglishProductName], Color from DimProduct 83 | ; select ProductKey, Sum(SalesAmount) SalesAmount from FactInternetSales group by ProductKey" 84 | 85 | $ds = Invoke-SQLCommand -executeType QueryAsDataSet -connectionString $sqlConnStr -commandText $query 86 | 87 | $ds | Out-PowerBI -dataSetName "SQLDataSet" -verbose 88 | } 89 | 90 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.CSVUpload.ps1: -------------------------------------------------------------------------------- 1 | # Clear the screen 2 | 3 | cls 4 | 5 | # On error stop the script 6 | 7 | $ErrorActionPreference = "Stop" 8 | 9 | # Get the current folder of the running script 10 | 11 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 12 | 13 | # Import the PowerBIPS Powershell Module: https://github.com/DevScope/powerbi-powershell-modules 14 | 15 | Import-Module "$currentPath\Modules\PowerBIPS" -Force 16 | 17 | # Ensure the Archive Folder 18 | 19 | New-Item -Name "Archive" -Force -ItemType directory -Path "$currentPath\CSVData" | Out-Null 20 | 21 | $authToken = Get-PBIAuthToken -ForceAskCredentials 22 | 23 | # Clear "CSVSales" dataset 24 | 25 | Clear-PBITableRows -authToken $authToken -dataSetName "CSVSales" -tableName "Sales" -ErrorAction SilentlyContinue 26 | 27 | while($true) 28 | { 29 | # Iterate each CSV file and send to PowerBI 30 | 31 | Get-ChildItem "$currentPath\Data\CSVData" -Filter "*.csv" |% { 32 | 33 | $file = $_ 34 | 35 | #Import csv and add column with filename 36 | 37 | $data = Import-Csv $file.FullName | select @{Label="File";Expression={$file.Name}}, @{Label="FileDate";Expression={[System.DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss")}}, * 38 | 39 | # Send data to PowerBI 40 | 41 | $data | Out-PowerBI -authToken $authToken -dataSetName "CSVSales" -tableName "Sales" ` 42 | -types @{"Sales.FileDate"="datetime";"Sales.OrderDate"="datetime"; "Sales.SalesAmount"="double"; "Sales.Freight"="double"} ` 43 | -batchSize 25 -ForceTableSchemaUpdate -verbose 44 | 45 | # Archive the file 46 | 47 | Move-Item $file.FullName "$currentPath\Data\CSVData\Archive\" -Force 48 | } 49 | 50 | Write-Output "Sleeping..." 51 | 52 | Sleep -Seconds 5 53 | } 54 | 55 | Write-Output "Script Ended" -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.CopyReport.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken -Verbose 10 | 11 | #Set-PBIGroup -authToken $authToken -id "someID" 12 | 13 | $reports= @( 14 | @{ 15 | originalReportId="2073307d-3bxd-4165-916e-ca0aa2b95ed9" 16 | targetname="Copy of Report 1" 17 | targetWorkspaceId="b8cd99e3-d453-49b9-abd5-b34aef41571c" 18 | targetModelName="Dataset 1" 19 | } 20 | @{ 21 | originalReportName="Report 2" 22 | targetname="Copy of Report 2" 23 | targetWorkspaceName="Workspace 2" 24 | targetModelID="38d98386-31cf-4590-9a75-8701fb17ef16" 25 | } 26 | ) 27 | 28 | $newReportData = Copy-PBIReports -authToken $authToken -reportsObj $reports -Verbose 29 | 30 | $newReportData | Out-GridView -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.DeleteDatasets.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $groupId = "94dc590b-5679-4ad3-bb74-ec1c9d34c273" 12 | 13 | Get-PBIDataSet -groupId $groupId |? name -Like "Sales Dashboard*" | Remove-PBIDataSet -Verbose 14 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.DeleteReports.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $groupId = "94dc590b-5679-4ad3-bb74-ec1c9d34c273" 12 | 13 | Get-PBIDataSet -groupId $groupId |? name -Like "Sales Dashboard*" | Remove-PBIDataSet -Verbose 14 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.DownloadReport.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken 10 | 11 | Set-PBIGroup -authToken $authToken -name "Demos - PBIFromTrenches" -Verbose 12 | 13 | Export-PBIReport -authToken $authToken -destinationFolder "C:\Temp\PBIReports" -reportNames "MyMovies", "Sales Dashboard" -Verbose -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.Get.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $authToken = Get-PBIAuthToken 12 | 13 | Get-PBIGroup $authToken 14 | 15 | Get-PBIDataSet -authToken $authToken -groupId "463a428e-0d9b-42b6-8892-ac0a730fb3ab" 16 | 17 | Get-PBIDataSet -authToken $authToken -groupName "PowerBI-Demos" 18 | 19 | New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -groupName "PowerBI-Demos" 20 | 21 | $group = "PowerBI-Demos" 22 | 23 | # Test the existence of the dataset 24 | 25 | #Get-PBIGroup -authToken $authToken 26 | 27 | #$group = "PowerBI-Demos" 28 | #$dataSetSchema = @{ 29 | # name = "TestDataSet" 30 | # ; tables = @( 31 | # @{ name = "TestTable" 32 | # ; columns = @( 33 | # @{ name = "Id"; dataType = "Int64" } 34 | # , @{ name = "Name"; dataType = "String" } 35 | # , @{ name = "Date"; dataType = "DateTime" } 36 | # , @{ name = "Value"; dataType = "Double" } 37 | # ) 38 | # }) 39 | # } 40 | # 41 | #$createdDataSet = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -groupName $group -Verbose 42 | # 43 | #$createdDataSet 44 | 45 | #$sampleRows = 1..55 |% { 46 | # @{ 47 | # Id = $_ 48 | # ; Name = "Record $_" 49 | # ; Date = [datetime]::Now 50 | # ; Value = (Get-Random -Minimum 10 -Maximum 1000) 51 | # } 52 | #} 53 | # 54 | ## Insert the sample rows in batches of 10 55 | # 56 | #$sampleRows | Add-PBITableRows -authToken $authToken -dataSetId $createdDataSet.id -tableName "TestTable" -batchSize 25 -groupName $group -Verbose 57 | # 58 | 59 | #Clear-PBITableRows -authToken $authToken -dataSetId $createdDataSet.id -tableName "TestTable" -groupName $group 60 | 61 | #Test-PBIDataSet -authToken $authToken -name "Retail Analysis Sample" -groupName "PowerBI-Demos" 62 | 63 | #Get-PBIDataSet -authToken $authToken -groupId "463a428e-0d9b-42b6-8892-ac0a730fb3ab" | Out-GridView 64 | 65 | #Get-PBIDataSet -authToken $authToken -groupName "PowerBI-Demos" | Out-GridView 66 | 67 | 68 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.GetRefreshHistory.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken -ForceAskCredentials -Verbose 10 | 11 | Set-PBIGroup -authToken $authToken -name "Sales" -Verbose 12 | 13 | $hist=Get-PBIDataSetRefreshHistory -authToken $authToken -top 10 -datasetNames "Dataset1" 14 | $hist.value -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.GetReportAndDashboard.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $group = Get-PBIGroup | Select -First 1 12 | 13 | $groupId = $group.id 14 | 15 | $report = Get-PBIReport -groupId $groupId | Select -First 1 16 | 17 | $report 18 | 19 | $dashboard = Get-PBIDashboard | Select -First 1 20 | 21 | $tiles = $dashboard | Get-PBIDashboardTile 22 | 23 | $tiles -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.Groups.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | Set-PBIGroup -name "DemosGroup" 10 | 11 | Get-PBIDataSet | Out-GridView 12 | 13 | Set-PBIGroup -clear 14 | 15 | Get-PBIDataSet | Out-GridView 16 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.ITRealTimeMonitor.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $authToken = Get-PBIAuthToken -Verbose 12 | 13 | # Test the existence of the dataset and if exists retrieve the metadata 14 | $dataSetSchema = Get-PBIDataSet -authToken $authToken -name "IT Server Monitor" -Verbose 15 | 16 | if (-not $dataSetSchema) 17 | { 18 | # If cannot find the DataSet create a new one with this schema 19 | 20 | $dataSetSchema = @{name = "IT Server Monitor" 21 | ; tables = @( 22 | @{name = "Counters" 23 | ; columns = @( 24 | @{ name = "ComputerName"; dataType = "String" } 25 | , @{ name = "TimeStamp"; dataType = "DateTime" } 26 | , @{ name = "CounterSet"; dataType = "String" } 27 | , @{ name = "CounterName"; dataType = "String" } 28 | , @{ name = "CounterValue"; dataType = "Double" } 29 | )} 30 | , 31 | @{name = "CountersResume" 32 | ; columns = @( 33 | @{ name = "ComputerName"; dataType = "String" } 34 | , @{ name = "TimeStamp"; dataType = "DateTime" } 35 | , @{ name = "CPU Time"; dataType = "Double" } 36 | , @{ name = "Free Memory"; dataType = "Double" } 37 | , @{ name = "Disk Time"; dataType = "Double" } 38 | )} 39 | )} 40 | 41 | $dataSetSchema = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -defaultRetentionPolicy "basicFIFO" -Verbose 42 | } 43 | else 44 | { 45 | # If a dataset exists, delete all its data 46 | 47 | Clear-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Counters" -Verbose 48 | Clear-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "CountersResume" -Verbose 49 | } 50 | 51 | $computers = @($env:COMPUTERNAME) 52 | 53 | # Collect data from continuosly in intervals of 5 seconds 54 | 55 | $counters = Get-Counter -ComputerName $computers -ListSet @("processor", "memory", "physicaldisk") 56 | 57 | $counters | Get-Counter -Continuous -SampleInterval 5 |%{ 58 | 59 | # Parse the Counters into the schema of the PowerBI dataset 60 | 61 | $pbiData = $_.CounterSamples | Select @{Name = "ComputerName"; Expression = {$_.Path.Split('\')[2]}} ` 62 | , @{Name="TimeStamp"; Expression = {$_.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss")}} ` 63 | , @{Name="CounterSet"; Expression = {$_.Path.Split('\')[3]}} ` 64 | , @{Name="CounterName"; Expression = {$_.Path.Split('\')[4]}} ` 65 | , @{Name="CounterValue"; Expression = {$_.CookedValue}} 66 | 67 | $pbiData | Add-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "Counters" -batchSize 100 -Verbose 68 | 69 | # Get the Resume Data by Computer 70 | 71 | $pbiResumeData = $pbiData | Group ComputerName |% { 72 | 73 | $cpuCounter = $_.Group |? { $_.CounterSet -eq "Processor(_Total)" -and $_.CounterName -eq "% Processor Time" } 74 | $memoryCounter = $_.Group |? { $_.CounterSet -eq "Memory" -and $_.CounterName -eq "Available MBytes" } 75 | $diskCounter = $_.Group |? { $_.CounterSet -eq "PhysicalDisk(_Total)" -and $_.CounterName -eq "% Disk Time" } 76 | 77 | Write-Output @( 78 | @{"ComputerName" = $_.Name 79 | ; "TimeStamp" = $cpuCounter.TimeStamp 80 | ; "CPU Time" = $cpuCounter.CounterValue 81 | ; "Free Memory" = $memoryCounter.CounterValue 82 | ; "Disk Time" = $diskCounter.CounterValue} 83 | ) 84 | } 85 | 86 | $pbiResumeData | Add-PBITableRows -authToken $authToken -dataSetId $dataSetSchema.Id -tableName "CountersResume" -batchSize 10 -Verbose 87 | 88 | Write-Output "Sleeping..." 89 | } 90 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.ImportPBIX.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken -Verbose 10 | 11 | #Get-PBIDataSet -authToken $authToken | Out-GridView 12 | 13 | $id = Import-PBIFile -authToken $authToken -filePath "$currentPath\PBIX\MyMovies.pbix" -verbose 14 | 15 | $importResult = Get-PBIImports $authToken -importId $id.id 16 | 17 | $importResult | Out-GridView -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.RebindReportDataset.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken 10 | 11 | Set-PBIGroup -authToken $authToken -name "Demos - PBIFromTrenches" -Verbose 12 | 13 | Set-PBIReportsDataset -authToken $authToken -reportNames "MyMovies", "BestMovies" -datasetName "MoviesDataset" -Verbose -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.RefreshDataset.1.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken -ForceAskCredentials -Verbose 10 | 11 | Set-PBIGroup -authToken $authToken -name "Sales" -Verbose 12 | 13 | Update-PBIDataset -authToken $authToken -datasetNames "Dataset1" 14 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.SetParameters.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $authToken = Get-PBIAuthToken -Verbose 10 | 11 | #Set-PBIGroup -authToken $authToken -id "someWorkspaceID" 12 | 13 | $parameters = @( 14 | @{ 15 | name="SomeParameter" 16 | newValue="SomeValue" 17 | } 18 | ) 19 | 20 | Set-PBIDatasetParameters -authToken $authToken -parameters $parameters -datasetNames "SomeDataset" 21 | 22 | $updatedParameters = Get-PBIDatasetParameters -authToken $authToken -datasetNames "SomeDataset" 23 | $updatedParameters | Format-Table -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.Simple.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | 11 | $authToken = Get-PBIAuthToken 12 | 13 | # Test the existence of the dataset 14 | 15 | $dataSetSchema = Get-PBIDataSet -authToken $authToken -name "TestDataSet" 16 | 17 | if (-not $dataSetSchema) 18 | { 19 | # If cannot find the DataSet create a new one with this schema 20 | 21 | $dataSetSchema = @{ 22 | name = "TestDataSet" 23 | ; tables = @( 24 | @{ name = "TestTable" 25 | ; columns = @( 26 | @{ name = "Id"; dataType = "Int64" } 27 | , @{ name = "Name"; dataType = "String" } 28 | , @{ name = "Date"; dataType = "DateTime" } 29 | , @{ name = "Value"; dataType = "Double" } 30 | ) 31 | }) 32 | } 33 | 34 | $createdDataSet = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -Verbose 35 | } 36 | else 37 | { 38 | # Clear all the rows of the dataset table 39 | Clear-PBITableRows -authToken $authToken -dataSetName "TestDataSet" -tableName "TestTable" -Verbose 40 | } 41 | 42 | # Create a array of sample rows with the same schema of the dataset table 43 | 44 | $sampleRows = 1..55 |% { 45 | @{ 46 | Id = $_ 47 | ; Name = "Record $_" 48 | ; Date = [datetime]::Now 49 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 50 | } 51 | } 52 | 53 | # Insert the sample rows in batches of 10 54 | 55 | $sampleRows | Add-PBITableRows -authToken $authToken -dataSetName "TestDataSet" -tableName "TestTable" -batchSize 25 -Verbose -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Sample.UpdateReportContent.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | $sourceReport = Get-PBIReport -name "VanArsdel - Sales - DVS" 10 | 11 | $targetReport = Get-PBIReport -name "Xpto" 12 | 13 | $sourceReport | Set-PBIReportContent -targetReportId $targetReport.id -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.ServicePrincipal.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS.psm1" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | $authToken = Get-PBIAuthToken -clientId "7a7be4f7-c64d-41da-94db-7fb8200f029c" 11 | 12 | $authToken 13 | 14 | $ds = Get-PBIDataSet -authToken $authToken 15 | 16 | $ds -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.TestAuth.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS.psm1" -Force 8 | 9 | # Get the authentication token using ADAL library (OAuth) 10 | $authToken = Get-PBIAuthToken -clientId "7a7be4f7-c64d-41da-94db-7fb8200f029c" 11 | 12 | $authToken 13 | 14 | $ds = Get-PBIDataSet -authToken $authToken 15 | 16 | $ds -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.Tests.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | Import-Module "$currentPath\..\PowerBIPS" -Force 8 | 9 | Set-PBIGroup -id "94dc590b-5679-4ad3-bb74-ec1c9d34c273" 10 | 11 | $authToken = Get-PBIAuthToken 12 | 13 | #Get-ModuleConfig 14 | 15 | #Get-PBIDashboard 16 | 17 | #Get-PBIDashboardTile -dashboardId "283633d6-c905-4e43-9976-e294c0782b82" 18 | 19 | #Get-PBIWorkspace 20 | 21 | #Get-PBIWorkspaceUsers 22 | 23 | #Get-PBIDataset -includeTables 24 | 25 | #Set-PBIModuleConfig -PBIApiUrl "https://api.powerbi.com/beta/myorg" 26 | 27 | #Get-PBIDatasetTables -dataSetId "42624495-02b7-4698-ad6a-7eb838ec0d41" -Verbose 28 | 29 | <# $dataSetSchema = @{ 30 | name = "TestDataSet" 31 | ; tables = @( 32 | @{ name = "TestTable" 33 | ; columns = @( 34 | @{ name = "Id"; dataType = "Int64" } 35 | , @{ name = "Name"; dataType = "String" } 36 | , @{ name = "Date"; dataType = "DateTime" } 37 | , @{ name = "Value"; dataType = "Double" } 38 | ) 39 | }) 40 | } 41 | 42 | $createdDataSet = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -Verbose #> 43 | 44 | <# 45 | $table = @{ name = "TestTable" 46 | ; columns = @( 47 | @{ name = "Id"; dataType = "Int64" } 48 | , @{ name = "Name"; dataType = "String" } 49 | , @{ name = "Date"; dataType = "DateTime" } 50 | , @{ name = "Value"; dataType = "Double" } 51 | , @{ name = "Value2"; dataType = "Double" } 52 | ) 53 | } 54 | $createdDataSet = Update-PBITableSchema -authToken $authToken -dataSetId "42624495-02b7-4698-ad6a-7eb838ec0d41" -table $table -Verbose 55 | #> 56 | 57 | <# 58 | 59 | $sampleRows = 1..55 |% { 60 | @{ 61 | Id = $_ 62 | ; Name = "Record $_" 63 | ; Date = [datetime]::Now 64 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 65 | } 66 | } 67 | 68 | # Insert the sample rows in batches of 10 69 | 70 | $sampleRows | Add-PBITableRows -authToken $authToken -dataSetName "TestDataSet" -tableName "TestTable" -batchSize 25 -Verbose 71 | #> 72 | 73 | 74 | #Clear-PBITableRows -dataSetName "TestDataSet" -tableName "TestTable" 75 | 76 | <# 77 | $data = 1..50 |% { 78 | @{ 79 | Id = $_ 80 | ; Name = "Record $_" 81 | ; Date = [datetime]::Now.ToString("yyyy-MM-dd") 82 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 83 | ; Xpto = (Get-Random -Minimum 10 -Maximum 1000) 84 | } 85 | } 86 | 87 | $data | Out-PowerBI -verbose -types @{"Table.Date" = "datetime"; "Table.DateModified"="datetime"} -dataSetName "TestChangeTable2" -forceTableSchemaUpdate 88 | #> 89 | 90 | 91 | #Get-PBIImports -importId "9a347dc4-e667-42db-9a0a-854cf451faa7" 92 | 93 | # Import-PBIFile -filePath "$currentPath\PBIX\MyMovies.pbix" 94 | 95 | # Export-PBIReport -destinationFolder "$currentPath\OutputPBIX" -Verbose 96 | 97 | 98 | <#Copy-PBIReports -reportsObj @( 99 | @{ 100 | originalReportName = "Quotes" 101 | targetName = "Quotes" 102 | targetWorkspaceName = "Demos - Power BI Tips & Tricks (Session)" 103 | targetModelName = "Manager Data Model" 104 | } 105 | ) -Verbose #> 106 | 107 | #Update-PBIDataset -datasetIds @("e75b4f03-0bd1-45d7-8579-ee5309ca231c") -Verbose 108 | 109 | #Get-PBIDatasetRefreshHistory -datasetIds @("e75b4f03-0bd1-45d7-8579-ee5309ca231c") -Verbose 110 | 111 | #Get-PBIDatasetParameters -datasetIds @("164af183-2454-4f45-964a-c200f51bcd59") -Verbose 112 | 113 | <# 114 | Set-PBIDatasetParameters -datasetIds @("164af183-2454-4f45-964a-c200f51bcd59") @( 115 | @{ 116 | name="ParameterName" 117 | newValue="NewParameterValue" 118 | } 119 | ) 120 | #> 121 | 122 | #New-PBIWorkspace -name "PowerBIPS-Test" 123 | 124 | #New-PBIWorkspaceUser -groupId "98b9cd9d-ab12-419f-9f7e-a3a5397eb3bd" -emailAddress "joana.barbosa@devscope.net" 125 | 126 | #Invoke-PBIRequest -resource "reports" -method "Get" 127 | 128 | #Invoke-PBIRequest -resource "datasets" -method "Get" 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/Samples/PowerBIPS.TwitterRealTime.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | 3 | $ErrorActionPreference = "Stop" 4 | 5 | $currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent) 6 | 7 | # Import the PowerBIPS Powershell Module: https://github.com/DevScope/powerbi-powershell-modules 8 | Import-Module "$currentPath\..\PowerBIPS" -Force 9 | 10 | # Import the InvokeTwitterAPIs module: https://github.com/MeshkDevs/InvokeTwitterAPIs 11 | Import-Module "$currentPath\Modules\InvokeTwitterAPIs.psm1" -Force 12 | 13 | #region Twitter Settings 14 | 15 | # Learn how to generate these keys at: https://dev.twitter.com/oauth and https://apps.twitter.com 16 | $accessToken = "your access token key" 17 | $accessTokenSecret = "your access token secret" 18 | $apiKey = "your api key" 19 | $apiSecret = "your api secret" 20 | 21 | $twitterOAuth = @{'ApiKey' = $apiKey; 'ApiSecret' = $apiSecret; 'AccessToken' = $accessToken; 'AccessTokenSecret' = $accessTokenSecret} 22 | 23 | #endregion 24 | 25 | $sinceId = $null 26 | $sinceIdFilePath = "$currentPath\twitterDemoSinceId.txt" 27 | 28 | while($true) 29 | { 30 | if (Test-Path $sinceIdFilePath) 31 | { 32 | $sinceId = Get-Content $sinceIdFilePath 33 | } 34 | 35 | # Hashtags to search (separated by comma) and the number of tweets to return, more examples of search options: https://dev.twitter.com/rest/public/search 36 | 37 | $twitterAPIParams = @{'q'='#powerbi';'count' = '5'} 38 | 39 | if (-not [string]::IsNullOrEmpty($sinceId)) 40 | { 41 | $twitterAPIParams.Add("since_id", $sinceId) 42 | } 43 | 44 | # Ger Twitter Data (if SinceId is not Null it will get tweets since that one) 45 | 46 | $result = Invoke-TwitterRestMethod -ResourceURL 'https://api.twitter.com/1.1/search/tweets.json' -RestVerb 'GET' -Parameters $twitterAPIParams -OAuthSettings $twitterOAuth -Verbose 47 | 48 | # Parse the Twitter API data 49 | 50 | $twitterData = $result.statuses |? { [string]::IsNullOrEmpty($sinceId) -or $sinceId -ne $_.id_str } |% { 51 | 52 | $aux = @{ 53 | Id = $_.id_str 54 | ; UserId = $_.user.id 55 | ; UserName = $_.user.name 56 | ; UserScreenName = $_.user.screen_name 57 | ; UserLocation = $_.user.location 58 | ; Text = $_.text 59 | ; CreatedAt = [System.DateTime]::ParseExact($_.created_at, "ddd MMM dd HH:mm:ss zzz yyyy", [System.Globalization.CultureInfo]::InvariantCulture) 60 | } 61 | 62 | # Get the Sentiment Score 63 | 64 | $textEncoded = [System.Web.HttpUtility]::UrlEncode($aux.Text, [System.Text.Encoding]::UTF8) 65 | 66 | $sentimentResult = Invoke-RestMethod -Uri "http://www.sentiment140.com/api/classify?text=$textEncoded" -Method Get -Verbose 67 | 68 | switch($sentimentResult.results[0].polarity) 69 | { 70 | "0" { $aux.Add("Sentiment", "Negative") } 71 | "4" { $aux.Add("Sentiment", "Positive") } 72 | default { $aux.Add("Sentiment", "Neutral") } 73 | } 74 | 75 | Write-Output $aux 76 | } 77 | 78 | if ($twitterData -and $twitterData.Count -ne 0) 79 | { 80 | # Persist the SinceId 81 | 82 | $sinceId = ($twitterData | Sort-Object "CreatedAt" -Descending | Select -First 1).Id 83 | 84 | Set-Content -Path $sinceIdFilePath -Value $sinceId 85 | 86 | # Send the data to PowerBI 87 | 88 | $twitterData | Out-PowerBI -dataSetName "TwitterPBIAnalysis" -tableName "Tweets" -types @{"Tweets.CreatedAt"="datetime"} -verbose 89 | } 90 | else 91 | { 92 | Write-Output "No tweets found." 93 | } 94 | 95 | Write-Output "Sleeping..." 96 | 97 | Sleep -Seconds 30 98 | } -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Add-PBITableRows.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Add-PBITableRows 9 | 10 | ## SYNOPSIS 11 | Add's a collection of rows into a powerbi dataset table in batches 12 | 13 | ## SYNTAX 14 | 15 | ### dataSetId 16 | ``` 17 | Add-PBITableRows [-authToken ] -dataSetId -tableName -rows 18 | [-batchSize ] [-groupId ] [] 19 | ``` 20 | 21 | ### dataSetName 22 | ``` 23 | Add-PBITableRows [-authToken ] -dataSetName -tableName -rows 24 | [-batchSize ] [-groupId ] [] 25 | ``` 26 | 27 | ## DESCRIPTION 28 | Add's a collection of rows into a powerbi dataset table in batches 29 | 30 | ## EXAMPLES 31 | 32 | ### EXAMPLE 1 33 | ``` 34 | Add-PBITableRows -authToken $auth -dataSetId $dataSetId -tableName "Product" -rows $data -batchSize 10 35 | ``` 36 | 37 | ### EXAMPLE 2 38 | ``` 39 | 1..53 |% { @{id = $_; name = "Product $_"}} | Add-PBITableRows -authToken $auth -dataSetId $dataSetId -tableName "Product" -batchSize 10 40 | ``` 41 | 42 | 53 records are uploaded to PowerBI "Product" table in batches of 10 rows. 43 | 44 | ## PARAMETERS 45 | 46 | ### -authToken 47 | The authorization token required to comunicate with the PowerBI APIs 48 | Use 'Get-PBIAuthToken' to get the authorization token string 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -dataSetId 63 | The id of the dataset in PowerBI 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: dataSetId 68 | Aliases: 69 | 70 | Required: True 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -dataSetName 78 | {{Fill dataSetName Description}} 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: dataSetName 83 | Aliases: 84 | 85 | Required: True 86 | Position: Named 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -tableName 93 | The name of the table of the dataset 94 | 95 | ```yaml 96 | Type: String 97 | Parameter Sets: (All) 98 | Aliases: 99 | 100 | Required: True 101 | Position: Named 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -rows 108 | The collection of rows to insert to the table. 109 | This parameter can have it's value from the pipeline 110 | 111 | ```yaml 112 | Type: Object 113 | Parameter Sets: (All) 114 | Aliases: 115 | 116 | Required: True 117 | Position: Named 118 | Default value: None 119 | Accept pipeline input: True (ByValue) 120 | Accept wildcard characters: False 121 | ``` 122 | 123 | ### -batchSize 124 | The size of the batch that is sent to PowerBI as HttpPost. 125 | 126 | If for example the batch size is 100 and a collection of 127 | 1000 rows are being pushed then this cmdlet will make 10 128 | HttpPosts 129 | 130 | ```yaml 131 | Type: Int32 132 | Parameter Sets: (All) 133 | Aliases: 134 | 135 | Required: False 136 | Position: Named 137 | Default value: 1000 138 | Accept pipeline input: False 139 | Accept wildcard characters: False 140 | ``` 141 | 142 | ### -groupId 143 | Id of the workspace where the reports will get pulled 144 | 145 | ```yaml 146 | Type: String 147 | Parameter Sets: (All) 148 | Aliases: 149 | 150 | Required: False 151 | Position: Named 152 | Default value: None 153 | Accept pipeline input: False 154 | Accept wildcard characters: False 155 | ``` 156 | 157 | ### CommonParameters 158 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 159 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 160 | 161 | ## INPUTS 162 | 163 | ## OUTPUTS 164 | 165 | ## NOTES 166 | 167 | ## RELATED LINKS 168 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Clear-PBITableRows.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Clear-PBITableRows 9 | 10 | ## SYNOPSIS 11 | Delete all the rows of a PowerBI dataset table 12 | 13 | ## SYNTAX 14 | 15 | ### dataSetId 16 | ``` 17 | Clear-PBITableRows [-authToken ] -dataSetId -tableName [-groupId ] 18 | [] 19 | ``` 20 | 21 | ### dataSetName 22 | ``` 23 | Clear-PBITableRows [-authToken ] -dataSetName -tableName [-groupId ] 24 | [] 25 | ``` 26 | 27 | ## DESCRIPTION 28 | Delete all the rows of a PowerBI dataset table 29 | 30 | ## EXAMPLES 31 | 32 | ### EXAMPLE 1 33 | ``` 34 | Clear-PBITableRows -authToken "authToken" -DataSetId "DataSetId" -TableName "Table" 35 | ``` 36 | 37 | ## PARAMETERS 38 | 39 | ### -authToken 40 | The authorization token required to comunicate with the PowerBI APIs 41 | Use 'Get-PBIAuthToken' to get the authorization token string 42 | 43 | ```yaml 44 | Type: String 45 | Parameter Sets: (All) 46 | Aliases: 47 | 48 | Required: False 49 | Position: Named 50 | Default value: None 51 | Accept pipeline input: False 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### -dataSetId 56 | The id of the dataset in PowerBI 57 | 58 | ```yaml 59 | Type: String 60 | Parameter Sets: dataSetId 61 | Aliases: 62 | 63 | Required: True 64 | Position: Named 65 | Default value: None 66 | Accept pipeline input: False 67 | Accept wildcard characters: False 68 | ``` 69 | 70 | ### -dataSetName 71 | {{Fill dataSetName Description}} 72 | 73 | ```yaml 74 | Type: String 75 | Parameter Sets: dataSetName 76 | Aliases: 77 | 78 | Required: True 79 | Position: Named 80 | Default value: None 81 | Accept pipeline input: False 82 | Accept wildcard characters: False 83 | ``` 84 | 85 | ### -tableName 86 | The name of the table of the dataset 87 | 88 | ```yaml 89 | Type: String 90 | Parameter Sets: (All) 91 | Aliases: 92 | 93 | Required: True 94 | Position: Named 95 | Default value: None 96 | Accept pipeline input: False 97 | Accept wildcard characters: False 98 | ``` 99 | 100 | ### -groupId 101 | Id of the workspace where the reports will get pulled 102 | 103 | ```yaml 104 | Type: String 105 | Parameter Sets: (All) 106 | Aliases: 107 | 108 | Required: False 109 | Position: Named 110 | Default value: None 111 | Accept pipeline input: False 112 | Accept wildcard characters: False 113 | ``` 114 | 115 | ### CommonParameters 116 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 117 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 118 | 119 | ## INPUTS 120 | 121 | ## OUTPUTS 122 | 123 | ## NOTES 124 | 125 | ## RELATED LINKS 126 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Copy-PBIReports.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Copy-PBIReports 9 | 10 | ## SYNOPSIS 11 | Duplicate reports by suppling a list of the reports to copy. 12 | Returns an object containing the new reports' metadata. 13 | 14 | ## SYNTAX 15 | 16 | ``` 17 | Copy-PBIReports [-authToken ] -report [-targetName ] [-targetWorkspaceId ] 18 | [-targetModelId ] [-groupId ] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | {{Fill in the Description}} 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Get-PBIReport | Copy-PBIReport -authToken $authToken -targetWorkspaceId GUID -targetDataSetId GUID 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | The authorization token required to comunicate with the PowerBI APIs 35 | Use 'Get-PBIAuthToken' to get the authorization token string 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: False 43 | Position: Named 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -report 50 | The PBI Report Object or Report Id (GUID) 51 | 52 | ```yaml 53 | Type: Object 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: Named 59 | Default value: None 60 | Accept pipeline input: True (ByValue) 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -targetName 65 | Name of the report in the target workspace 66 | 67 | ```yaml 68 | Type: String 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: Named 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -targetWorkspaceId 80 | Target workspace id (GUID) 81 | 82 | ```yaml 83 | Type: String 84 | Parameter Sets: (All) 85 | Aliases: 86 | 87 | Required: False 88 | Position: Named 89 | Default value: None 90 | Accept pipeline input: False 91 | Accept wildcard characters: False 92 | ``` 93 | 94 | ### -targetModelId 95 | Target dataset id (GUID) 96 | 97 | ```yaml 98 | Type: String 99 | Parameter Sets: (All) 100 | Aliases: 101 | 102 | Required: False 103 | Position: Named 104 | Default value: None 105 | Accept pipeline input: False 106 | Accept wildcard characters: False 107 | ``` 108 | 109 | ### -groupId 110 | {{Fill groupId Description}} 111 | 112 | ```yaml 113 | Type: String 114 | Parameter Sets: (All) 115 | Aliases: 116 | 117 | Required: False 118 | Position: Named 119 | Default value: None 120 | Accept pipeline input: False 121 | Accept wildcard characters: False 122 | ``` 123 | 124 | ### CommonParameters 125 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 126 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 127 | 128 | ## INPUTS 129 | 130 | ## OUTPUTS 131 | 132 | ## NOTES 133 | 134 | ## RELATED LINKS 135 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Export-PBIReport.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-PBIReport 9 | 10 | ## SYNOPSIS 11 | Download reports as PBIX files to the specified folder. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-PBIReport [[-authToken] ] [-report] [[-destinationFolder] ] 17 | [[-timeout] ] [[-groupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-Report -name "SampleReport" | Export-PBIReport 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | # Get's all reports from current workspace and saves them on the destination folder 33 | ``` 34 | 35 | Get-PBIReport | Export-PBIReport -destinationFolder ".\OutputFolder" 36 | 37 | ### EXAMPLE 3 38 | ``` 39 | Export-PBIReport -report {ReportGUID} 40 | ``` 41 | 42 | ## PARAMETERS 43 | 44 | ### -authToken 45 | The authorization token required to comunicate with the PowerBI APIs 46 | Use 'Get-PBIAuthToken' to get the authorization token string 47 | 48 | ```yaml 49 | Type: String 50 | Parameter Sets: (All) 51 | Aliases: 52 | 53 | Required: False 54 | Position: 1 55 | Default value: None 56 | Accept pipeline input: False 57 | Accept wildcard characters: False 58 | ``` 59 | 60 | ### -report 61 | The PBI Report Object or Report Id (GUID) 62 | 63 | ```yaml 64 | Type: Object 65 | Parameter Sets: (All) 66 | Aliases: 67 | 68 | Required: True 69 | Position: 2 70 | Default value: None 71 | Accept pipeline input: True (ByValue) 72 | Accept wildcard characters: False 73 | ``` 74 | 75 | ### -destinationFolder 76 | A string with the path to the destination folder 77 | 78 | ```yaml 79 | Type: String 80 | Parameter Sets: (All) 81 | Aliases: 82 | 83 | Required: False 84 | Position: 3 85 | Default value: . 86 | Accept pipeline input: False 87 | Accept wildcard characters: False 88 | ``` 89 | 90 | ### -timeout 91 | Timeout seconds for the export HTTP request 92 | 93 | ```yaml 94 | Type: Int32 95 | Parameter Sets: (All) 96 | Aliases: 97 | 98 | Required: False 99 | Position: 4 100 | Default value: 300 101 | Accept pipeline input: False 102 | Accept wildcard characters: False 103 | ``` 104 | 105 | ### -groupId 106 | {{Fill groupId Description}} 107 | 108 | ```yaml 109 | Type: String 110 | Parameter Sets: (All) 111 | Aliases: 112 | 113 | Required: False 114 | Position: 5 115 | Default value: None 116 | Accept pipeline input: False 117 | Accept wildcard characters: False 118 | ``` 119 | 120 | ### CommonParameters 121 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 122 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 123 | 124 | ## INPUTS 125 | 126 | ## OUTPUTS 127 | 128 | ## NOTES 129 | 130 | ## RELATED LINKS 131 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIAuthToken.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIAuthToken 9 | 10 | ## SYNOPSIS 11 | Gets the authentication token required to comunicate with the PowerBI API's 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIAuthToken [[-credential] ] [-forceAskCredentials] [[-clientId] ] 17 | [[-redirectUri] ] [[-tenantId] ] [[-clientSecret] ] [-returnADALObj] 18 | [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | To authenticate with PowerBI uses OAuth 2.0 with the Azure AD Authentication Library (ADAL) 23 | 24 | If a credential is not supplied a popup will appear for the user to authenticate. 25 | 26 | It will automatically download and install the required nuget: "Microsoft.IdentityModel.Clients.ActiveDirectory". 27 | 28 | ## EXAMPLES 29 | 30 | ### EXAMPLE 1 31 | ``` 32 | Get-PBIAuthToken -clientId "C0E8435C-614D-49BF-A758-3EF858F8901B" 33 | ``` 34 | 35 | ### EXAMPLE 2 36 | ``` 37 | Get-PBIAuthToken -ClientId "C0E8435C-614D-49BF-A758-3EF858F8901B" -Credential (Get-Credential) 38 | ``` 39 | 40 | ### EXAMPLE 3 41 | ``` 42 | Get-PBIAuthToken -ClientId "C0E8435C-614D-49BF-A758-3EF858F8901B" -tenantId "company.onmicrosoft.com" -clientSecret "Azure AD APP Secret" 43 | ``` 44 | 45 | ## PARAMETERS 46 | 47 | ### -credential 48 | Specifies a PSCredential object or a string username used to authenticate to PowerBI. 49 | If only a username is specified 50 | this will prompt for the password. 51 | Note that this will not work with federated users. 52 | 53 | ```yaml 54 | Type: Object 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: False 59 | Position: 1 60 | Default value: None 61 | Accept pipeline input: False 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### -forceAskCredentials 66 | Forces the authentication popup to always ask for the username and password 67 | 68 | ```yaml 69 | Type: SwitchParameter 70 | Parameter Sets: (All) 71 | Aliases: 72 | 73 | Required: False 74 | Position: Named 75 | Default value: False 76 | Accept pipeline input: False 77 | Accept wildcard characters: False 78 | ``` 79 | 80 | ### -clientId 81 | The Client Id of the Azure AD application 82 | 83 | ```yaml 84 | Type: String 85 | Parameter Sets: (All) 86 | Aliases: 87 | 88 | Required: False 89 | Position: 2 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -redirectUri 96 | The redirect URI associated with the native client application 97 | 98 | ```yaml 99 | Type: String 100 | Parameter Sets: (All) 101 | Aliases: 102 | 103 | Required: False 104 | Position: 3 105 | Default value: None 106 | Accept pipeline input: False 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### -tenantId 111 | The Azure AD Tenant Id, optional and only needed if you are using the App Authentication Flow 112 | 113 | ```yaml 114 | Type: String 115 | Parameter Sets: (All) 116 | Aliases: 117 | 118 | Required: False 119 | Position: 4 120 | Default value: None 121 | Accept pipeline input: False 122 | Accept wildcard characters: False 123 | ``` 124 | 125 | ### -clientSecret 126 | The Azure AD client secret, optional and only needed it the ClientId is a Azure AD WebApp type 127 | 128 | ```yaml 129 | Type: String 130 | Parameter Sets: (All) 131 | Aliases: 132 | 133 | Required: False 134 | Position: 5 135 | Default value: None 136 | Accept pipeline input: False 137 | Accept wildcard characters: False 138 | ``` 139 | 140 | ### -returnADALObj 141 | {{Fill returnADALObj Description}} 142 | 143 | ```yaml 144 | Type: SwitchParameter 145 | Parameter Sets: (All) 146 | Aliases: 147 | 148 | Required: False 149 | Position: Named 150 | Default value: False 151 | Accept pipeline input: False 152 | Accept wildcard characters: False 153 | ``` 154 | 155 | ### CommonParameters 156 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 157 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 158 | 159 | ## INPUTS 160 | 161 | ## OUTPUTS 162 | 163 | ### System.String 164 | 165 | ## NOTES 166 | 167 | ## RELATED LINKS 168 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIAuthTokenHttp.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIAuthTokenHttp 9 | 10 | ## SYNOPSIS 11 | Gets the authentication token required to comunicate with the PowerBI API's 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIAuthTokenHttp [-tenantId] [-clientId] [[-clientSecret] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Gets the authentication token required to comunicate with the PowerBI API's 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -tenantId 34 | {{Fill tenantId Description}} 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -clientId 49 | {{Fill clientId Description}} 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: True 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -clientSecret 64 | {{Fill clientSecret Description}} 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 80 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 81 | 82 | ## INPUTS 83 | 84 | ## OUTPUTS 85 | 86 | ### System.String 87 | 88 | ## NOTES 89 | 90 | ## RELATED LINKS 91 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDashboard.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDashboard 9 | 10 | ## SYNOPSIS 11 | Gets all the PowerBI existing dashboards and returns as an array of custom objects. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDashboard [[-authToken] ] [[-name] ] [[-id] ] [[-groupId] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Gets all the PowerBI existing dashboards and returns as an array of custom objects. 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIDashboard -authToken $authToken 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -authToken 33 | The authorization token required to communicate with the PowerBI APIs 34 | Use 'Get-PBIAuthToken' to get the authorization token string 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -name 49 | The name of the dashboard 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -id 64 | The id of the dashboard 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -groupId 79 | Id of the workspace where the reports will get pulled 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### CommonParameters 94 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 95 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 96 | 97 | ## INPUTS 98 | 99 | ## OUTPUTS 100 | 101 | ## NOTES 102 | 103 | ## RELATED LINKS 104 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDashboardTile.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDashboardTile 9 | 10 | ## SYNOPSIS 11 | Gets all the tiles for a specific dashboard. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDashboardTile [[-authToken] ] [-dashboard] [[-tileId] ] [[-groupId] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Gets all the tiles for a specific dashboard. 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIDashboardTile -dashboard "XXXX-XXXX-XXXX" 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | Get-PBIDashboard -id "GUID" | Get-PBIDashboardTile 33 | ``` 34 | 35 | ## PARAMETERS 36 | 37 | ### -authToken 38 | The authorization token required to communicate with the PowerBI APIs 39 | Use 'Get-PBIAuthToken' to get the authorization token string 40 | 41 | ```yaml 42 | Type: String 43 | Parameter Sets: (All) 44 | Aliases: 45 | 46 | Required: False 47 | Position: 1 48 | Default value: None 49 | Accept pipeline input: False 50 | Accept wildcard characters: False 51 | ``` 52 | 53 | ### -dashboard 54 | {{Fill dashboard Description}} 55 | 56 | ```yaml 57 | Type: Object 58 | Parameter Sets: (All) 59 | Aliases: 60 | 61 | Required: True 62 | Position: 2 63 | Default value: None 64 | Accept pipeline input: True (ByValue) 65 | Accept wildcard characters: False 66 | ``` 67 | 68 | ### -tileId 69 | The id of the tile 70 | 71 | ```yaml 72 | Type: String 73 | Parameter Sets: (All) 74 | Aliases: 75 | 76 | Required: False 77 | Position: 3 78 | Default value: None 79 | Accept pipeline input: False 80 | Accept wildcard characters: False 81 | ``` 82 | 83 | ### -groupId 84 | Id of the workspace where the reports will get pulled 85 | 86 | ```yaml 87 | Type: String 88 | Parameter Sets: (All) 89 | Aliases: 90 | 91 | Required: False 92 | Position: 4 93 | Default value: None 94 | Accept pipeline input: False 95 | Accept wildcard characters: False 96 | ``` 97 | 98 | ### CommonParameters 99 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 100 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 101 | 102 | ## INPUTS 103 | 104 | ## OUTPUTS 105 | 106 | ## NOTES 107 | 108 | ## RELATED LINKS 109 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDataSet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDataSet 9 | 10 | ## SYNOPSIS 11 | Gets all the PowerBI existing datasets and returns as an array of custom objects. 12 | Or 13 | Check if a dataset exists with the specified name and if exists returns it's metadata 14 | 15 | ## SYNTAX 16 | 17 | ``` 18 | Get-PBIDataSet [[-authToken] ] [[-name] ] [[-id] ] [-includeDefinition] 19 | [-includeTables] [[-groupId] ] [-admin] [] 20 | ``` 21 | 22 | ## DESCRIPTION 23 | Gets all the PowerBI existing datasets and returns as an array of custom objects. 24 | Or 25 | Check if a dataset exists with the specified name and if exists returns it's metadata 26 | 27 | ## EXAMPLES 28 | 29 | ### EXAMPLE 1 30 | ``` 31 | Get-PBIDataSet -authToken $authToken 32 | ``` 33 | 34 | Get-PBIDataSet -authToken $authToken -name "DataSetName" 35 | Get-PBIDataSet -authToken $authToken -name "DataSetName" -includeDefinition -includeTables 36 | 37 | ## PARAMETERS 38 | 39 | ### -authToken 40 | The authorization token required to communicate with the PowerBI APIs 41 | Use 'Get-PBIAuthToken' to get the authorization token string 42 | 43 | ```yaml 44 | Type: String 45 | Parameter Sets: (All) 46 | Aliases: 47 | 48 | Required: False 49 | Position: 1 50 | Default value: None 51 | Accept pipeline input: False 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### -name 56 | The dataset name 57 | 58 | ```yaml 59 | Type: String 60 | Parameter Sets: (All) 61 | Aliases: 62 | 63 | Required: False 64 | Position: 2 65 | Default value: None 66 | Accept pipeline input: False 67 | Accept wildcard characters: False 68 | ``` 69 | 70 | ### -id 71 | The dataset id 72 | 73 | ```yaml 74 | Type: String 75 | Parameter Sets: (All) 76 | Aliases: 77 | 78 | Required: False 79 | Position: 3 80 | Default value: None 81 | Accept pipeline input: False 82 | Accept wildcard characters: False 83 | ``` 84 | 85 | ### -includeDefinition 86 | If specified will include the dataset definition properties 87 | 88 | ```yaml 89 | Type: SwitchParameter 90 | Parameter Sets: (All) 91 | Aliases: 92 | 93 | Required: False 94 | Position: Named 95 | Default value: False 96 | Accept pipeline input: False 97 | Accept wildcard characters: False 98 | ``` 99 | 100 | ### -includeTables 101 | If specified will include the dataset tables 102 | 103 | ```yaml 104 | Type: SwitchParameter 105 | Parameter Sets: (All) 106 | Aliases: 107 | 108 | Required: False 109 | Position: Named 110 | Default value: False 111 | Accept pipeline input: False 112 | Accept wildcard characters: False 113 | ``` 114 | 115 | ### -groupId 116 | Id of the workspace where the reports will get pulled 117 | 118 | ```yaml 119 | Type: String 120 | Parameter Sets: (All) 121 | Aliases: 122 | 123 | Required: False 124 | Position: 4 125 | Default value: None 126 | Accept pipeline input: False 127 | Accept wildcard characters: False 128 | ``` 129 | 130 | ### -admin 131 | {{Fill admin Description}} 132 | 133 | ```yaml 134 | Type: SwitchParameter 135 | Parameter Sets: (All) 136 | Aliases: 137 | 138 | Required: False 139 | Position: Named 140 | Default value: False 141 | Accept pipeline input: False 142 | Accept wildcard characters: False 143 | ``` 144 | 145 | ### CommonParameters 146 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 147 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 148 | 149 | ## INPUTS 150 | 151 | ## OUTPUTS 152 | 153 | ## NOTES 154 | 155 | ## RELATED LINKS 156 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDataSetTables.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDataSetTables 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDataSetTables [[-authToken] ] [-dataSetId] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | {{Fill authToken Description}} 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 0 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -dataSetId 49 | {{Fill dataSetId Description}} 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: True 57 | Position: 1 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -groupId 64 | {{Fill groupId Description}} 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 2 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 80 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 81 | 82 | ## INPUTS 83 | 84 | ### None 85 | 86 | 87 | ## OUTPUTS 88 | 89 | ### System.Object 90 | 91 | ## NOTES 92 | 93 | ## RELATED LINKS 94 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDatasetParameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDatasetParameters 9 | 10 | ## SYNOPSIS 11 | Gets all parameters available in one or more datasets. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDatasetParameters [[-authToken] ] [-dataset] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-PBIDatasetParametersy -dataset "GUID" 27 | ``` 28 | 29 | ### EXAMPLE 2 30 | ``` 31 | Get-PBIDataSet -name "Dataset name" | Get-PBIDatasetParameters 32 | ``` 33 | 34 | ## PARAMETERS 35 | 36 | ### -authToken 37 | The authorization token required to comunicate with the PowerBI APIs 38 | Use 'Get-PBIAuthToken' to get the authorization token string 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: None 48 | Accept pipeline input: False 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### -dataset 53 | {{Fill dataset Description}} 54 | 55 | ```yaml 56 | Type: Object 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: True 61 | Position: 2 62 | Default value: None 63 | Accept pipeline input: True (ByValue) 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -groupId 68 | {{Fill groupId Description}} 69 | 70 | ```yaml 71 | Type: String 72 | Parameter Sets: (All) 73 | Aliases: 74 | 75 | Required: False 76 | Position: 3 77 | Default value: None 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### CommonParameters 83 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 84 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 85 | 86 | ## INPUTS 87 | 88 | ## OUTPUTS 89 | 90 | ## NOTES 91 | 92 | ## RELATED LINKS 93 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDatasetRefreshHistory.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDatasetRefreshHistory 9 | 10 | ## SYNOPSIS 11 | Get refresh history of one or more datasets 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDatasetRefreshHistory [[-authToken] ] [-dataset] [[-top] ] [[-groupId] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIDatasetRefreshHistory -dataset "GUID" 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | Get-PBIDataSet -name "Dataset name" | Get-PBIDatasetRefreshHistory 33 | ``` 34 | 35 | ## PARAMETERS 36 | 37 | ### -authToken 38 | The authorization token required to comunicate with the PowerBI APIs 39 | Use 'Get-PBIAuthToken' to get the authorization token string 40 | 41 | ```yaml 42 | Type: String 43 | Parameter Sets: (All) 44 | Aliases: 45 | 46 | Required: False 47 | Position: 1 48 | Default value: None 49 | Accept pipeline input: False 50 | Accept wildcard characters: False 51 | ``` 52 | 53 | ### -dataset 54 | {{Fill dataset Description}} 55 | 56 | ```yaml 57 | Type: Object 58 | Parameter Sets: (All) 59 | Aliases: 60 | 61 | Required: True 62 | Position: 2 63 | Default value: None 64 | Accept pipeline input: True (ByValue) 65 | Accept wildcard characters: False 66 | ``` 67 | 68 | ### -top 69 | Limit the number of items returned by the top N 70 | 71 | ```yaml 72 | Type: Int32 73 | Parameter Sets: (All) 74 | Aliases: 75 | 76 | Required: False 77 | Position: 3 78 | Default value: 0 79 | Accept pipeline input: False 80 | Accept wildcard characters: False 81 | ``` 82 | 83 | ### -groupId 84 | {{Fill groupId Description}} 85 | 86 | ```yaml 87 | Type: String 88 | Parameter Sets: (All) 89 | Aliases: 90 | 91 | Required: False 92 | Position: 4 93 | Default value: None 94 | Accept pipeline input: False 95 | Accept wildcard characters: False 96 | ``` 97 | 98 | ### CommonParameters 99 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 100 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 101 | 102 | ## INPUTS 103 | 104 | ## OUTPUTS 105 | 106 | ## NOTES 107 | 108 | ## RELATED LINKS 109 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIDatasources.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIDatasources 9 | 10 | ## SYNOPSIS 11 | Gets DataSet connections 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIDatasources [[-authToken] ] [-dataset] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | {{Fill authToken Description}} 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -dataset 49 | {{Fill dataset Description}} 50 | 51 | ```yaml 52 | Type: Object 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: True 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: True (ByValue) 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -groupId 64 | {{Fill groupId Description}} 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 80 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 81 | 82 | ## INPUTS 83 | 84 | ## OUTPUTS 85 | 86 | ## NOTES 87 | 88 | ## RELATED LINKS 89 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIGroup.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIGroup 9 | 10 | ## SYNOPSIS 11 | Gets all the PowerBI existing workspaces 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIGroup [[-authToken] ] [[-name] ] [[-id] ] [-admin] [-withUsers] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Gets all the PowerBI existing workspaces 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIWorkspace -authToken $authToken 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -authToken 33 | The authorization token required to communicate with the PowerBI APIs 34 | Use 'Get-PBIAuthToken' to get the authorization token string 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -name 49 | The name of the workspace 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -id 64 | The id of the workspace 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -admin 79 | {{Fill admin Description}} 80 | 81 | ```yaml 82 | Type: SwitchParameter 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: Named 88 | Default value: False 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -withUsers 94 | {{Fill withUsers Description}} 95 | 96 | ```yaml 97 | Type: SwitchParameter 98 | Parameter Sets: (All) 99 | Aliases: 100 | 101 | Required: False 102 | Position: Named 103 | Default value: False 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### CommonParameters 109 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 110 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 111 | 112 | ## INPUTS 113 | 114 | ## OUTPUTS 115 | 116 | ## NOTES 117 | 118 | ## RELATED LINKS 119 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIGroupUsers.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIGroupUsers 9 | 10 | ## SYNOPSIS 11 | Gets users that are members of a specific workspace (group) and returns as an array of custom objects. 12 | Must use Set-PBIGroup first to set the group. 13 | 14 | ## SYNTAX 15 | 16 | ``` 17 | Get-PBIGroupUsers [[-authToken] ] [[-groupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIGroupUsers -authToken $authToken 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -authToken 33 | {{Fill authToken Description}} 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -groupId 48 | {{Fill groupId Description}} 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 64 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 65 | 66 | ## INPUTS 67 | 68 | ## OUTPUTS 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIImports.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIImports 9 | 10 | ## SYNOPSIS 11 | Gets all the PowerBI imports made by the user and returns as an array of custom objects. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIImports [[-authToken] ] [[-importId] ] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-PBIImports -authToken $authToken 27 | ``` 28 | 29 | ### EXAMPLE 2 30 | ``` 31 | Get-PBIImports -authToken $authToken 32 | ``` 33 | 34 | ## PARAMETERS 35 | 36 | ### -authToken 37 | The authorization token required to comunicate with the PowerBI APIs 38 | Use 'Get-PBIAuthToken' to get the authorization token string 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: None 48 | Accept pipeline input: False 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### -importId 53 | The id of the import in PowerBI 54 | 55 | ```yaml 56 | Type: String 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: False 61 | Position: 2 62 | Default value: None 63 | Accept pipeline input: False 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -groupId 68 | Id of the workspace where the reports will get pulled 69 | 70 | ```yaml 71 | Type: String 72 | Parameter Sets: (All) 73 | Aliases: 74 | 75 | Required: False 76 | Position: 3 77 | Default value: None 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### CommonParameters 83 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 84 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 85 | 86 | ## INPUTS 87 | 88 | ## OUTPUTS 89 | 90 | ## NOTES 91 | 92 | ## RELATED LINKS 93 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIModuleConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIModuleConfig 9 | 10 | ## SYNOPSIS 11 | Gets the module config variables like: API Url, App Id,... 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIModuleConfig [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Gets the module config variables like: API Url, App Id,... 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-PBIModuleConfig 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 33 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 34 | 35 | ## INPUTS 36 | 37 | ## OUTPUTS 38 | 39 | ## NOTES 40 | 41 | ## RELATED LINKS 42 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Get-PBIReport.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-PBIReport 9 | 10 | ## SYNOPSIS 11 | Gets an array of Power BI Report metadata from a workspace 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-PBIReport [[-authToken] ] [[-name] ] [[-id] ] [[-groupId] ] [-admin] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Gets an array of Power BI Report metadata from a workspace 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-PBIReport 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | Get-PBIReport -id "GUID" 33 | ``` 34 | 35 | ### EXAMPLE 3 36 | ``` 37 | Get-PBIReport -id "GUID" -groupId "GUID" 38 | ``` 39 | 40 | ## PARAMETERS 41 | 42 | ### -authToken 43 | The authorization token required to communicate with the PowerBI APIs 44 | Use 'Get-PBIAuthToken' to get the authorization token string 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: 50 | 51 | Required: False 52 | Position: 1 53 | Default value: None 54 | Accept pipeline input: False 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### -name 59 | The name of the report 60 | 61 | ```yaml 62 | Type: String 63 | Parameter Sets: (All) 64 | Aliases: 65 | 66 | Required: False 67 | Position: 2 68 | Default value: None 69 | Accept pipeline input: False 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### -id 74 | The id of the report 75 | 76 | ```yaml 77 | Type: String 78 | Parameter Sets: (All) 79 | Aliases: 80 | 81 | Required: False 82 | Position: 3 83 | Default value: None 84 | Accept pipeline input: False 85 | Accept wildcard characters: False 86 | ``` 87 | 88 | ### -groupId 89 | Id of the workspace where the reports will get pulled 90 | 91 | ```yaml 92 | Type: String 93 | Parameter Sets: (All) 94 | Aliases: 95 | 96 | Required: False 97 | Position: 4 98 | Default value: None 99 | Accept pipeline input: False 100 | Accept wildcard characters: False 101 | ``` 102 | 103 | ### -admin 104 | {{Fill admin Description}} 105 | 106 | ```yaml 107 | Type: SwitchParameter 108 | Parameter Sets: (All) 109 | Aliases: 110 | 111 | Required: False 112 | Position: Named 113 | Default value: False 114 | Accept pipeline input: False 115 | Accept wildcard characters: False 116 | ``` 117 | 118 | ### CommonParameters 119 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 120 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 121 | 122 | ## INPUTS 123 | 124 | ## OUTPUTS 125 | 126 | ## NOTES 127 | 128 | ## RELATED LINKS 129 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Import-PBIFile.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Import-PBIFile 9 | 10 | ## SYNOPSIS 11 | Creates new content on the specified workspace from a .pbix file. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Import-PBIFile [[-authToken] ] [-file] [[-dataSetName] ] [[-nameConflict] ] 17 | [[-groupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Creates new content on the specified workspace from a .pbix file. 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | $file = Resolve-Path .\Samples\PBIX\MyMovies.pbix 28 | ``` 29 | 30 | $authToken = Get-PBIAuthToken -Verbose 31 | Import-PBIFile -authToken $authToken -file $file -verbose 32 | 33 | ### EXAMPLE 2 34 | ``` 35 | $file = Resolve-Path .\Samples\PBIX\MyMovies.pbix 36 | ``` 37 | 38 | $authToken = Get-PBIAuthToken -Verbose 39 | $group = Get-PBIGroup -name "Test Workspace" 40 | $result = Import-PBIFile -authToken $authToken -groupId $($group.id) -file $file -verbose 41 | $importResult = Get-PBIImports $authToken -groupId $($group.id) -importId $($id.id) 42 | $importResult | Out-GridView 43 | 44 | ## PARAMETERS 45 | 46 | ### -authToken 47 | The authorization token required to comunicate with the PowerBI APIs. 48 | Use \`Get-PBIAuthToken\` to get the authorization token string. 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: 1 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -file 63 | The full path to the .pbix file. 64 | 65 | ```yaml 66 | Type: Object 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: True 71 | Position: 2 72 | Default value: None 73 | Accept pipeline input: True (ByValue) 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -dataSetName 78 | The display name of the dataset, should include file extension. 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 3 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -nameConflict 93 | Determines what to do if a dataset with the same name already exists. 94 | 95 | ```yaml 96 | Type: String 97 | Parameter Sets: (All) 98 | Aliases: 99 | 100 | Required: False 101 | Position: 4 102 | Default value: Ignore 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -groupId 108 | The workspace ID. 109 | 110 | ```yaml 111 | Type: String 112 | Parameter Sets: (All) 113 | Aliases: 114 | 115 | Required: False 116 | Position: 5 117 | Default value: None 118 | Accept pipeline input: False 119 | Accept wildcard characters: False 120 | ``` 121 | 122 | ### CommonParameters 123 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 124 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 125 | 126 | ## INPUTS 127 | 128 | ## OUTPUTS 129 | 130 | ## NOTES 131 | To import .pbix files larger than 1 GB, see https://docs.microsoft.com/en-us/rest/api/power-bi/imports/createtemporaryuploadlocation, suported only for workspaces on premium capacity. 132 | 133 | ## RELATED LINKS 134 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Invoke-PBIRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Invoke-PBIRequest 9 | 10 | ## SYNOPSIS 11 | Invoke a raw PBI Post/Get 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Invoke-PBIRequest [[-authToken] ] [-resource] [[-method] ] [[-body] ] 17 | [[-scope] ] [[-contentType] ] [[-timeoutSec] ] [[-outFile] ] 18 | [[-groupId] ] [-ignoreGroup] [-admin] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | {{Fill in the Description}} 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | ```powershell 28 | PS C:\> {{ Add example code here }} 29 | ``` 30 | 31 | {{ Add example description here }} 32 | 33 | ## PARAMETERS 34 | 35 | ### -authToken 36 | {{Fill authToken Description}} 37 | 38 | ```yaml 39 | Type: String 40 | Parameter Sets: (All) 41 | Aliases: 42 | 43 | Required: False 44 | Position: 1 45 | Default value: None 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -resource 51 | {{Fill resource Description}} 52 | 53 | ```yaml 54 | Type: String 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: True 59 | Position: 2 60 | Default value: None 61 | Accept pipeline input: False 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### -method 66 | {{Fill method Description}} 67 | 68 | ```yaml 69 | Type: String 70 | Parameter Sets: (All) 71 | Aliases: 72 | 73 | Required: False 74 | Position: 3 75 | Default value: Get 76 | Accept pipeline input: False 77 | Accept wildcard characters: False 78 | ``` 79 | 80 | ### -body 81 | {{Fill body Description}} 82 | 83 | ```yaml 84 | Type: Object 85 | Parameter Sets: (All) 86 | Aliases: 87 | 88 | Required: False 89 | Position: 4 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -scope 96 | {{Fill scope Description}} 97 | 98 | ```yaml 99 | Type: String 100 | Parameter Sets: (All) 101 | Aliases: 102 | 103 | Required: False 104 | Position: 5 105 | Default value: Individual 106 | Accept pipeline input: False 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### -contentType 111 | {{Fill contentType Description}} 112 | 113 | ```yaml 114 | Type: String 115 | Parameter Sets: (All) 116 | Aliases: 117 | 118 | Required: False 119 | Position: 6 120 | Default value: Application/json 121 | Accept pipeline input: False 122 | Accept wildcard characters: False 123 | ``` 124 | 125 | ### -timeoutSec 126 | {{Fill timeoutSec Description}} 127 | 128 | ```yaml 129 | Type: Int32 130 | Parameter Sets: (All) 131 | Aliases: 132 | 133 | Required: False 134 | Position: 7 135 | Default value: 240 136 | Accept pipeline input: False 137 | Accept wildcard characters: False 138 | ``` 139 | 140 | ### -outFile 141 | {{Fill outFile Description}} 142 | 143 | ```yaml 144 | Type: String 145 | Parameter Sets: (All) 146 | Aliases: 147 | 148 | Required: False 149 | Position: 8 150 | Default value: None 151 | Accept pipeline input: False 152 | Accept wildcard characters: False 153 | ``` 154 | 155 | ### -groupId 156 | {{Fill groupId Description}} 157 | 158 | ```yaml 159 | Type: String 160 | Parameter Sets: (All) 161 | Aliases: 162 | 163 | Required: False 164 | Position: 9 165 | Default value: None 166 | Accept pipeline input: False 167 | Accept wildcard characters: False 168 | ``` 169 | 170 | ### -ignoreGroup 171 | {{Fill ignoreGroup Description}} 172 | 173 | ```yaml 174 | Type: SwitchParameter 175 | Parameter Sets: (All) 176 | Aliases: 177 | 178 | Required: False 179 | Position: Named 180 | Default value: False 181 | Accept pipeline input: False 182 | Accept wildcard characters: False 183 | ``` 184 | 185 | ### -admin 186 | {{Fill admin Description}} 187 | 188 | ```yaml 189 | Type: SwitchParameter 190 | Parameter Sets: (All) 191 | Aliases: 192 | 193 | Required: False 194 | Position: Named 195 | Default value: False 196 | Accept pipeline input: False 197 | Accept wildcard characters: False 198 | ``` 199 | 200 | ### CommonParameters 201 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 202 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 203 | 204 | ## INPUTS 205 | 206 | ## OUTPUTS 207 | 208 | ## NOTES 209 | 210 | ## RELATED LINKS 211 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/New-PBIDashboard.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-PBIDashboard 9 | 10 | ## SYNOPSIS 11 | Create a new Dashboard 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-PBIDashboard [-authToken] [-name] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Create a new Dashboard in PowerBI 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-PBIDashboard -authToken $authToken -groupId $groupId 27 | ``` 28 | 29 | A new dashboard will be created and in case of success return the internal dashboard id 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | The authorization token required to comunicate with the PowerBI APIs 35 | Use 'Get-PBIAuthToken' to get the authorization token string 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: True 43 | Position: 1 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -name 50 | The name of the new dashboard 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: 2 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -groupId 65 | The id of the group in PowerBI 66 | 67 | ```yaml 68 | Type: String 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### CommonParameters 80 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 81 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 82 | 83 | ## INPUTS 84 | 85 | ## OUTPUTS 86 | 87 | ## NOTES 88 | 89 | ## RELATED LINKS 90 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/New-PBIDataSet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-PBIDataSet 9 | 10 | ## SYNOPSIS 11 | Create a new DataSet in PowerBI.com 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-PBIDataSet [-authToken] [-dataSet] [[-defaultRetentionPolicy] ] 17 | [[-types] ] [-ignoreIfDataSetExists] [[-groupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Create a new DataSet in PowerBI.Com 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | New-PBIDataSet -authToken $authToken -dataSet $dataSet 28 | ``` 29 | 30 | A new dataset will be created and in case of success return the internal dataset id 31 | 32 | ## PARAMETERS 33 | 34 | ### -authToken 35 | The authorization token required to comunicate with the PowerBI APIs 36 | Use 'Get-PBIAuthToken' to get the authorization token string 37 | 38 | ```yaml 39 | Type: String 40 | Parameter Sets: (All) 41 | Aliases: 42 | 43 | Required: True 44 | Position: 1 45 | Default value: None 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -dataSet 51 | The dataset object, this object must be one of two types: hashtable or System.Data.DataSet 52 | 53 | If a hashtable is supplied it must have the following structure: 54 | 55 | $dataSet = @{ 56 | name = "DataSetName" 57 | ; tables = @( 58 | @{ 59 | name = "TableName" 60 | ; columns = @( 61 | @{ name = "Col1"; dataType = "Int64" } 62 | , @{ name = "Col2"; dataType = "string" } 63 | ) 64 | }) 65 | } 66 | 67 | ```yaml 68 | Type: Object 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: True 73 | Position: 2 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -defaultRetentionPolicy 80 | The retention policy to be applied by PowerBI 81 | 82 | Example: "basicFIFO" 83 | http://blogs.msdn.com/b/powerbidev/archive/2015/03/23/automatic-retention-policy-for-real-time-data.aspx 84 | 85 | ```yaml 86 | Type: String 87 | Parameter Sets: (All) 88 | Aliases: 89 | 90 | Required: False 91 | Position: 3 92 | Default value: None 93 | Accept pipeline input: False 94 | Accept wildcard characters: False 95 | ``` 96 | 97 | ### -types 98 | {{Fill types Description}} 99 | 100 | ```yaml 101 | Type: Hashtable 102 | Parameter Sets: (All) 103 | Aliases: 104 | 105 | Required: False 106 | Position: 4 107 | Default value: None 108 | Accept pipeline input: False 109 | Accept wildcard characters: False 110 | ``` 111 | 112 | ### -ignoreIfDataSetExists 113 | Checks if the dataset exists before the creation 114 | 115 | ```yaml 116 | Type: SwitchParameter 117 | Parameter Sets: (All) 118 | Aliases: 119 | 120 | Required: False 121 | Position: Named 122 | Default value: False 123 | Accept pipeline input: False 124 | Accept wildcard characters: False 125 | ``` 126 | 127 | ### -groupId 128 | Id of the workspace where the reports will get pulled 129 | 130 | ```yaml 131 | Type: String 132 | Parameter Sets: (All) 133 | Aliases: 134 | 135 | Required: False 136 | Position: 5 137 | Default value: None 138 | Accept pipeline input: False 139 | Accept wildcard characters: False 140 | ``` 141 | 142 | ### CommonParameters 143 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 144 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 145 | 146 | ## INPUTS 147 | 148 | ## OUTPUTS 149 | 150 | ## NOTES 151 | 152 | ## RELATED LINKS 153 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/New-PBIGroup.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-PBIGroup 9 | 10 | ## SYNOPSIS 11 | Create a new group 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-PBIGroup [[-authToken] ] [-name] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Creates a new group (app workspace) in PowerBI 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-PBIGroup -authToken $authToken -name "Name Of The New Group" 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -authToken 32 | The authorization token required to comunicate with the PowerBI APIs 33 | Use 'Get-PBIAuthToken' to get the authorization token string 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -name 48 | The name of the group 49 | 50 | ```yaml 51 | Type: Object 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: True 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 64 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 65 | 66 | ## INPUTS 67 | 68 | ## OUTPUTS 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/New-PBIGroupUser.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-PBIGroupUser 9 | 10 | ## SYNOPSIS 11 | Add a user to a group 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-PBIGroupUser [[-authToken] ] [-groupId] [-emailAddress] 17 | [[-groupUserAccessRight] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Adds a new user to an existing group (app workspace) in PowerBI 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | New-PBIGroupUser -authToken $authToken -groupId $groupId -emailAddress "someone@your-organisation.com" 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -authToken 33 | The authorization token required to comunicate with the PowerBI APIs 34 | Use 'Get-PBIAuthToken' to get the authorization token string 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -groupId 49 | The id of the group in PowerBI 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: True 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -emailAddress 64 | The email address of the user in your organisation that you want to add to the group 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: True 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -groupUserAccessRight 79 | The access right the user gets on the group 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: Admin 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### CommonParameters 94 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 95 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 96 | 97 | ## INPUTS 98 | 99 | ## OUTPUTS 100 | 101 | ## NOTES 102 | 103 | ## RELATED LINKS 104 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Out-PowerBI.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Out-PowerBI 9 | 10 | ## SYNOPSIS 11 | A one line cmdlet that you can use to send data into PowerBI 12 | 13 | ## SYNTAX 14 | 15 | ### authToken (Default) 16 | ``` 17 | Out-PowerBI -Data [-AuthToken ] [-DataSetName ] [-TableName ] 18 | [-BatchSize ] [-MultipleTables] [-ForceAskCredentials] [-ForceTableSchemaUpdate] [-Types ] 19 | [-groupId ] [] 20 | ``` 21 | 22 | ### credential 23 | ``` 24 | Out-PowerBI -Data -Credential [-DataSetName ] [-TableName ] 25 | [-BatchSize ] [-MultipleTables] [-ForceAskCredentials] [-ForceTableSchemaUpdate] [-Types ] 26 | [-groupId ] [] 27 | ``` 28 | 29 | ## DESCRIPTION 30 | {{Fill in the Description}} 31 | 32 | ## EXAMPLES 33 | 34 | ### EXAMPLE 1 35 | ``` 36 | Get-Process | Out-PowerBI -clientId "7a7be4f7-c64d-41da-94db-7fb8200f029c" 37 | ``` 38 | 39 | 1..53 |% { 40 | @{ 41 | Id = $_ 42 | ; Name = "Record $_" 43 | ; Date = \[datetime\]::Now 44 | ; Value = (Get-Random -Minimum 10 -Maximum 1000) 45 | } 46 | } | Out-PowerBI -clientId "7a7be4f7-c64d-41da-94db-7fb8200f029c" -verbose 47 | 48 | ## PARAMETERS 49 | 50 | ### -Data 51 | The data that will be sent to PowerBI 52 | 53 | ```yaml 54 | Type: Object 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: True 59 | Position: Named 60 | Default value: None 61 | Accept pipeline input: True (ByValue) 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### -AuthToken 66 | The AccessToken - Optional 67 | 68 | ```yaml 69 | Type: String 70 | Parameter Sets: authToken 71 | Aliases: 72 | 73 | Required: False 74 | Position: Named 75 | Default value: None 76 | Accept pipeline input: False 77 | Accept wildcard characters: False 78 | ``` 79 | 80 | ### -Credential 81 | specifies a PSCredential object used to authenticate to the PowerBI service. 82 | This is used to automate the 83 | sign in process so you aren't prompted to enter a username and password in the GUI. 84 | 85 | ```yaml 86 | Type: Object 87 | Parameter Sets: credential 88 | Aliases: 89 | 90 | Required: True 91 | Position: Named 92 | Default value: None 93 | Accept pipeline input: False 94 | Accept wildcard characters: False 95 | ``` 96 | 97 | ### -DataSetName 98 | The name of the dataset - Optional, by default will always create a new dataset with a timestamp 99 | 100 | ```yaml 101 | Type: String 102 | Parameter Sets: (All) 103 | Aliases: 104 | 105 | Required: False 106 | Position: Named 107 | Default value: ("PowerBIPS_{0:yyyyMMdd_HHmmss}" -f (Get-Date)) 108 | Accept pipeline input: False 109 | Accept wildcard characters: False 110 | ``` 111 | 112 | ### -TableName 113 | The name of the table in the DataSet - Optional, by default will be named "Table" 114 | 115 | ```yaml 116 | Type: String 117 | Parameter Sets: (All) 118 | Aliases: 119 | 120 | Required: False 121 | Position: Named 122 | Default value: Table 123 | Accept pipeline input: False 124 | Accept wildcard characters: False 125 | ``` 126 | 127 | ### -BatchSize 128 | The size of the batch that is sent to PowerBI as HttpPost. 129 | 130 | If for example the batch size is 100 and a collection of 131 | 1000 rows are being pushed then this cmdlet will make 10 132 | HttpPosts 133 | 134 | ```yaml 135 | Type: Int32 136 | Parameter Sets: (All) 137 | Aliases: 138 | 139 | Required: False 140 | Position: Named 141 | Default value: 1000 142 | Accept pipeline input: False 143 | Accept wildcard characters: False 144 | ``` 145 | 146 | ### -MultipleTables 147 | A indication that the hashtable passed is a multitable 148 | 149 | ```yaml 150 | Type: SwitchParameter 151 | Parameter Sets: (All) 152 | Aliases: 153 | 154 | Required: False 155 | Position: Named 156 | Default value: False 157 | Accept pipeline input: False 158 | Accept wildcard characters: False 159 | ``` 160 | 161 | ### -ForceAskCredentials 162 | {{Fill ForceAskCredentials Description}} 163 | 164 | ```yaml 165 | Type: SwitchParameter 166 | Parameter Sets: (All) 167 | Aliases: 168 | 169 | Required: False 170 | Position: Named 171 | Default value: False 172 | Accept pipeline input: False 173 | Accept wildcard characters: False 174 | ``` 175 | 176 | ### -ForceTableSchemaUpdate 177 | {{Fill ForceTableSchemaUpdate Description}} 178 | 179 | ```yaml 180 | Type: SwitchParameter 181 | Parameter Sets: (All) 182 | Aliases: 183 | 184 | Required: False 185 | Position: Named 186 | Default value: False 187 | Accept pipeline input: False 188 | Accept wildcard characters: False 189 | ``` 190 | 191 | ### -Types 192 | {{Fill Types Description}} 193 | 194 | ```yaml 195 | Type: Hashtable 196 | Parameter Sets: (All) 197 | Aliases: 198 | 199 | Required: False 200 | Position: Named 201 | Default value: None 202 | Accept pipeline input: False 203 | Accept wildcard characters: False 204 | ``` 205 | 206 | ### -groupId 207 | Id of the workspace where the reports will get pulled 208 | 209 | ```yaml 210 | Type: String 211 | Parameter Sets: (All) 212 | Aliases: 213 | 214 | Required: False 215 | Position: Named 216 | Default value: None 217 | Accept pipeline input: False 218 | Accept wildcard characters: False 219 | ``` 220 | 221 | ### CommonParameters 222 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 223 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 224 | 225 | ## INPUTS 226 | 227 | ## OUTPUTS 228 | 229 | ## NOTES 230 | 231 | ## RELATED LINKS 232 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/PowerBIPS.md: -------------------------------------------------------------------------------- 1 | --- 2 | Module Name: PowerBIPS 3 | Module Guid: 163a1640-a4f2-4b1f-a3af-2796ad56200b 4 | Download Help Link: {{Please enter FwLink manually}} 5 | Help Version: {{Please enter version of help manually (X.X.X.X) format}} 6 | Locale: en-US 7 | --- 8 | 9 | # PowerBIPS Module 10 | ## Description 11 | {{Manually Enter Description Here}} 12 | 13 | ## PowerBIPS Cmdlets 14 | ### [Add-PBITableRows](Add-PBITableRows.md) 15 | {{Manually Enter Add-PBITableRows Description Here}} 16 | 17 | ### [Clear-PBITableRows](Clear-PBITableRows.md) 18 | {{Manually Enter Clear-PBITableRows Description Here}} 19 | 20 | ### [Copy-PBIReports](Copy-PBIReports.md) 21 | {{Manually Enter Copy-PBIReports Description Here}} 22 | 23 | ### [Export-PBIReport](Export-PBIReport.md) 24 | {{Manually Enter Export-PBIReport Description Here}} 25 | 26 | ### [Get-PBIAuthToken](Get-PBIAuthToken.md) 27 | {{Manually Enter Get-PBIAuthToken Description Here}} 28 | 29 | ### [Get-PBIAuthTokenHttp](Get-PBIAuthTokenHttp.md) 30 | {{Manually Enter Get-PBIAuthTokenHttp Description Here}} 31 | 32 | ### [Get-PBIDashboard](Get-PBIDashboard.md) 33 | {{Manually Enter Get-PBIDashboard Description Here}} 34 | 35 | ### [Get-PBIDashboardTile](Get-PBIDashboardTile.md) 36 | {{Manually Enter Get-PBIDashboardTile Description Here}} 37 | 38 | ### [Get-PBIDataSet](Get-PBIDataSet.md) 39 | {{Manually Enter Get-PBIDataSet Description Here}} 40 | 41 | ### [Get-PBIDatasetParameters](Get-PBIDatasetParameters.md) 42 | {{Manually Enter Get-PBIDatasetParameters Description Here}} 43 | 44 | ### [Get-PBIDatasetRefreshHistory](Get-PBIDatasetRefreshHistory.md) 45 | {{Manually Enter Get-PBIDatasetRefreshHistory Description Here}} 46 | 47 | ### [Get-PBIDataSetTables](Get-PBIDataSetTables.md) 48 | {{Manually Enter Get-PBIDataSetTables Description Here}} 49 | 50 | ### [Get-PBIDatasources](Get-PBIDatasources.md) 51 | {{Manually Enter Get-PBIDatasources Description Here}} 52 | 53 | ### [Get-PBIGroup](Get-PBIGroup.md) 54 | {{Manually Enter Get-PBIGroup Description Here}} 55 | 56 | ### [Get-PBIGroupUsers](Get-PBIGroupUsers.md) 57 | {{Manually Enter Get-PBIGroupUsers Description Here}} 58 | 59 | ### [Get-PBIImports](Get-PBIImports.md) 60 | {{Manually Enter Get-PBIImports Description Here}} 61 | 62 | ### [Get-PBIModuleConfig](Get-PBIModuleConfig.md) 63 | {{Manually Enter Get-PBIModuleConfig Description Here}} 64 | 65 | ### [Get-PBIReport](Get-PBIReport.md) 66 | {{Manually Enter Get-PBIReport Description Here}} 67 | 68 | ### [Import-PBIFile](Import-PBIFile.md) 69 | {{Manually Enter Import-PBIFile Description Here}} 70 | 71 | ### [Invoke-PBIRequest](Invoke-PBIRequest.md) 72 | {{Manually Enter Invoke-PBIRequest Description Here}} 73 | 74 | ### [New-PBIDashboard](New-PBIDashboard.md) 75 | {{Manually Enter New-PBIDashboard Description Here}} 76 | 77 | ### [New-PBIDataSet](New-PBIDataSet.md) 78 | {{Manually Enter New-PBIDataSet Description Here}} 79 | 80 | ### [New-PBIGroup](New-PBIGroup.md) 81 | {{Manually Enter New-PBIGroup Description Here}} 82 | 83 | ### [New-PBIGroupUser](New-PBIGroupUser.md) 84 | {{Manually Enter New-PBIGroupUser Description Here}} 85 | 86 | ### [Out-PowerBI](Out-PowerBI.md) 87 | {{Manually Enter Out-PowerBI Description Here}} 88 | 89 | ### [Remove-PBIDataSet](Remove-PBIDataSet.md) 90 | {{Manually Enter Remove-PBIDataSet Description Here}} 91 | 92 | ### [Remove-PBIReport](Remove-PBIReport.md) 93 | {{Manually Enter Remove-PBIReport Description Here}} 94 | 95 | ### [Request-PBIDatasetRefresh](Request-PBIDatasetRefresh.md) 96 | {{Manually Enter Request-PBIDatasetRefresh Description Here}} 97 | 98 | ### [Set-PBIDatasetParameters](Set-PBIDatasetParameters.md) 99 | {{Manually Enter Set-PBIDatasetParameters Description Here}} 100 | 101 | ### [Set-PBIGroup](Set-PBIGroup.md) 102 | {{Manually Enter Set-PBIGroup Description Here}} 103 | 104 | ### [Set-PBIModuleConfig](Set-PBIModuleConfig.md) 105 | {{Manually Enter Set-PBIModuleConfig Description Here}} 106 | 107 | ### [Set-PBIReportContent](Set-PBIReportContent.md) 108 | {{Manually Enter Set-PBIReportContent Description Here}} 109 | 110 | ### [Set-PBIReportsDataset](Set-PBIReportsDataset.md) 111 | {{Manually Enter Set-PBIReportsDataset Description Here}} 112 | 113 | ### [Test-PBIDataSet](Test-PBIDataSet.md) 114 | {{Manually Enter Test-PBIDataSet Description Here}} 115 | 116 | ### [Update-PBIDatasetDatasources](Update-PBIDatasetDatasources.md) 117 | {{Manually Enter Update-PBIDatasetDatasources Description Here}} 118 | 119 | ### [Update-PBITableSchema](Update-PBITableSchema.md) 120 | {{Manually Enter Update-PBITableSchema Description Here}} 121 | 122 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Remove-PBIDataSet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-PBIDataSet 9 | 10 | ## SYNOPSIS 11 | Delete a dataset from a workspace 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-PBIDataSet [[-authToken] ] [-dataset] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Delete a dataset from a workspace 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-PBIDataSet -dataset "dataset id" 27 | ``` 28 | 29 | ### EXAMPLE 2 30 | ``` 31 | Get-PBIDataset -name "DataSetName" | Remove-PBIDataSet 32 | ``` 33 | 34 | ## PARAMETERS 35 | 36 | ### -authToken 37 | The authorization token required to communicate with the PowerBI APIs 38 | Use 'Get-PBIAuthToken' to get the authorization token string 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: None 48 | Accept pipeline input: False 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### -dataset 53 | A dataset object or id 54 | 55 | ```yaml 56 | Type: Object 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: True 61 | Position: 2 62 | Default value: None 63 | Accept pipeline input: True (ByValue) 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -groupId 68 | Id of the workspace 69 | 70 | ```yaml 71 | Type: String 72 | Parameter Sets: (All) 73 | Aliases: 74 | 75 | Required: False 76 | Position: 3 77 | Default value: None 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### CommonParameters 83 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 84 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 85 | 86 | ## INPUTS 87 | 88 | ## OUTPUTS 89 | 90 | ## NOTES 91 | 92 | ## RELATED LINKS 93 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Remove-PBIReport.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-PBIReport 9 | 10 | ## SYNOPSIS 11 | Delete a report from a workspace 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-PBIReport [[-authToken] ] [-report] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Delete a report from a workspace 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-PBIReport -dataset "dataset id" 27 | ``` 28 | 29 | ### EXAMPLE 2 30 | ``` 31 | Get-PBIDataset -name "DataSetName" | Remove-PBIReport 32 | ``` 33 | 34 | ## PARAMETERS 35 | 36 | ### -authToken 37 | The authorization token required to communicate with the PowerBI APIs 38 | Use 'Get-PBIAuthToken' to get the authorization token string 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: None 48 | Accept pipeline input: False 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### -report 53 | A report object or id 54 | 55 | ```yaml 56 | Type: Object 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: True 61 | Position: 2 62 | Default value: None 63 | Accept pipeline input: True (ByValue) 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -groupId 68 | Id of the workspace 69 | 70 | ```yaml 71 | Type: String 72 | Parameter Sets: (All) 73 | Aliases: 74 | 75 | Required: False 76 | Position: 3 77 | Default value: None 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### CommonParameters 83 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 84 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 85 | 86 | ## INPUTS 87 | 88 | ## OUTPUTS 89 | 90 | ## NOTES 91 | 92 | ## RELATED LINKS 93 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Request-PBIDatasetRefresh.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Request-PBIDatasetRefresh 9 | 10 | ## SYNOPSIS 11 | Refresh one or more datasets 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Request-PBIDatasetRefresh [[-authToken] ] [-dataset] [[-groupId] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Request-PBIDatasetRefresh -dataset "GUID" 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | Get-PBIDataSet -name "Dataset name" | Request-PBIDatasetRefresh 33 | ``` 34 | 35 | ## PARAMETERS 36 | 37 | ### -authToken 38 | The authorization token required to comunicate with the PowerBI APIs 39 | Use 'Get-PBIAuthToken' to get the authorization token string 40 | 41 | ```yaml 42 | Type: String 43 | Parameter Sets: (All) 44 | Aliases: 45 | 46 | Required: False 47 | Position: 1 48 | Default value: None 49 | Accept pipeline input: False 50 | Accept wildcard characters: False 51 | ``` 52 | 53 | ### -dataset 54 | {{Fill dataset Description}} 55 | 56 | ```yaml 57 | Type: Object 58 | Parameter Sets: (All) 59 | Aliases: 60 | 61 | Required: True 62 | Position: 2 63 | Default value: None 64 | Accept pipeline input: True (ByValue) 65 | Accept wildcard characters: False 66 | ``` 67 | 68 | ### -groupId 69 | {{Fill groupId Description}} 70 | 71 | ```yaml 72 | Type: String 73 | Parameter Sets: (All) 74 | Aliases: 75 | 76 | Required: False 77 | Position: 3 78 | Default value: None 79 | Accept pipeline input: False 80 | Accept wildcard characters: False 81 | ``` 82 | 83 | ### CommonParameters 84 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 85 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 86 | 87 | ## INPUTS 88 | 89 | ## OUTPUTS 90 | 91 | ## NOTES 92 | 93 | ## RELATED LINKS 94 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Set-PBIDatasetParameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-PBIDatasetParameters 9 | 10 | ## SYNOPSIS 11 | Change parameter values in one or more datasets. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-PBIDatasetParameters [[-authToken] ] [-dataset] [-parameters] 17 | [[-groupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Set-PBIDatasetParameters -dataset "GUID" -parameters @(...) 28 | ``` 29 | 30 | ### EXAMPLE 2 31 | ``` 32 | Get-PBIDataSet -name "Dataset name" | Set-PBIDatasetParameters -parameters @(...) 33 | ``` 34 | 35 | ## PARAMETERS 36 | 37 | ### -authToken 38 | The authorization token required to comunicate with the PowerBI APIs 39 | Use 'Get-PBIAuthToken' to get the authorization token string 40 | 41 | ```yaml 42 | Type: String 43 | Parameter Sets: (All) 44 | Aliases: 45 | 46 | Required: False 47 | Position: 1 48 | Default value: None 49 | Accept pipeline input: False 50 | Accept wildcard characters: False 51 | ``` 52 | 53 | ### -dataset 54 | {{Fill dataset Description}} 55 | 56 | ```yaml 57 | Type: Object 58 | Parameter Sets: (All) 59 | Aliases: 60 | 61 | Required: True 62 | Position: 2 63 | Default value: None 64 | Accept pipeline input: True (ByValue) 65 | Accept wildcard characters: False 66 | ``` 67 | 68 | ### -parameters 69 | An hashtable with the following structure: 70 | 71 | $parameters = @( 72 | @{ 73 | name="ParameterName" 74 | newValue="NewParameterValue" 75 | }, 76 | ... 77 | ) 78 | 79 | ```yaml 80 | Type: Object 81 | Parameter Sets: (All) 82 | Aliases: 83 | 84 | Required: True 85 | Position: 3 86 | Default value: None 87 | Accept pipeline input: False 88 | Accept wildcard characters: False 89 | ``` 90 | 91 | ### -groupId 92 | {{Fill groupId Description}} 93 | 94 | ```yaml 95 | Type: String 96 | Parameter Sets: (All) 97 | Aliases: 98 | 99 | Required: False 100 | Position: 4 101 | Default value: None 102 | Accept pipeline input: False 103 | Accept wildcard characters: False 104 | ``` 105 | 106 | ### CommonParameters 107 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 108 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 109 | 110 | ## INPUTS 111 | 112 | ## OUTPUTS 113 | 114 | ## NOTES 115 | 116 | ## RELATED LINKS 117 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Set-PBIGroup.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-PBIGroup 9 | 10 | ## SYNOPSIS 11 | Set's the scope to the group specified, after execution all the following PowerBIPS cmdlets will execute over the defined group. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-PBIGroup [[-authToken] ] [[-id] ] [[-name] ] [-clear] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Set's the scope to the group specified, after execution all the following PowerBIPS cmdlets will execute over the defined group. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Set-PBIGroup -id "GUID" 27 | ``` 28 | 29 | ### EXAMPLE 2 30 | ``` 31 | Set-PBIGroup -name "Group Name" 32 | ``` 33 | 34 | ## PARAMETERS 35 | 36 | ### -authToken 37 | The authorization token required to communicate with the PowerBI APIs 38 | Use 'Get-PBIAuthToken' to get the authorization token string 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: None 48 | Accept pipeline input: False 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### -id 53 | The id of the group 54 | 55 | ```yaml 56 | Type: String 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: False 61 | Position: 2 62 | Default value: None 63 | Accept pipeline input: False 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -name 68 | The name of the group 69 | 70 | ```yaml 71 | Type: String 72 | Parameter Sets: (All) 73 | Aliases: 74 | 75 | Required: False 76 | Position: 3 77 | Default value: None 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### -clear 83 | If $true then will clear the group and all the requests will be made to the default user workspace 84 | 85 | ```yaml 86 | Type: SwitchParameter 87 | Parameter Sets: (All) 88 | Aliases: 89 | 90 | Required: False 91 | Position: Named 92 | Default value: False 93 | Accept pipeline input: False 94 | Accept wildcard characters: False 95 | ``` 96 | 97 | ### CommonParameters 98 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 99 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 100 | 101 | ## INPUTS 102 | 103 | ## OUTPUTS 104 | 105 | ## NOTES 106 | 107 | ## RELATED LINKS 108 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Set-PBIModuleConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-PBIModuleConfig 9 | 10 | ## SYNOPSIS 11 | Sets the module config variables like: API Url, App Id,... 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-PBIModuleConfig [[-PBIAPIUrl] ] [[-AzureADAppId] ] [[-AzureADAuthorityUrl] ] 17 | [[-AzureADResourceUrl] ] [[-AzureADRedirectUrl] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Sets the module config variables like: API Url, App Id,... 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Set-PBIModuleConfig -pbiAPIUrl "https://api.powerbi.com/beta/myorg" -AzureADAppId "YOUR Azure AD GUID" 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -PBIAPIUrl 33 | The url for the PBI API 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -AzureADAppId 48 | Your Azure AD Application Id 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -AzureADAuthorityUrl 63 | Url to the Azure AD Authority URL 64 | Default: "https://login.microsoftonline.com/common/oauth2/authorize" 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -AzureADResourceUrl 79 | {{Fill AzureADResourceUrl Description}} 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -AzureADRedirectUrl 94 | Url to the Redirect Url of the Azure AD App 95 | Default: "https://login.live.com/oauth20_desktop.srf" 96 | 97 | ```yaml 98 | Type: String 99 | Parameter Sets: (All) 100 | Aliases: 101 | 102 | Required: False 103 | Position: 5 104 | Default value: None 105 | Accept pipeline input: False 106 | Accept wildcard characters: False 107 | ``` 108 | 109 | ### CommonParameters 110 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 111 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 112 | 113 | ## INPUTS 114 | 115 | ## OUTPUTS 116 | 117 | ## NOTES 118 | 119 | ## RELATED LINKS 120 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Set-PBIReportContent.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-PBIReportContent 9 | 10 | ## SYNOPSIS 11 | Replaces a target reports content with content from another source report in the same or different workspace 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-PBIReportContent [[-authToken] ] [-report] [[-groupId] ] 17 | [-targetReportId] [[-targetGroupId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Replaces a target reports content with content from another source report in the same or different workspace 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | $sourceReport = Get-PBIReport -name "SourceReportName" 28 | ``` 29 | 30 | $targetReport = Get-PBIReport -name "TargetReportName" 31 | $sourceReport | Set-PBIReportContent -targetReportId $targetReport.id 32 | 33 | ## PARAMETERS 34 | 35 | ### -authToken 36 | The authorization token required to communicate with the PowerBI APIs 37 | Use 'Get-PBIAuthToken' to get the authorization token string 38 | 39 | ```yaml 40 | Type: String 41 | Parameter Sets: (All) 42 | Aliases: 43 | 44 | Required: False 45 | Position: 1 46 | Default value: None 47 | Accept pipeline input: False 48 | Accept wildcard characters: False 49 | ``` 50 | 51 | ### -report 52 | The PBI Report Object or Report Id (GUID) 53 | 54 | ```yaml 55 | Type: Object 56 | Parameter Sets: (All) 57 | Aliases: 58 | 59 | Required: True 60 | Position: 2 61 | Default value: None 62 | Accept pipeline input: True (ByValue) 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### -groupId 67 | {{Fill groupId Description}} 68 | 69 | ```yaml 70 | Type: String 71 | Parameter Sets: (All) 72 | Aliases: 73 | 74 | Required: False 75 | Position: 3 76 | Default value: None 77 | Accept pipeline input: False 78 | Accept wildcard characters: False 79 | ``` 80 | 81 | ### -targetReportId 82 | The target report id that content will get overwriten 83 | 84 | ```yaml 85 | Type: String 86 | Parameter Sets: (All) 87 | Aliases: 88 | 89 | Required: True 90 | Position: 4 91 | Default value: None 92 | Accept pipeline input: False 93 | Accept wildcard characters: False 94 | ``` 95 | 96 | ### -targetGroupId 97 | The target report workspace id 98 | 99 | ```yaml 100 | Type: String 101 | Parameter Sets: (All) 102 | Aliases: 103 | 104 | Required: False 105 | Position: 5 106 | Default value: None 107 | Accept pipeline input: False 108 | Accept wildcard characters: False 109 | ``` 110 | 111 | ### CommonParameters 112 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 113 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 114 | 115 | ## INPUTS 116 | 117 | ## OUTPUTS 118 | 119 | ## NOTES 120 | 121 | ## RELATED LINKS 122 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Set-PBIReportsDataset.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-PBIReportsDataset 9 | 10 | ## SYNOPSIS 11 | Rebind reports to another dataset on the same workspace. 12 | 13 | ## SYNTAX 14 | 15 | ### default (Default) 16 | ``` 17 | Set-PBIReportsDataset [-authToken ] -report -targetDatasetId [-timeout ] 18 | [-groupId ] [] 19 | ``` 20 | 21 | ### sourceDS 22 | ``` 23 | Set-PBIReportsDataset [-authToken ] -sourceDatasetId -targetDatasetId 24 | [-timeout ] [-groupId ] [] 25 | ``` 26 | 27 | ## DESCRIPTION 28 | {{Fill in the Description}} 29 | 30 | ## EXAMPLES 31 | 32 | ### EXAMPLE 1 33 | ``` 34 | Set-PBIReportsDataset -report "ReportId" -targetDatasetId "DataSetId" 35 | ``` 36 | 37 | ### EXAMPLE 2 38 | ``` 39 | Get-PBIReport | Set-PBIReportsDataset -targetDatasetId "DataSetId" 40 | ``` 41 | 42 | ### EXAMPLE 3 43 | ``` 44 | # Rebind all the reports from Source DataSet to the Target DataSet 45 | ``` 46 | 47 | Set-PBIReportsDataset -sourceDatasetId "SourceDataSetId" -targetDatasetId "DataSetId" 48 | 49 | ## PARAMETERS 50 | 51 | ### -authToken 52 | The authorization token required to comunicate with the PowerBI APIs 53 | Use 'Get-PBIAuthToken' to get the authorization token string 54 | 55 | ```yaml 56 | Type: String 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: False 61 | Position: Named 62 | Default value: None 63 | Accept pipeline input: False 64 | Accept wildcard characters: False 65 | ``` 66 | 67 | ### -report 68 | The PBI Report Object or Report Id (GUID) 69 | 70 | ```yaml 71 | Type: Object 72 | Parameter Sets: default 73 | Aliases: 74 | 75 | Required: True 76 | Position: Named 77 | Default value: None 78 | Accept pipeline input: True (ByValue) 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### -sourceDatasetId 83 | A string with the source dataset id, when executed with this parameter all the reports that target the source dataset will be rebinded 84 | 85 | ```yaml 86 | Type: Object 87 | Parameter Sets: sourceDS 88 | Aliases: 89 | 90 | Required: True 91 | Position: Named 92 | Default value: None 93 | Accept pipeline input: False 94 | Accept wildcard characters: False 95 | ``` 96 | 97 | ### -targetDatasetId 98 | A string with the new dataset id to bind the reports 99 | 100 | ```yaml 101 | Type: String 102 | Parameter Sets: (All) 103 | Aliases: 104 | 105 | Required: True 106 | Position: Named 107 | Default value: None 108 | Accept pipeline input: False 109 | Accept wildcard characters: False 110 | ``` 111 | 112 | ### -timeout 113 | {{Fill timeout Description}} 114 | 115 | ```yaml 116 | Type: Int32 117 | Parameter Sets: (All) 118 | Aliases: 119 | 120 | Required: False 121 | Position: Named 122 | Default value: 300 123 | Accept pipeline input: False 124 | Accept wildcard characters: False 125 | ``` 126 | 127 | ### -groupId 128 | {{Fill groupId Description}} 129 | 130 | ```yaml 131 | Type: String 132 | Parameter Sets: (All) 133 | Aliases: 134 | 135 | Required: False 136 | Position: Named 137 | Default value: None 138 | Accept pipeline input: False 139 | Accept wildcard characters: False 140 | ``` 141 | 142 | ### CommonParameters 143 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 144 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 145 | 146 | ## INPUTS 147 | 148 | ## OUTPUTS 149 | 150 | ## NOTES 151 | 152 | ## RELATED LINKS 153 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Test-PBIDataSet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Test-PBIDataSet 9 | 10 | ## SYNOPSIS 11 | Check if a dataset exists by name 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Test-PBIDataSet [[-authToken] ] [-name] [[-groupId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Check if a dataset exists with the specified name 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Test-PBIDataSet -authToken $authToken -name "DataSetName" 27 | ``` 28 | 29 | Returns $true if the dataset exists 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | The authorization token required to communicate with the PowerBI APIs 35 | Use 'Get-PBIAuthToken' to get the authorization token string 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: False 43 | Position: 1 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -name 50 | The dataset name 51 | 52 | ```yaml 53 | Type: Object 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: 2 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -groupId 65 | Id of the workspace where the reports will get pulled 66 | 67 | ```yaml 68 | Type: String 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### CommonParameters 80 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 81 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 82 | 83 | ## INPUTS 84 | 85 | ## OUTPUTS 86 | 87 | ### System.Boolean 88 | 89 | ## NOTES 90 | 91 | ## RELATED LINKS 92 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Update-PBIDatasetDatasources.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-PBIDatasetDatasources 9 | 10 | ## SYNOPSIS 11 | Update the datasource of a dataset 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Update-PBIDatasetDatasources [[-authToken] ] [-dataset] [-datasourceType] 17 | [-originalServer] [-originalDatabase] [-targetServer] [-targetDatabase] 18 | [[-groupId] ] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Changes the connection string of an existing dataset in PowerBI 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Update-PBIDatasetDatasources -dataset xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -datasourceType AnalysisServices -originalServer "asazure://eastus.asazure.windows.net/myssas" -originalDatabase "wideworldimporters" -targetServer "asazure://eastus.asazure.windows.net/myssas" -targetDatabase "wideworldimporters2" 29 | ``` 30 | 31 | ### EXAMPLE 2 32 | ``` 33 | Get-PBIDataSet -name "DS Name" | Update-PBIDatasetDatasources -datasourceType AnalysisServices -originalServer "asazure://eastus.asazure.windows.net/myssas" -originalDatabase "wideworldimporters" -targetServer "asazure://eastus.asazure.windows.net/myssas" -targetDatabase "wideworldimporters2" 34 | ``` 35 | 36 | ## PARAMETERS 37 | 38 | ### -authToken 39 | The authorization token required to comunicate with the PowerBI APIs 40 | Use 'Get-PBIAuthToken' to get the authorization token string 41 | 42 | ```yaml 43 | Type: String 44 | Parameter Sets: (All) 45 | Aliases: 46 | 47 | Required: False 48 | Position: 1 49 | Default value: None 50 | Accept pipeline input: False 51 | Accept wildcard characters: False 52 | ``` 53 | 54 | ### -dataset 55 | {{Fill dataset Description}} 56 | 57 | ```yaml 58 | Type: Object 59 | Parameter Sets: (All) 60 | Aliases: 61 | 62 | Required: True 63 | Position: 2 64 | Default value: None 65 | Accept pipeline input: True (ByValue) 66 | Accept wildcard characters: False 67 | ``` 68 | 69 | ### -datasourceType 70 | The type of the datasource. 71 | The type cannot be changed from original to target. 72 | e.g. 73 | "AnalysisServices" or "Sql" 74 | 75 | ```yaml 76 | Type: Object 77 | Parameter Sets: (All) 78 | Aliases: 79 | 80 | Required: True 81 | Position: 3 82 | Default value: None 83 | Accept pipeline input: False 84 | Accept wildcard characters: False 85 | ``` 86 | 87 | ### -originalServer 88 | Original server. 89 | 90 | ```yaml 91 | Type: Object 92 | Parameter Sets: (All) 93 | Aliases: 94 | 95 | Required: True 96 | Position: 4 97 | Default value: None 98 | Accept pipeline input: False 99 | Accept wildcard characters: False 100 | ``` 101 | 102 | ### -originalDatabase 103 | Original database. 104 | 105 | ```yaml 106 | Type: Object 107 | Parameter Sets: (All) 108 | Aliases: 109 | 110 | Required: True 111 | Position: 5 112 | Default value: None 113 | Accept pipeline input: False 114 | Accept wildcard characters: False 115 | ``` 116 | 117 | ### -targetServer 118 | New Server. 119 | 120 | ```yaml 121 | Type: Object 122 | Parameter Sets: (All) 123 | Aliases: 124 | 125 | Required: True 126 | Position: 6 127 | Default value: None 128 | Accept pipeline input: False 129 | Accept wildcard characters: False 130 | ``` 131 | 132 | ### -targetDatabase 133 | New database. 134 | 135 | ```yaml 136 | Type: Object 137 | Parameter Sets: (All) 138 | Aliases: 139 | 140 | Required: True 141 | Position: 7 142 | Default value: None 143 | Accept pipeline input: False 144 | Accept wildcard characters: False 145 | ``` 146 | 147 | ### -groupId 148 | {{Fill groupId Description}} 149 | 150 | ```yaml 151 | Type: String 152 | Parameter Sets: (All) 153 | Aliases: 154 | 155 | Required: False 156 | Position: 8 157 | Default value: None 158 | Accept pipeline input: False 159 | Accept wildcard characters: False 160 | ``` 161 | 162 | ### CommonParameters 163 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 164 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 165 | 166 | ## INPUTS 167 | 168 | ## OUTPUTS 169 | 170 | ## NOTES 171 | 172 | ## RELATED LINKS 173 | -------------------------------------------------------------------------------- /Modules/PowerBIPS/doc/Update-PBITableSchema.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PowerBIPS-help.xml 3 | Module Name: PowerBIPS 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-PBITableSchema 9 | 10 | ## SYNOPSIS 11 | Updates a PowerBI Dataset Table Schema. 12 | Note: This operation will delete all the table rows 13 | 14 | ## SYNTAX 15 | 16 | ``` 17 | Update-PBITableSchema [[-authToken] ] [-dataSetId] [-table] [[-types] ] 18 | [[-groupId] ] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Updates a PowerBI Dataset Table Schema 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | -table 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -authToken 34 | The authorization token required to comunicate with the PowerBI APIs 35 | Use 'Get-PBIAuthToken' to get the authorization token string 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: False 43 | Position: 1 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -dataSetId 50 | {{Fill dataSetId Description}} 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: 2 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -table 65 | The table object, this object must be one of two types: hashtable or System.Data.DataTable 66 | 67 | If a hashtable is supplied it must have the following structure: 68 | 69 | $table = @{ 70 | name = "TableName" 71 | ; columns = @( 72 | @{ name = "Col1"; dataType = "Int64" } 73 | , @{ name = "Col2"; dataType = "string" } 74 | ) 75 | } 76 | 77 | ```yaml 78 | Type: Object 79 | Parameter Sets: (All) 80 | Aliases: 81 | 82 | Required: True 83 | Position: 3 84 | Default value: None 85 | Accept pipeline input: False 86 | Accept wildcard characters: False 87 | ``` 88 | 89 | ### -types 90 | {{Fill types Description}} 91 | 92 | ```yaml 93 | Type: Hashtable 94 | Parameter Sets: (All) 95 | Aliases: 96 | 97 | Required: False 98 | Position: 4 99 | Default value: None 100 | Accept pipeline input: False 101 | Accept wildcard characters: False 102 | ``` 103 | 104 | ### -groupId 105 | Id of the workspace where the reports will get pulled 106 | 107 | ```yaml 108 | Type: String 109 | Parameter Sets: (All) 110 | Aliases: 111 | 112 | Required: False 113 | Position: 5 114 | Default value: None 115 | Accept pipeline input: False 116 | Accept wildcard characters: False 117 | ``` 118 | 119 | ### CommonParameters 120 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 121 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 122 | 123 | ## INPUTS 124 | 125 | ## OUTPUTS 126 | 127 | ## NOTES 128 | 129 | ## RELATED LINKS 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Power BI PowerShell Modules 2 | 3 | This github repository is a collection of PowerShell modules for the Power BI platform. 4 | 5 | | Module Name | Description | PowerShell Gallery | 6 | | ----------- | ----------- | ----------------------- | 7 | | [PowerBIPS](Modules/PowerBIPS/PowerBIPS.md) | Power BI REST API Cmdlets | [Download from PowerShell Gallery](https://www.powershellgallery.com/packages/PowerBIPS)| 8 | | [PowerBIPS.Tools](Modules/PowerBIPS.Tools/PowerBIPS.Tools.md) | Tools & Hacks for Power BI | [Download from PowerShell Gallery](https://www.powershellgallery.com/packages/PowerBIPS.Tools)| 9 | --------------------------------------------------------------------------------