Share via


Output IPCONFIG result to HTML file Using PowerShell


Output IPCONFIG result to HTML file Using PowerShell


Summary

This TechNet Wiki is based on the TechNet forum post - Output IPCONFIG to HTML

Requirement

To save IPCONFIG result as HTML file.

Solution


$file = "c:\temp\a.html"
$ipconfig=ipconfig /all |%{"$_<br/>"}

$body=@"
<html>
    <head>
    <title>Network Report</title>
    </head>
<body>
    <h1>IPConfig /All</h1>
    <pre>$ipconfig</pre>
</body>
</html>
"@
$body | Out-File $file
. $file

Result

Code Contributor

This Form Post is answered by jrv