Giter Club home page Giter Club logo

powerbi-powershell-modules's Introduction

powerbi-powershell-modules's People

Contributors

adamskt avatar biguzi avatar exceptionull avatar fabiommb avatar fmms avatar fpvmorais avatar garetanderson avatar gbrueckl avatar hitzand avatar jamiekt avatar joanavb avatar mattmcnabb avatar ruiromano avatar znoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerbi-powershell-modules's Issues

Special char issue? (dont know if it is PS,REST or visual issue)

I am using this great module to automate some reports for a customer!. Thanks a lot!

The issue I have is that characters special to danish

æ ø å

are not shown correctly... it shows ? instead like this picture:
image

I see it both in query and in reports.
I have tried to modify the powershell module to use another charset, but I wasnt successful, now before I spend more time on it, I want to ask if you know why this happens?

Does PBI not support these chars?
Can I somehow see the raw data to check if it is the visual or the data?

Problem with Creating Data Sets

I am attempting to create a new data set with multiple tables. When I do this, some tables return a 400 bad request error and I'm not certain why.

This one works:

@{
    name    =  "ClientConnection"
    columns = @(
        @{ name = "Date";       dataType = "DateTime" },
        @{ name = "ClientType"; dataType = "String" },
        @{ name = "Count";      dataType = "Int64" }                    
     )
 }

But this one doesn't:

@{
    name    = "OneDrivesDeployed"
    columns = @(
        @{ name = "Date";     datatype = "DateTime" },
        @{ name = "Active";   datatype = "Int64" },
        @{ name = "Inactive"; datatype = "Int64" }
    )
}

What's the functional difference here? This could just be an issue with constraints in PowerBI and not an issue with the module itself, but I'm unable to find why this might fail.

New-PBIGroupUser error when using -groupUserAccessRight Member

Command:
New-PBIGroupUser -authToken $token -groupId $groupId -emailAddress $email -groupUserAccessRight Member

Error:
Invoke-PBIRequest : The remote server returned an error: (400) Bad Request. -
'{"error":{"code":"UnsupportedAccessRightError","pbi.error":{"code":"UnsupportedAccessRightError","parameters":{},"details":[]}}}'
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\2.0.1.3\PowerBIPS.psm1:501 char:12

  • ... $result = Invoke-PBIRequest -authToken $authToken -method Post -res ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WebException
    • FullyQualifiedErrorId : System.Net.WebException,Invoke-PBIRequest

The CurrentCatalog XML/A property was not specified.

Hi, thank you for the cool powershell modules, it works well when the data is embedded in the PBIX but gets the error below if the data is located in the Power BI Service.

Export-PBIDesktopToCSV in this command $modelTables = Invoke-SQLCommand -providerName "System.Data.OleDb" -connectionString $ssasConnStr -executeType "Query" -commandText "select [Name] from `$SYSTEM.TMSCHEMA_TABLES".

Thanks, Rick

Clear-PBITableRows with parameters

Hey - not sure if thats possible but can we set a parameter to Clear-PBITableRows command and say want to delete only a subset of data and not everything?

Thanks,
Shabbir

Copy-PBIReports doesn't allow special character

Hi,

I'm using copy-pbireports to rename a report as something else (sometimes contain special characters for Spanish/French). (This works with Import-PBIFile) Is there a workaround for this please?

Invoke-PBIRequest : The remote server returned an error: (400) Bad Request. - '{"error":{"code":"BadRequest","message":"Bad Request","details":[{"message":"Unable to translate bytes [E1] at index 121 from
specified code page to Unicode.","target":"request"}]}}'
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\2.0.1.5\PowerBIPS.psm1:1749 char:11

  • ... $res = Invoke-PBIRequest -authToken $authToken -method Post -gro ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WebException
    • FullyQualifiedErrorId : System.Net.WebException,Invoke-PBIRequest

Thanks.

parameter name mismatch

Get-PBIDataSet -authToken $authToken
Get-PBIDataSet -authToken $authToken -name "DataSetName"
Get-PBIDataSet -authToken $authToken -name "DataSetName" -includeDefinition -includeTables

Doesn't match the readme

And I can't get it to work even using -name :(

Login and retrieve token via Powershell to use for Clear-PBITableRows

#Login to Power BI
$username = "[email protected]"
$password = "ENCRYPTED PASSWORD"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $username,($password | ConvertTo-SecureString)
Login-PowerBI -Credential $cred
#Retrieve token while logged in
$PowerBIToken = Get-PowerBIAccessToken -AsString
#Trying to clear table with retrieved token
Clear-PBITableRows -authToken $PowerBIToken -DataSetId "f666h111-e553-8f64-7428-72vr74sdf57j" -TableName "RealTimeData"
#Disconnect from Power BI
Disconnect-PowerBIServiceAccount

Above code works to login my account to Power BI.
I´ve managed to store PowerBIAccessToken to a variable.
But I can´t use that variable as token when trying to clear the data.
I recieve below error:

Invoke-PBIRequest : The remote server returned an error: (403) Forbidden. - ''
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\PowerBIPS.psm1:1410 char:5
+ Invoke-PBIRequest -authToken $authToken -method Delete -resource ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WebException
+ FullyQualifiedErrorId : System.Net.WebException,Invoke-PBIRequest

Uploading of dataset Datetime type

When i use Out-PowerBI to upload the result for the column that are set to datetime cannot be used in Hierarchy (by month, yeah, etc)

When i upload the CVS of the same dataset using GetData from PowerBi, i get the options. (same In PowerBi Desktop)

using Out-PowerBI:

image

Using GetData

image

I also tried using Out-PowerBi with the CSV and its the same problem.

Is this a limitation or there is something im missing?

Error using Import-PBIFile

Very useful module, I'm using a number of the functions successfully, however I'm encountering a problem with the Import-PBIFile function. Specifically when I run this...

$Groups = Get-PBIGroup
$GroupId = $Groups[1].id.ToString()
$SourceFile = "T:\IT reporting\Power BI\DataModel.pbix"

Import-PBIFile -filePath $SourceFile -nameConflict Overwrite -groupId $GroupId -authToken $authToken -dataSetName "test" 

I get the following error

Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\1.3.4.0\PowerBIPS.psm1:1244 char:12
+ ...   $result = Invoke-RestMethod -Uri $url -Headers $headers -Method Pos ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

The file exists, the file path is correct, I am an owner of the group

Any ideas where I'm going wrong? Thanks!

Export-PBIReport: "Cannot find a provider with the name" in case no destinationFolder is passed

The default value of the destinationFolder variable in Export-PBIReport makes problems for me.

PS C:\Users\f.moeller> Export-PBIReport
Split-Path : Cannot find a provider with the name '
<#
.SYNOPSIS
        Download reports as PBIX files to the specified folder.
.EXAMPLE
        Export-PBIReport -authToken $authToken -reports $reports -destinationFolder $destinationFolder
.PARAMETER AuthToken
    The authorization token required to comunicate with the PowerBI APIs
        Use 'Get-PBIAuthToken' to get the authorization token string
.PARAMETER ReportIds
        An array of strings with the report IDs to download
.PARAMETER Reportnames
        An array of strings with the report names to download
.PARAMETER destinationFolder
        A string with the path to the destination folder
#>
        [CmdletBinding()]
        param(
                [Parameter(Mandatory=$false)] [string] $authToken,
                [Parameter(Mandatory=$false)] [string[]] $reportIds,
                [Parameter(Mandatory=$false)] [string[]] $reportNames,
                [Parameter(Mandatory=$false)] [string] $destinationFolder = (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent),
                [Parameter(Mandatory=$false)] [int] $timeout = 300
        )

    $authToken = Resolve-PowerBIAuthToken $authToken
        $headers = Get-PowerBIRequestHeader $authToken
    # Get all reports from the current workspace
        $allReports = @(Get-PBIReport -authToken $authToken)
    $reportsToProcess = $allReports
    # Filter the reports if the -reportIds or -reportNames is passed
    if ($reportIds -ne $null) {
                $reportsToProcess = $reportsToProcess |? { $reportIds -contains $_.id }
        }
    elseif ($reportNames -ne $null) {
                $reportsToProcess = $reportsToProcess |? { $reportNames -contains $_.name }
        }
    # Export the reports
    if ($reportsToProcess.Count -ne 0)
    {
         # Ensure the Output folder exists
        if (-not (Test-Path $destinationFolder))
        {
            [System.IO.Directory]'.
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\1.3.3.0\PowerBIPS.psm1:1276 char:64
+ ... onFolder = (Split-Path -Path $MyInvocation.MyCommand.Definition -Pare ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (
<#
.SYNOPSIS...m.IO.Directory]:String) [Split-Path], ProviderNotFoundException
    + FullyQualifiedErrorId : ProviderNotFound,Microsoft.PowerShell.Commands.SplitPathCommand

PS C:\Users\f.moeller>

If one supplies a value it does not give any errors.

Suggestion

You could remove the ADAL libraries from your module and add AzureRM.profile as a dependency.
Right now, PowerBIPS can't be used with the latest AzureRM because PowerBIPS uses an older version of ADAL.

No error or status message with datarefresh

I am using this the refresh the dataset in power bi. It works pretty well and simple so thanks. But I don't get an error or status message. So i have to check in powerBI if the data is refrehed. And it hard to find out why it fails. Is there a way to catch the status/ Error?

-pbiDesktopWindowName

can someone explain what is this? I tried to use a .pbix file but it does not work.

Microsoft.IdentityModel.Clients.ActiveDirectory.dll is downloaded when not available

The function 'Get-PBIAuthToken' calls the function 'Ensure-ActiveDirectoryDll' to download Microsoft.IdentityModel.Clients.ActiveDirectory.dll if it is not available.

This poses an issue when you want to use this module in Azure automation or any other sandboxed environment.

Basically there are 3 options:

  1. include the Microsoft.IdentityModel.Clients.ActiveDirectory.dll in the module and load it using the manifest and make minor modifications to 'Get-PBIAuthToken'
  2. or use the existing https://github.com/tiander/OMSsearchAPI AzureActiveDirectory module published by @Tiander (written by @eamonoreilly). But then a couple of functions needs to be re-written as 'Get-PBIAuthToken' returns the token and reconstructs the header using 'Get-PowerBIRequestHeader' whereas the 'Get-AzureADtoken' function in the AzureActiveDirectory module already includes the bearer.
    Note that the 'Get-AzureADtoken' function also has the clientID set to a fixed guide and does not allow it to be set using the ADcredential parameterset, so this function will need some rework as well

I want to demo this module at the ExpertsLive.nl event, so how do we proceed?
Can I create a pull request to make the needed changes? What do you prefer?
Personally (since the AzureActiveDirectory module is not published in its own repo, I would choose option 1)

Thanks,
Stijn

Release latest code to powershell gallery

Are you planning to release the latest code the powershell gallery any time soon? There are several changes (specifying the group/workspace in some cmdlets and a few new cmdlets) that I would like to use.

Thanks.

Windows 10 1803 Hang

Thanks for the awesome module, however, my PS ISE seems to hang randomly between 10-30 minutes after executing the first PowerBIPS Cmdlet.

Get-PBIDataSetFromPBIDesktop error

Hi,
I§m getting following error while using Get-PBIDataSetFromPBIDesktop

PS C:\WINDOWS\system32> Get-PBIDataSetFromPBIDesktop -datasetName "PushDataSet" -pbiDesktopWindowName "ds_test_PushDataSet"
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS.Tools\PowerBIPS.Tools.psm1:473 char:9

  •     $props = @{
    
  •     ~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Name Value


tables {System.Collections.Hashtable, System.Collections.Hashtable}
name PushDataSet
relationships {$null}

PowerBI.Tools version: 1.0.2.2
Power BI Desktop version: 2.83.5894.961 64-bit

Convert-PowerBIDesktopToASTabula

I get an error when attempting to use this cmdlet
You cannot call a method on a null-valued expression.

At C:\Users\XXXX\Documents\WindowsPowerShell\Modules\PowerBIPS.Tools\1.0.2.2\PowerBIPS.Tools.psm1:199 char:9
+         $database.Model.DataSources.Clear()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 

Request-PBIDatasetRefresh started failing

I started encountering an issue using the following about two weeks ago. It had been working fine, but then I started seeing an exception without any code changes.

$pbiResponse = Request-PBIDatasetRefresh -authToken $authToken -dataset $datasetId -groupId $groupId

I believe the default of GET is applied to method so I was wondering if that became a problem for some reason or the default target url is having problems. Any ideas here?

Exception:

[Error] ERROR: Invoke-RestMethod : {"error":{"code":"PowerBIEntityNotFound","pbi.error":{"code":"PowerBIEntityNotFound","parameters":{},"details":[],"exceptionCulprit":1}}}At D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1:2375 char:19+ ... $result = Invoke-RestMethod -Uri $url -Headers $headers -Method $me ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (Method: GET, Reques\u2026PowerShell/6.2.6}:HttpRequestMessage) [Invoke-RestMethod], HttpResponseException+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommandScript stack trace:at Invoke-PBIRequest, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2375at Get-PBIDataSet, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 908at Request-PBIDatasetRefresh, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2015at , D:\home\site\wwwroot\RefreshData\run.ps1: line 39Microsoft.PowerShell.Commands.HttpResponseException: Response status code does not indicate success: 404 (Not Found).at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : Result: ERROR: Invoke-RestMethod : {"error":{"code":"PowerBIEntityNotFound","pbi.error":{"code":"PowerBIEntityNotFound","parameters":{},"details":[],"exceptionCulprit":1}}}At D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1:2375 char:19+ ... $result = Invoke-RestMethod -Uri $url -Headers $headers -Method $me ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (Method: GET, Reques\u2026PowerShell/6.2.6}:HttpRequestMessage) [Invoke-RestMethod], HttpResponseException+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommandScript stack trace:at Invoke-PBIRequest, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2375at Get-PBIDataSet, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 908at Request-PBIDatasetRefresh, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2015at , D:\home\site\wwwroot\RefreshData\run.ps1: line 39Microsoft.PowerShell.Commands.HttpResponseException: Response status code does not indicate success: 404 (Not Found).at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)Exception: Response status code does not indicate success: 404 (Not Found).Stack: at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
2020-08-27T19:04:41.664 [Error] ERROR: Invoke-RestMethod : {"Message":"API is not accessible for application"}At D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1:2375 char:19+ ... $result = Invoke-RestMethod -Uri $url -Headers $headers -Method $me ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (Method: POST, Reque\u2026PowerShell/6.2.6}:HttpRequestMessage) [Invoke-RestMethod], HttpResponseException+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommandScript stack trace:at Invoke-PBIRequest, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2375at Request-PBIDatasetRefresh, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2018at , D:\home\site\wwwroot\RefreshData\run.ps1: line 39Microsoft.PowerShell.Commands.HttpResponseException: Response status code does not indicate success: 403 (Forbidden).at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : Result: ERROR: Invoke-RestMethod : {"Message":"API is not accessible for application"}At D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1:2375 char:19+ ... $result = Invoke-RestMethod -Uri $url -Headers $headers -Method $me ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (Method: POST, Reque\u2026PowerShell/6.2.6}:HttpRequestMessage) [Invoke-RestMethod], HttpResponseException+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommandScript stack trace:at Invoke-PBIRequest, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2375at Request-PBIDatasetRefresh, D:\home\site\wwwroot\PSModules\powerbips.2.0.4.5\PowerBIPS.psm1: line 2018at

