Last active
January 15, 2025 20:20
-
-
Save xcud/4683139 to your computer and use it in GitHub Desktop.
Gets a list of the assemblies loaded into memory in the current AppDomain.
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
<# | |
.Synopsis | |
Gets a list of the assemblies loaded into memory in the current AppDomain. | |
.Example | |
PS> Get-Assemblies power -NameOnly | |
Name | |
---- | |
Microsoft.PowerShell.ConsoleHost.dll | |
Microsoft.PowerShell.Security.dll | |
Microsoft.PowerShell.Commands.Utility.dll | |
Microsoft.PowerShell.Commands.Management.dll | |
#> | |
function Get-Assemblies() { | |
param($Match, [Switch]$NamesOnly); | |
$matchingAsms = [Threading.Thread]::GetDomain().GetAssemblies() | | |
? {$_.Location -match $Match } | |
if($NamesOnly.IsPresent) { | |
$matchingAsms | select @{Name="Name"; Expression={ (dir $_.Location).Name }} | |
} | |
else { | |
$matchingAsms | |
} | |
} | |
set-alias asm Get-Assemblies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment