Skip to content

Commit e64bcd7

Browse files
committed
Defer adding DiskMethods type to info_disk function
1 parent 07cce61 commit e64bcd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

winfetch.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ $cimSession = New-CimSession
183183
$buildVersion = "$([System.Environment]::OSVersion.Version)"
184184
$os = Get-CimInstance -ClassName Win32_OperatingSystem -Property Caption,OSArchitecture -CimSession $cimSession
185185
$GAP = 3
186-
Add-Type -TypeDefinition @'
186+
$diskMethodsType = @'
187187
using System;
188188
using System.ComponentModel;
189189
using System.Runtime.InteropServices;
@@ -736,6 +736,7 @@ function info_memory {
736736

737737
# ===== DISK USAGE =====
738738
function info_disk {
739+
Add-Type $diskMethodsType
739740
[System.Collections.ArrayList]$lines = @()
740741

741742
function to_units($value) {

0 commit comments

Comments
 (0)