O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Troubleshooting Network Issues

One of the problems with troubleshooting networking issues in Windows Server 2008 and Windows Vista is the large number of items that the operating system treats as network adapters.

To deal with this issue, use the GetActiveNicAndConfig.ps1 script. Begin with the param statement, as you often do, but instead of evaluating the value of the $computer variable as in previous scripts, this time set the default value of the $computer variable to be the name of the computer contained in the env: system variable. The rest of the param statement is similar to other scripts: Define a -help switch and a -full switch. This line of code is displayed here:

param($computer = $env:computername, [switch]$full, [switch]$help)

Define ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required