Add-PowerBIDataset functionality misleading

From the conversation today with Kay, it sounds like the Add-PowerBIDataset cmdlet does not add a standard Power BI Data Ser, but a special 'Push' Data Set (or something like that). If true, please update the cmdlet documentation to call that out more clearly.

Get-PBIGroupUsers returns a 401 error

I'm getting the following error when I run Get-PBIGroupUsers

Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\1.3.4.0\PowerBIPS.psm1:421 char:12

  • ... $users = Invoke-RestMethod -Uri (Get-PowerBIRequestUrl -scope "use ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Other functions work; only when I remove the comment # below do I get the error

$clientid = MyClientID

$authToken = Get-PBIAuthToken -ClientId $clientid -Credential (new-object System.Management.Automation.PSCredential("<username>",(ConvertTo-SecureString -String "<password>" -AsPlainText -Force)))

$pbiGroups=  Get-PBIGroup
foreach ($pbiGroup in $pbiGroups) {
    echo $pbiGroup.name
    Set-PBIGroup -name $pbiGroup.name
    #Get-PBIGroupUsers -authToken $authToken
}

Import-PBIFile Cuts Off Filenames with Special Characters

When using the Import-PBIFile cmdlet with a file that contains an ampersand, the resulting report and dataset name gets cutoff.

Example:

Original Filename: "Business R&A Adoption.pbix"
Imported Report and Dataset Name: "Business R"
Expected Report and Dataset Name: "Business R&A Adoption"

Force TLS1.2

Please add this line in your psm1 file to force TLS1.2.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

PowerBI API no longer accepts 1.1.

Best regards,
Alex

Cannot get the access token, AcquireTokenAsync returned null

Since saturday the 21st we are receiving the error "Cannot get the access token, AcquireTokenAsync returned null" while there were no changes on our side.

We are using the username/password combination and are using the powershell cmd to schedule a refresh of the dataset every night. Any idea what could be wrong?

Get Current Workspace

I was looking at the new docs, and I noticed the commands Get-PBIWorkspace and Set-PBIWorkspace. However when I tried them out, I didn't see "My Workspace" listed. Is that because it is listed on another name?
I am curious as to how I explicitly set the current workspace to be "My Workspace", get its id, etc?

This is great stuff by the way.

Loading an assembly required for interactive user authentication failed

Hi, I ran into a problem that you might be able to help me with. When I run the script (PowerShell ISE, stand alone or VS 2015) I get the following error : Exception calling “AcquireToken” with “4” argument(s): “Loading an assembly required for interactive user authentication
failed. Make sure assembly ‘Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35’ exist
Any suggestions on how to fix it, I’ve tried downloading it, installing it in the GAC but still without any success ?

Update-PBIDatasetDatasources error

When I try to run:
Get-PBIDataSet -name "Teste1" | Update-PBIDatasetDatasources -datasourceType Sql -originalServer "azrsql01001\sql" -originalDatabase "database1" -targetServer "sql01" -targetDatabase "database2"

I get the error:
Invoke-PBIRequest : The remote server returned an error: (400) Bad Request. - '{"error":{"code":"BadRequest","message":"Bad Request","details":[{"message":"Bad JSON escape sequence: \\s. Path 'updateDetails[0].datasourceSelector.connectionDetails.server', line 14, position 44.","target":"updateDatasourcesRequest.updateDetails[0].datasourceSelector.connectionDetails.server"},{"message":"'updateDatasourcesRequest' is a required parameter","target":"updateDatasourcesRequest"}]}}' At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\2.0.4.2\PowerBIPS.psm1:2193 char:3 Invoke-PBIRequest -authToken $authToken -method Post -resourc ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Write-Error], WebException FullyQualifiedErrorId : System.Net.WebException,Invoke-PBIRequest

