Skip to content

Instantly share code, notes, and snippets.

@Hugoberry

Hugoberry/MSMDSRVport.m

Last active Mar 21, 2017
Embed
What would you like to do?
Power Query finding port number of the running embeded tabular instance
()=>
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
You can’t perform that action at this time.