Last active
November 16, 2020 23:38
-
-
Save aetos382/5da9fee760b3ca35581e85dae656481e to your computer and use it in GitHub Desktop.
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
| $keys = | |
| Get-ChildItem -LiteralPath 'Registry::HKEY_CLASSES_ROOT' | | |
| Add-Member -MemberType ScriptProperty -Name 'LeafName' -Value { Split-Path -Leaf $this.PSPath } -Force -PassThru | | |
| ? { $_.LeafName.StartsWith('.') } | | |
| % { | |
| $progIds = @($_.GetValue('')) | |
| $key = Get-Item -LiteralPath (Join-Path -Path $_.PSPath -ChildPath 'OpenWithProgIds') -ErrorAction Ignore | |
| if ($key) { | |
| $progIds += @($key.GetValueNames()) | |
| } | |
| foreach ($progId in $progIds) { | |
| $progIdKey = Get-Item -LiteralPath "Registry::HKEY_CLASSES_ROOT\${progId}" -ErrorAction Ignore | |
| if ($progIdKey) { | |
| $description = $progIdKey.GetValue('') | |
| if ($description) { | |
| $_ | Add-Member -MemberType NoteProperty -Name 'Description' -Value $description -Force | |
| break | |
| } | |
| } | |
| } | |
| $_ | |
| } | |
| $extensions = $keys | | |
| Sort-Object -Property @{ Expression = { $_.LeafName.Length }; Descending = $true } | | |
| Select-Object -First 100 -Property 'LeafName', 'Description' | |
| $extensions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment