Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Created March 12, 2017 20:56
Embed
What would you like to do?
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