* New Method Working
- Replaces the `Add-Type` implementation with one that uses `System.IO.DriveInfo`
- For once, my new implementation is actually shorter than the previous one
- Significantly faster on both fast and slow systems
* Apply suggestions from code review
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
* Create .gitignore
- Created `.gitignore` with a list of possibly problematic paths
- Created this as I started using VSCode's internal debugger for the project for some troubleshooting which created a `.vscode` folder with some configuration files
* Slim Down .gitignore
- removed irrelevant entries from `.gitignore`
- Kept Desktop.ini and .DS_Store though due to them causing problems quite often
* New Method Working
- Implemented new method to find user's real IPv4 address using a recursive mess of .NET witchcraft that somehow ends up being much faster
- Gets all network adapters using `[System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()`
- Checks if each adapter is online, has a gateway address, and is not a loopback adapter
- Then checks if adapter is a WiFi or Ethernet adapter using `NetworkInterfaceType`
- Then iterates through each Unicast address, and checks if the address is for InterNetwork communication
- Then checks if the $local_ip variable has already been set, and if not, sets it to the IP returned
- This is because under some circumstances, multiple IP's can be returned
- It grabbed the ZeroTier IP address on my PC, which shouldn't occur
- This bug also exists with the previous implementation, and I'm not sure if there is an easy way to fix it without manually filtering out certain adapter names
Speed:
- PowerShell 5:
- 400ms -> 43ms
- 9.3x Faster
- PowerShell 7:
- 459ms -> 56ms
- 8.2x Faster
Possible Extra Checks:
- Check `$ni.GetIPProperties().UnicastAddresses.DhcpLeaseLifetime` for if time is less than 24 hours
* Apply suggestions from code review
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
* Make info_locale blazing fast
- Made info_locale speedy
- Takes the registy entries at HKCU:Control Panel\International to get region code and language code, and passes them into two very large hash tables to get the accompanying region and language values.
- TODO: Make it work when user has more than one language
- Maybe: Find a way to circumvent the very large table
- 3251 ms -> 12.43 ms
- 262x Faster
* Make large table even bigger
- Should fix any issues with missing languages as this was ripped directly from Microsoft's documentation
* Have 3 values per line on table
- Makes it easier to scroll through
* Not break when more than one language is used
- Instead of getting the value of "Languages" of HKCU:Control Panel\International\User Profile, iterates through the multi-key in case multiple languages are configured
* Better format tables
- Added even spacing between the table's values to make much easier to read
* Slight Formatting Change
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
* LInk to Neofetch
* Also remove some redundant words
Hyperfine is mentioned in the linked wiki page, there's no need to mention it here as most people probably don't really care
* Change user, host, and rowname colors to yellow for better visibility
* User@Host color actually changed now
Co-authored-by: bilditup1 <bilditup1@users.noreply.github.com>
* Show missing "winget" identifier.
The choco and scoop packages count both have the package manager identifier written next to it, but winget is missing it. This adds the identifier to keep the output consistent, if users explicitly enable winget in settings.
* "winget" changed to "system"
As the reported number does not correspond to the number of apps installed through winget (but to the number of all installed apps in the system), using "system" seems more appropriate.
* Rewrote disk_info to use Windows API calls instead of WMIC. Renamed old disk_info to disk_info_CIM.
* Moved the C# definition for disk_info to the VARIABLES section.
* Refactored the disk letter comparison section, appears to still not be working entirely.
* Fixed wrong array type for $allDiskLetters.
* Cleaned up the old disk_usage.
* Fixed a missing newline.
* Improve Windows Logo Detection
This also adds support for (the upcoming) Windows 11.
* Remove the "switchlogo" Parameter
This has become useless after our changes to the logo detection logic.
* Add a "logo" Parameter to Set a Specific Version Logo
This document was created in the early days of Winfetch when I didn't understand that one should simply use the recommended coding styles for the language, instead of trying to bring over one's preferred coding style. In any case, it has been obsolete for a while.