How to access another Azure AD tenant

Hi,

I can use Get-PBIAuthToken without any issue to access my own corporate Active directory. However, when using Get-PBIAuthToken -tenantId "xxx.onmicrosoft.com" I still get the login dialog of my corporate Azure AD and not the one of "xxx.onmicrosoft.com".

What do I have to do to login with another Azure AD? In the browser using Powerbi.com the relevant users has all needed permissions.
Could you please provide some steps?

Thank you

Convert-PowerBIDesktopToASTabular

Convert-PowerBIDesktopToASTabular -pbiDesktopWindowName "MYFILE*" -outputPath "$currentPath\SSAS" -removeInternalPBITables -Verbose

VERBOSE: Processing PBIDesktop file: 'MYFILE'
Exception setting "CompatibilityLevel": "The database compatibility level of 1400 is below the minimal compatability le
vel of 1000000 needed for [model 'Model']::[DefaultPowerBIDataSourceVersion]."
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS.Tools\1.0.2.2\PowerBIPS.Tools.psm1:202 char:9
+         $database.CompatibilityLevel = $compatibilityLevel
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : ExceptionWhenSetting

Crashes Windows PowerShell ISE

I've run two commands from this module, "Get-PBIAuthToken" and "Out-PowerBI", and while both complete Windows PowerShell ISE crashes immediately thereafter. Can't even move the ISE window.

Convert-PowerBIDesktopToASTabular fails if there are referenced queries

Hello, Convert-PowerBIDesktopToASTabular (both using pbit or desktop app) fails to generate a valid model.bim if the pbix uses referenced queries. The referencing query expression is written as an single space instead of the actual query found in the pbix.

"partitions": [ { "name": "Referenced Table1-9200782a-7d17-4f56-a077-b910dbc65797", "mode": "import", "source": { "type": "m", "expression": " " } } ],

Attached is a pbix with a single column empty table, not loaded to model, and a query that references the former and loads to model. Also in the same zip is the results from Convert-PowerBIDesktopToASTabular.

Reference Test.zip

Authenticate with Service Principal - Error

Running this script:

$applicationid ="xxxxxxx"
$principalPassword = ConvertTo-SecureString "xxxxx" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($applicationid, $principalPassword)

Connect-PowerBIServiceAccount -ServicePrincipal -Credential $psCred

Keep getting this error:

Connect-PowerBIServiceAccount : One or more errors occurred.
At line:23 char:1

  • Connect-PowerBIServiceAccount -ServicePrincipal -Credential $psCred
  •   + CategoryInfo          : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-PowerBIServic 
     eAccount], AggregateException
      + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount
    

Error - Could not load file or assembly

On two machines, after executing the following in PowerShell ISE as administrator I receive the following error. One machine is Win 8.1 and the other is Win 10. Any idea why it cannot load Microsoft.IdentityModel.Clients.ActiveDirectory.dll? I tried to import the module from both GitHub and the powershell gallery. I'm very excited about using your module. Thank you for your support and assistance.

Executing this in PowerShell ISE
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Install-Module powerbips
Import-Module powerbips

I receive this error on two different machines:

Import-Module : Could not load file or assembly
'file:///C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\powerbips\Microsoft.IdentityModel.Clients.ActiveDirectory.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
At line:5 char:1

  • Import-Module powerbips
  • - CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException
    - FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
    

New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".

Just stumbled on the PowerBIPS module this morning. I am trying to shape the script in a customized way which fits my situation within PowerBi. I have been sitting here for hours trying to figure out this error message:

New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".

Whenever I try to execute the below command or just simply calling Get-PBIAuthToken, my error gets flagged.

$data | Out-PowerBI -authToken $authToken -dataSetName "CSVSales" -tableName "Sales" it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.