PowerShell Quick Tips : Get-NetIPConfiguration instead of IpConfig
HTML-код
- Опубликовано: 8 сен 2024
- 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.
Twitch: / jackedprogrammer
Tags:
PowerShell
GUI
Programming
Scripting
Automating
JackedProgrammer
Coding
Very useful stuff
Nice tip!
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