external help file | Module Name | online version | schema |
---|---|---|---|
PSFunctionTools-help.xml |
PSFunctionTools |
2.0.0 |
Get function attributes like cmdletbinding.
Get-FunctionAttribute [-Name] <String> -Path <String> [-ToString] [<CommonParameters>]
This command can be used to get function attributes such as cmdletbinding or alias settings.
PS C:\> Get-FunctionAttribute -path c:\scripts\Get-ParameterBlock.ps1 -Name Get-ParameterBlock
Type : cmdletbinding
NamedArguments : {}
PositionalArguments : {}
String : [cmdletbinding()]
Function : Get-ParameterBlock
Path : C:\scripts\Get-ParameterBlock.ps1
Type : alias
NamedArguments : {}
PositionalArguments : {"gpb"}
String : [alias("gpb")]
Function : Get-ParameterBlock
Path : C:\scripts\Get-ParameterBlock.ps1
Type : OutputType
NamedArguments : {}
PositionalArguments : {"ParamBlockAst", "String"}
String : [OutputType("ParamBlockAst","String")]
Function : Get-ParameterBlock
Path : C:\scripts\PSFunctionTools\functions\public\Get-ParameterB
lock.ps1
Get detailed function attributes.
PS C:\> Get-FunctionName C:\scripts\New-OneDriveLink.ps1 -Detailed | Get-FunctionAttribute -ToString
[cmdletbinding(SupportsShouldProcess)]
[alias("odl")]
Get function attributes as a string.
Specify the name of the PowerShell function.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the path to the .ps1 or .psm1 file.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Display the attribute block as a string.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/