This snippet is used in the context of Alternate PowerShell Hosts.
ls C:\* -Recurse -Include '*.exe', '*.dll' -ErrorAction SilentlyContinue | % { try { $Assembly = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom($_.FullName) if ($Assembly.GetReferencedAssemblies().Name -contains 'System.Management.Automation') { $_.FullName } } catch {} }
Last updated 3 months ago