Created
October 3, 2024 04:52
-
-
Save embarq/c1c971745e84c0a02b9c6416d95ce8fd to your computer and use it in GitHub Desktop.
Windows tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$targetfolder='C:\Users\' | |
$dataColl = @() | |
gci -force $targetfolder -ErrorAction SilentlyContinue | ? { $_ -is [io.directoryinfo] } | % { | |
$len = 0 | |
gci -recurse -force $_.fullname -ErrorAction SilentlyContinue | % { $len += $_.length } | |
$filesCount = (gci -recurse -force $_.fullname -File -ErrorAction SilentlyContinue | Measure-Object).Count | |
$dataObject = New-Object PSObject -Property @{ | |
Folder = $_.fullname | |
SizeGb = ('{0:N3}' -f ($len / 1Gb)) -as [single] | |
filesCount=$filesCount | |
} | |
$dataColl += $dataObject | |
} | |
$dataColl | Out-GridView -Title "Subfolder sizes and number of files" | |
Read-Host -Prompt "Press Enter to exit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh int ip reset C:\RESETLOG.txt | |
netsh winsock reset | |
ipconfig /flushdns | |
Read-Host -Prompt "Press Enter to exit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment