31 lines
862 B
PowerShell
31 lines
862 B
PowerShell
Function Get-FunctionNames {
|
|
<#
|
|
.SYNOPSIS
|
|
Collects all function names from filenames. Assumes Test-FunctionNames properly ran.
|
|
|
|
.EXAMPLE
|
|
Get-FunctionNames .\Alkami.PowerShell.IIS\Public
|
|
|
|
.PARAMETER FolderPath
|
|
The name of the folder to examine all files under.
|
|
#>
|
|
[CmdletBinding()]
|
|
Param (
|
|
[String]$FolderPath
|
|
)
|
|
process {
|
|
$functionNames = @()
|
|
$verbs = Get-Verb | Select-Object -ExpandProperty Verb
|
|
|
|
$files = (Get-ChildItem -Path $FolderPath *.ps1)
|
|
foreach($file in $files) {
|
|
if ($file.BaseName.ToLower().EndsWith(".tests") -or $file.BaseName.ToLower().EndsWith(".test")) {
|
|
Write-Verbose "skipping function names of test $file"
|
|
} else {
|
|
$functionNames += $file.BaseName
|
|
}
|
|
}
|
|
|
|
return $functionNames
|
|
}
|
|
} |