Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize info_disks #164

Merged
merged 2 commits into from
Nov 2, 2022
Merged

Conversation

Carterpersall
Copy link
Contributor

  • 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

- 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
Copy link
Member

@jcwillox jcwillox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, tested and works for all my drives 👍

@rashil2000
Copy link
Member

Very cool!

This is basically the same implementation which was removed in #94, the only difference being it uses [System.IO.DriveInfo]::GetDrives() (which is faster) instead of Get-CimInstance Win32_LogicalDisk -Property Size,FreeSpace (WMI calls are always a bottleneck).

winfetch.ps1 Outdated Show resolved Hide resolved
winfetch.ps1 Outdated Show resolved Hide resolved
@rashil2000 rashil2000 merged commit 54f6a7c into lptstr:master Nov 2, 2022
@Carterpersall Carterpersall deleted the Optimize-Disks branch November 2, 2022 19:27
rashil2000 added a commit that referenced this pull request Nov 3, 2022
* 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 <[email protected]>

Co-authored-by: Rashil Gandhi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants