lptstr / winfetch

🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
MIT License
1.35k stars 76 forks source link

New IP Retreival Method #178

Open Carterpersall opened 1 year ago

Carterpersall commented 1 year ago

Speed:

rashil2000 commented 1 year ago

Why not use Resolve-DnsName? It will help avoid needless text parsing and it supposedly faster too.

Carterpersall commented 1 year ago

Why not use Resolve-DnsName? It will help avoid needless text parsing and it supposedly faster too.

For some reason, I was not aware of the CmdLet's existence. Though in initial testing, I'm seeing a few issues:

  1. It does not return the public IP like nslookup does
  2. Running Resolve-DnsName on a cold cache is about 5x slower than nslookup, while on subsequent runs Resolve-DnsName uses its cached values which only takes a few milliseconds

I'll definitely look a bit further into this though and see what I find (maybe reverse engineering it is possible)

Carterpersall commented 1 year ago

Unfortunately, it seems that Resolve-DnsName is not in PowerShell Core yet, which means the source code is not available. And without the source code, there isn't much I can do to diagnose its speed issues.