external help file | Module Name | online version | schema |
---|---|---|---|
PSFunctionTools-help.xml |
PSFunctionTools |
2.0.0 |
Test the validity of a PowerShell function name.
Test-FunctionName [-Name] <String> [-Quiet] [<CommonParameters>]
PowerShell function names should follow naming convention of Verb-Noun. The verb should be a standard verb that you see with Get-Verb. Use this command in your scripting automation to validate a PowerShell function name.
If the name passes validation it will be written to the pipeline. Or you can use the -Quiet parameter to return a traditional boolean result.
PS C:\> Test-FunctionName Test-Widget
Test-Widget
Because the name passes validation, it is written to the pipeline.
PS C:\> Test-FunctionName -Name stop-foo | Format-FunctionName
Stop-Foo
Test the function name and format the result.
PS C:\> Test-FunctionName kill-system -Quiet
False
Test with boolean result.
Specify a function name.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Get a boolean test result.
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/