Last active
March 21, 2017 14:40
-
-
Save Hugoberry/ff92f9f9d0c39c75eae60ee7b7f083d1 to your computer and use it in GitHub Desktop.
Power Query finding port number of the running embeded tabular instance
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
()=> | |
let | |
//Assume current user is the one with latest [Date accessed] folder in C:\Users | |
CurrentUser = Table.FirstN( | |
Table.Sort(Folder.Contents("C:\Users"), | |
{{"Date accessed", Order.Descending}}), | |
1)[Name]{0}, | |
//Read the contents of file msmdsrv.port.txt from subfolder of AnalysisServicesWorkspaces | |
Port = Lines.FromBinary( | |
Table.SelectRows( | |
Folder.Files("C:\Users\"& | |
CurrentUser& | |
"\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces"), | |
each ([Name] = "msmdsrv.port.txt"))[Content]{0},null,null,1200){0} | |
in | |
Port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment