|
| 1 | +--- |
| 2 | +external help file: ClassExplorer.dll-Help.xml |
| 3 | +online version: https://github.com/SeeminglyScience/ClassExplorer/blob/master/docs/en-US/Get-AssemblyLoadContext.md |
| 4 | +schema: 2.0.0 |
| 5 | +--- |
| 6 | + |
| 7 | +# Get-AssemblyLoadContext |
| 8 | + |
| 9 | +## SYNOPSIS |
| 10 | +Gets all loaded assembly load contexts. |
| 11 | + |
| 12 | +## SYNTAX |
| 13 | + |
| 14 | +``` |
| 15 | +Get-AssemblyLoadContext [[-Name] <String>] [-Default] [-InputObject <PSObject>] |
| 16 | + [<CommonParameters>] |
| 17 | +``` |
| 18 | + |
| 19 | +## DESCRIPTION |
| 20 | +The `Get-AssemblyLoadContext` cmdlet gets all currently active assembly load |
| 21 | +contexts (ALCs), or the relevant ALCs if any parameters are specified. |
| 22 | + |
| 23 | +This command is only supported in PowerShell 7+ |
| 24 | + |
| 25 | +## EXAMPLES |
| 26 | + |
| 27 | +### -------------------------- EXAMPLE 1 -------------------------- |
| 28 | +```powershell |
| 29 | +Get-AssemblyLoadContext |
| 30 | +
|
| 31 | +# Definition ImplementingType Assemblies |
| 32 | +# ---------- ---------------- ---------- |
| 33 | +# Default System.Runtime.Loader.DefaultAssemblyLoadCon… 140 assemblies (… |
| 34 | +# <Unnamed> PowerShellRun.CustomAssemblyLoadContext 0 assemblies |
| 35 | +# Yayaml Yayaml.LoadContext 1 assembly (Yaya… |
| 36 | +``` |
| 37 | + |
| 38 | +Gets all active assembly load contexts. |
| 39 | + |
| 40 | +### -------------------------- EXAMPLE 2 -------------------------- |
| 41 | +```powershell |
| 42 | +Get-AssemblyLoadContext -Default |
| 43 | +
|
| 44 | +# Definition ImplementingType Assemblies |
| 45 | +# ---------- ---------------- ---------- |
| 46 | +# Default System.Runtime.Loader.DefaultAssemblyLoadCon… 140 assemblies (… |
| 47 | +``` |
| 48 | + |
| 49 | +Gets only the default ALC. |
| 50 | + |
| 51 | +### -------------------------- EXAMPLE 3 -------------------------- |
| 52 | +```powershell |
| 53 | +Get-AssemblyLoadContext *yam* |
| 54 | +
|
| 55 | +# Definition ImplementingType Assemblies |
| 56 | +# ---------- ---------------- ---------- |
| 57 | +# Yayaml Yayaml.LoadContext 1 assembly (Yaya… |
| 58 | +``` |
| 59 | + |
| 60 | +Gets specifically the ALCs whose name match the wildcard pattern. |
| 61 | + |
| 62 | +### -------------------------- EXAMPLE 4 -------------------------- |
| 63 | +```powershell |
| 64 | +Find-Type ConvertToYamlCommand | Get-AssemblyLoadContext |
| 65 | +
|
| 66 | +# Definition ImplementingType Assemblies |
| 67 | +# ---------- ---------------- ---------- |
| 68 | +# Yayaml Yayaml.LoadContext 1 assembly (Yaya… |
| 69 | +``` |
| 70 | + |
| 71 | +Gets the ALC associated with the type passed as pipeline input. |
| 72 | + |
| 73 | +### -------------------------- EXAMPLE 5 -------------------------- |
| 74 | +```powershell |
| 75 | +Get-AssemblyLoadContext Yayaml | Find-Type |
| 76 | +
|
| 77 | +# Namespace: Yayaml.Module |
| 78 | +# |
| 79 | +# Access Modifiers Name |
| 80 | +# ------ --------- ---- |
| 81 | +# public sealed class AddYamlFormatCommand : PSCmdlet |
| 82 | +# public sealed class ConvertFromYamlCommand : PSCmdlet |
| 83 | +# public sealed class ConvertToYamlCommand : PSCmdlet |
| 84 | +# public sealed class NewYamlSchemaCommand : PSCmdlet |
| 85 | +# public class YamlSchemaCompletionsAttribute : ArgumentCom… |
| 86 | +# … |
| 87 | +``` |
| 88 | + |
| 89 | +Uses the piped ALC as a search base for `Find-Type`. You can also use `Get-Assembly` |
| 90 | +this way. `Find-Member` however, will return the members for the ALC type itself. |
| 91 | +If you want to use the ALC as a search base, pipe to `Find-Type` first. |
| 92 | + |
| 93 | +## PARAMETERS |
| 94 | + |
| 95 | +### -Default |
| 96 | +Specifies that the default assembly load context should be emitted. |
| 97 | + |
| 98 | +```yaml |
| 99 | +Type: SwitchParameter |
| 100 | +Parameter Sets: (All) |
| 101 | +Aliases: |
| 102 | + |
| 103 | +Required: False |
| 104 | +Position: Named |
| 105 | +Default value: None |
| 106 | +Accept pipeline input: False |
| 107 | +Accept wildcard characters: False |
| 108 | +``` |
| 109 | +
|
| 110 | +### -InputObject |
| 111 | +Specifies a reflection object that should be queried for association with an |
| 112 | +assembly load context. If the object has such an association, the ALC will be |
| 113 | +emitted to the pipeline as output. |
| 114 | +
|
| 115 | +```yaml |
| 116 | +Type: PSObject |
| 117 | +Parameter Sets: (All) |
| 118 | +Aliases: |
| 119 | + |
| 120 | +Required: False |
| 121 | +Position: Named |
| 122 | +Default value: None |
| 123 | +Accept pipeline input: True (ByValue) |
| 124 | +Accept wildcard characters: False |
| 125 | +``` |
| 126 | +
|
| 127 | +### -Name |
| 128 | +Specifies the name (or wildcard pattern) of the assembly load context that should |
| 129 | +be emitted to the pipeline as output. |
| 130 | +
|
| 131 | +```yaml |
| 132 | +Type: String |
| 133 | +Parameter Sets: (All) |
| 134 | +Aliases: |
| 135 | + |
| 136 | +Required: False |
| 137 | +Position: 0 |
| 138 | +Default value: None |
| 139 | +Accept pipeline input: False |
| 140 | +Accept wildcard characters: True |
| 141 | +``` |
| 142 | +
|
| 143 | +### CommonParameters |
| 144 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 145 | +
|
| 146 | +## INPUTS |
| 147 | +
|
| 148 | +### System.Reflection.Assembly, System.Type, PSObject |
| 149 | +
|
| 150 | +If you pass reflection info objects (`Assembly`, `Type`, `MemberInfo`) to this cmdlet it will return the associated assembly load context (if applicable) |
| 151 | + |
| 152 | +If you pass any other object to this cmdlet, it will return the assembly load context associated with its type (if applicable) |
| 153 | + |
| 154 | + |
| 155 | +## OUTPUTS |
| 156 | + |
| 157 | +### System.Runtime.Loader.AssemblyLoadContext |
| 158 | + |
| 159 | +Matched assembly load contexts will be emitted to the pipeline as output. |
| 160 | + |
| 161 | +## NOTES |
| 162 | + |
| 163 | +## RELATED LINKS |
| 164 | + |
| 165 | +[Get-Assembly](Get-Assembly.md) |
| 166 | +[Find-Type](Find-Type.md) |
| 167 | +[Find-Member](Find-Member.md) |
| 168 | +[Get-Parameter](Get-Parameter.md) |
| 169 | +[Format-MemberSignature](Format-MemberSignature.md) |
| 170 | +[Invoke-Member](Invoke-Member.md) |
0 commit comments