Created
January 7, 2019 21:49
-
-
Save MahouShoujoMivutilde/4428db7faee4e46c6fdb590c078085b7 to your computer and use it in GitHub Desktop.
A script to automatically hide dotfiles (on all drives in all subfolders recursively) on windows machine. Multithreaded.
This file contains 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
workflow hideDotfilesOnAllDrives { | |
function hide($mask) { | |
$sw = [Diagnostics.Stopwatch]::StartNew() | |
ATTRIB +H /s /d $mask | |
$sw.Stop() | |
echo "$mask - $($sw.Elapsed.TotalSeconds)s" | |
} | |
foreach -parallel ($d in get-psdrive -p "FileSystem" | select root) { | |
hide("$($d.root).*") | |
} | |
} | |
hideDotfilesOnAllDrives |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
...It also useful to set this to run automatically in background on idle in task scheduler.