PowerShell: Locking Drive Content

This will not hide drive letters but prohibit access to drive content. You need administrative privileges to set this setting. function Hide-DriveContent { param($DriveLetter) $key = @{ Path = ‘HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer’ Name = ‘NoViewOnDrive’ } if ($DriveLetter -eq $null) { Remove-ItemProperty @key } else { $mask = 0 $DriveLetter | ForEach-Object { $_.toUpper()[0] } | Sort-Object…

Continue Reading