PowerShell Quick Tips : Get-NetIPConfiguration instead of IpConfig

preview_player
Показать описание
Quick tips in PowerShell. In this video ill be going over how to use get-netipconfiguration to replace using ipconfig to get information on your network interfaces.

Tags:
PowerShell
GUI
Programming
Scripting
Automating
JackedProgrammer
Coding
Рекомендации по теме
Комментарии
Автор

Hi, very new to PS and scripting...how can I write a PS script to display and output the Get-NetipConfiguration information (specifically, comp name, ip address and DNS entries) for a list of computers in a txt file as an input for the PS script?

waynemaranduik
Автор

What? You can select easily from ipconfig /all using powershell variables... Just do something like

$currentip = ipconfig /all

$currentip[18].Substring(39)

You hit the 18th line in the string, and you cut the string using substring untill you hit the ip address, then you can set that data to a new variable and voila, you have filtered on ipconfig.
This is just a bit of comedy on my part. Agree it's easier to deal with objects, but sometimes when using powershell we have to filter in ways that aren't efficient but gets the job done. :D

ulroxvladtepes