Skip to content

Instantly share code, notes, and snippets.

@ryanwebjackson
Created October 27, 2017 19:38
Show Gist options
  • Save ryanwebjackson/de4f7f6640d92e61edd74c7440422652 to your computer and use it in GitHub Desktop.
Save ryanwebjackson/de4f7f6640d92e61edd74c7440422652 to your computer and use it in GitHub Desktop.
$rootDriveAsString = Get-PSDrive
| Where-Object { $_.Provider.Name -eq "FileSystem" }
| Where-Object { (Get-WmiObject Win32_OperatingSystem).SystemDirectory.Contains($_.Root) -and $_.Root -ne "" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment