Excel催化剂开源第47波-Excel与PowerBIDeskTop互通互联之第一篇( 五 )

}

}

// Get the command line - can be null if we don't have permissions

// but should have permission for PowerBI msmdsrv as it will have been

// launched by the current user.

string cmdLine = null;

if (process["CommandLine"] != null)

{

cmdLine = process["CommandLine"].ToString();

try

{

var rex = new System.Text.RegularExpressions.Regex("-s\\s\"(?.*)\"");

var m = rex.Matches(cmdLine);

if (m.Count == 0) continue;

string msmdsrvPath = m[0].Groups["path"].Captures[0].Value;

推荐阅读