forked from Stephanevg/PSClassUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing issue Stephanevg#104
- Loading branch information
Showing
4 changed files
with
139 additions
and
29 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Get-CULoadedEnum { | ||
<# | ||
.SYNOPSIS | ||
Return all loaded classes in the current PSSession | ||
.DESCRIPTION | ||
Return all loaded classes in the current PSSession | ||
.EXAMPLE | ||
PS C:\> <example usage> | ||
Explanation of what the example does | ||
.INPUTS | ||
String | ||
.OUTPUTS | ||
ASTDocument | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
[String[]]$Enum = '*' | ||
) | ||
|
||
BEGIN { | ||
} | ||
|
||
PROCESS { | ||
|
||
Foreach ( $Name in $Enum ) { | ||
|
||
[Array]$LoadedEnums = [AppDomain]::CurrentDomain.GetAssemblies() | | ||
Where-Object { $_.GetCustomAttributes($false) | | ||
Where-Object { $_ -is [System.Management.Automation.DynamicClassImplementationAssemblyAttribute]} } | | ||
ForEach-Object { | ||
$_.GetTypes() | | ||
Where-Object IsPublic | Where-Object { $_.Name -like $Name -and $_.baseType.Name -eq 'Enum' } | | ||
Select-Object name,@{l = 'Path'; e = {($_.Module.ScopeName.Replace([char]0x29F9, '\').replace([char]0x589, ':')) -replace '^\\', ''}} | ||
} | ||
|
||
Foreach ( $Enum in ($LoadedEnums | Select-Object -Property Path -Unique) ) { | ||
#Get-CURaw -Path $Class.Path | ||
Get-CUAst -Path $Enum.Path | ||
} | ||
|
||
} | ||
} | ||
|
||
END { | ||
} | ||
} |
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
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