Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Created March 12, 2017 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hugoberry/1c1c96e7be7ce76d2440e0dabd8652c0 to your computer and use it in GitHub Desktop.
Save Hugoberry/1c1c96e7be7ce76d2440e0dabd8652c0 to your computer and use it in GitHub Desktop.
Getting $Embedded$ connection details in Power Query via R
##Get msmdsrv process details
msmdsrv_proc <- system2("tasklist",args = c('/fi','"imagename eq msmdsrv.exe"'), stdout=TRUE)
msmdsrv_clean<-msmdsrv_proc[-c(1,3)]
msmdsrv<-read.fwf(textConnection(msmdsrv_clean),widths=c(25,9,17,12,13),comment.char="")
##Get all TCP ports
tcp <- system2("netstat", args = c('-anop','TCP'), stdout=TRUE)
ports<-read.fwf(textConnection(tcp),skip=3,widths=c(9,23,23,16,10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment