Created
November 15, 2024 19:29
-
-
Save MHaggis/a5b0af617ae62ded5a2ec4f15a96f4ac to your computer and use it in GitHub Desktop.
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
$associations = @() | |
$registryPaths = @( | |
"HKLM:\Software\Classes", | |
"HKCU:\Software\Classes" | |
) | |
foreach ($path in $registryPaths) { | |
Get-ChildItem $path | ForEach-Object { | |
if ($_.PSChildName -like ".*") { | |
$extension = $_.PSChildName | |
$progId = (Get-ItemProperty -Path "$($_.PSPath)" -ErrorAction SilentlyContinue).'(Default)' | |
if ($progId) { | |
$commandPath = (Get-ItemProperty -Path "$path\$progId\shell\open\command" -ErrorAction SilentlyContinue).'(Default)' | |
$associations += [PSCustomObject]@{ | |
Extension = $extension | |
ProgID = $progId | |
AssociatedApp = $commandPath | |
} | |
} | |
} | |
} | |
} | |
$associations | Out-GridView -Title "File Extensions and Associated Applications" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment