
Suresh Kumar
asked on
output of netstat -r in Powersshell HTML
when you run netstat -r in powershell..it gives the output like this
========================== ========== ========== ========== ========== =========
Interface List
11...a4 ba db f5 3a 09 ......Intel(R) 82567LM-3 Gigabit Network Connection
1......................... ..Software Loopback Interface 1
========================== ========== ========== ========== ========== =========
IPv4 Route Table
========================== ========== ========== ========== ========== =========
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.24.22.131 172.24.22.180 10
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
172.24.22.128 255.255.255.128 On-link 172.24.22.180 266
172.24.22.180 255.255.255.255 On-link 172.24.22.180 266
172.24.22.255 255.255.255.255 On-link 172.24.22.180 266
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 172.24.22.180 266
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 172.24.22.180 266
========================== ========== ========== ========== ========== =========
Persistent Routes:
None
IPv6 Route Table
========================== ========== ========== ========== ========== =========
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
1 306 ff00::/8 On-link
========================== ========== ========== ========== ========== =========
Persistent Routes:
None
Need a powershell script to run the netstat-r command and output in the above format in HTML
==========================
Interface List
11...a4 ba db f5 3a 09 ......Intel(R) 82567LM-3 Gigabit Network Connection
1.........................
==========================
IPv4 Route Table
==========================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.24.22.131 172.24.22.180 10
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
172.24.22.128 255.255.255.128 On-link 172.24.22.180 266
172.24.22.180 255.255.255.255 On-link 172.24.22.180 266
172.24.22.255 255.255.255.255 On-link 172.24.22.180 266
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 172.24.22.180 266
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 172.24.22.180 266
==========================
Persistent Routes:
None
IPv6 Route Table
==========================
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
1 306 ff00::/8 On-link
==========================
Persistent Routes:
None
Need a powershell script to run the netstat-r command and output in the above format in HTML

netstat-r | out-file "C:\exmpale\netstat.html" won't loog good thought, csv would look better with the columns
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.

Also, others have gone through this before. You could use the script here:
https://gallery.technet.microsoft.com/scriptcenter/Get-NetworkStatistics-66057d71
and pipe to ConvertTo-HTML.
https://gallery.technet.microsoft.com/scriptcenter/Get-NetworkStatistics-66057d71
and pipe to ConvertTo-HTML.