$scripts = Get-ChildItem -Path $PSScriptRoot -Recurse -Filter *.ps1 | 
                Where-Object FullName -NotMatch '.Tests.'


Describe -Tag 'Help' 'Help' {

    foreach ($script in $scripts) {

        Context "[$(($script.Name).TrimEnd('.ps1'))] Validate Comment Based Help" {
            # Dot Source script
            . .\$script.FullName

            $functionHelp = Get-Help ($script.Name).TrimEnd('.ps1') -Full

            It 'Contains Description' {
                $functionHelp.Description | Should Not BeNullOrEmpty
            }
            
            It 'Contains Synopsis' {
                $functionHelp.Synopsis | Should Not BeNullOrEmpty
            }

            It 'Contains Examples' {
                $functionHelp.Examples | Should Not BeNullOrEmpty
            }

            It 'Contains Parameters' {
                $functionHelp.Parameters | Should Not BeNullOrEmpty
            }
        }
    }
}


$scripts = Get-ChildItem -Path $PSScriptRoot -Recurse -Filter *.ps1 | 
                Where-Object FullName -NotMatch '.Tests.'


Describe -Tag 'Help' 'Help' {

    foreach ($script in $scripts) {

        Context "[$($script.BaseName)] Validate Comment Based Help" {
            # Dot Source script
            . $($script.FullName)

            $functionHelp = Get-Help ($script.Name).TrimEnd('.ps1') -Full

            It 'Contains Description' {
                $functionHelp.Description | Should Not BeNullOrEmpty
            }
            
            It 'Contains Synopsis' {
                $functionHelp.Synopsis | Should Not BeNullOrEmpty
            }

            It 'Contains Examples' {
                $functionHelp.Examples | Should Not BeNullOrEmpty
            }

            It 'Contains Parameters' {
                $functionHelp.Parameters | Should Not BeNullOrEmpty
            }
        }
    }
}


Use basename instead of trim
Use basename instead of trim

Trim removed function names that ended in p.

Dot source fixed. No need for .\ when using full path
