Forked from guyinacube/Get-PowerBI-DiagPort.ps1
Last active
September 19, 2019 06:39
-
-
Save MarcusWegener/62e56ddc80d8ff8c7743d9283908cd5f to your computer and use it in GitHub Desktop.
Get the Power BI Diagnostic port using PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#BITTE ÖFFNEN SIE ZUERST IHRE POWER BI-DESKTOP-DATEI, BEVOR SIE DIESES SCRIPT AUSFÜHREN!!!!! | |
#Erhält eine Liste der Prozess-IDs für alle offenen Power BI Desktop-Dateien | |
$processids = Get-Process msmdsrv -erroraction 'silentlycontinue' | Select-Object -ExpandProperty id | |
#Durchläuft alle Prozess-IDs, ruft den Diagnoseport für jede Datei ab und generiert schließlich die Verbindung, die beim Herstellen einer Verbindung zum Vertipaq-Modell verwendet werden kann. | |
if($processids) | |
{ | |
foreach($processid in $processids) | |
{ | |
$pbidiagnosticport = Get-NetTCPConnection | ? {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0") -and ($_.OwningProcess -eq $processid)} | Select-Object -ExpandProperty LocalPort | |
Write-Host "Geben Sie dies in das Werkzeug Ihrer Wahl ein -- localhost:$pbidiagnosticport" -ForegroundColor Green | |
} | |
} | |
else | |
{ | |
Write-Host "Bitte öffnen Sie eine Power BI-Datei!" -ForegroundColor Red | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment