KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.84k stars 454 forks source link

Zero Divided Error (if Disk size is Zero) #670

Closed Kejuntrap closed 4 years ago

Kejuntrap commented 4 years ago

I'm submitting a ... (check one with "x")

[x ] bug report
[ ] new distro request

Bug report output of ScreenFetch -v is below

 screenfetch -v
Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

ScreenFetch : System Specs occupies more lines than the Ascii Art resource selected
At line:1 char:1
+ ScreenFetch
+ ~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Screenfetch

                         ....::::       Zaha_99J@DESKTOP-******
                 ....::::::::::::       OS: Microsoft Windows 10 Home 64-bit
        ....:::: ::::::::::::::::       Kernel: 10.0.18362
....:::::::::::: ::::::::::::::::       Uptime: 0d 0h 3m 20s
:::::::::::::::: ::::::::::::::::       Motherboard: ASUSTeK COMPUTER INC. H170-PRO
:::::::::::::::: ::::::::::::::::       Shell: PowerShell 5.1.18362.628
:::::::::::::::: ::::::::::::::::       Resolution: 1920 x 1080
:::::::::::::::: ::::::::::::::::       Window Manager: DWM
................ ................       Font: Segoe UI
:::::::::::::::: ::::::::::::::::       CPU: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
:::::::::::::::: ::::::::::::::::       GPU NVIDIA GeForce GTX 970
:::::::::::::::: ::::::::::::::::       RAM: 2813MB / 16304 MB (17%)
'''':::::::::::: ::::::::::::::::       Disk C: 343GB / 476GB (72%)
        '''':::: ::::::::::::::::       Disk E: 0GB / 0GB (72%)
                 ''''::::::::::::       Disk F: 0GB / 0GB (72%)
                         ''''::::       Disk G: 0GB / 0GB (72%)
                                        Disk H: 0GB / 0GB (72%)
                                        Disk I: 0GB / 0GB (72%)
                                        Disk J: 0GB / 0GB (72%)

If you have a zero-byte disk, you get a division by zero error.

0GB is NOT an error. The size of Disk D,E,F,G,H,I and J is Zero.

darealshinji commented 4 years ago

https://github.com/JulianChow94/Windows-screenFetch I think this is the repository you should make your bug report. ;)