< Back
Get-CUClass
Post
NAME Get-CUClass
SYNOPSIS
This function returns all classes, loaded in memory or present in a ps1 or psm1 file.
SYNTAX
Get-CUClass [-ClassName <Object>] [[-Path] <FileInfo[]>] [-Raw] [<CommonParameters>]
DESCRIPTION
By default, the function will return all loaded classes in the current PSSession.
You can specify a file path to explore the classes present in a ps1 or psm1 file.
PARAMETERS
-ClassName <Object>
Specify the name of the class.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Path <FileInfo[]>
The path of a file containing PowerShell Classes. Accept values from the pipeline.
Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Raw [<SwitchParameter>]
The raw switch will display the raw content of the Class.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
Accepts type [System.IO.FileInfo]
OUTPUTS
Return type [CuClass]
NOTES
Author: St????????phane van Gulick
Participate & contribute --> https://github.com/Stephanevg/PSClassUtils
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-CUClass
Return all classes alreay loaded in current PSSession.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-CUClass -ClassName CUClass
Return the particuluar CUCLass.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-CUClass -Path .\\test.psm1,.\\test2.psm1
Return all classes present in the test.psm1 and test2.psm1 file.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>Get-CUClass -Path .\\test.psm1 -ClassName test
Return test class present in the test.psm1 file.
-------------------------- EXAMPLE 5 --------------------------
PS C:\\PSClassUtils>Get-ChildItem -recurse | Get-CUClass
Return all classes, recursively, present in the C:\\PSClassUtils Folder.
RELATED LINKS
SYNOPSIS
This function returns all classes, loaded in memory or present in a ps1 or psm1 file.
SYNTAX
Get-CUClass [-ClassName <Object>] [[-Path] <FileInfo[]>] [-Raw] [<CommonParameters>]
DESCRIPTION
By default, the function will return all loaded classes in the current PSSession.
You can specify a file path to explore the classes present in a ps1 or psm1 file.
PARAMETERS
-ClassName <Object>
Specify the name of the class.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Path <FileInfo[]>
The path of a file containing PowerShell Classes. Accept values from the pipeline.
Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Raw [<SwitchParameter>]
The raw switch will display the raw content of the Class.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
Accepts type [System.IO.FileInfo]
OUTPUTS
Return type [CuClass]
NOTES
Author: St????????phane van Gulick
Participate & contribute --> https://github.com/Stephanevg/PSClassUtils
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-CUClass
Return all classes alreay loaded in current PSSession.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-CUClass -ClassName CUClass
Return the particuluar CUCLass.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-CUClass -Path .\\test.psm1,.\\test2.psm1
Return all classes present in the test.psm1 and test2.psm1 file.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>Get-CUClass -Path .\\test.psm1 -ClassName test
Return test class present in the test.psm1 file.
-------------------------- EXAMPLE 5 --------------------------
PS C:\\PSClassUtils>Get-ChildItem -recurse | Get-CUClass
Return all classes, recursively, present in the C:\\PSClassUtils Folder.
RELATED LINKS