------ntstat -no後,去掉前面四行,將空白變成,,再依,或:切割欄位,再取出第 4 欄 (dip)
netstat -no|select -skip 4|%{$_ -replace ' {2,}',','}|%{$a=$_ -split {$_ -eq "," -or $_ -eq ":"};$a[4]}|Group-Object |Format-Table name,count
netstat -no|select -skip 4|%{$_ -replace ' {2,}',','}|%{$a=$_ -split {$_ -eq "," -or $_ -eq ":"};$a[4]}|Group|FT name,count
netstat -no|select -skip 4|%{$_ -replace ' {2,}',','}|%{$a=$_ -split {$_ -eq "," -or $_ -eq ":"};$a[4]}|Group|select name,count
沒有留言:
張貼留言