title: PowerShell with Pester Tests - No test files were found and no scriptblocks were provided
body: <p>Trying to learn Pester (v5.0.4 and PS v7.0.3).  I have these files</p>
  <p><strong>Get-Planet2.ps1</strong>:</p>
  <pre><code>function Get-Planet ([string]$Name = '*') {
      $planets = @(
          @{ Name = 'Mercury' }
          @{ Name = 'Venus'   }
          @{ Name = 'Earth'   }
          @{ Name = 'Mars'    }
          @{ Name = 'Jupiter' }
          @{ Name = 'Saturn'  }
          @{ Name = 'Uranus'  }
          @{ Name = 'Neptune' }
      ) | ForEach-Object { [PSCustomObject] $_ }
  
      $planets | Where-Object { $_.Name -like $Name }
  }
  </code></pre>
  <p><strong>Get-Planet2.Tests.ps1:</strong></p>
  <pre><code>BeforeAll { 
      # This will bring the function from the main file back to scope.
      . $PSScriptRoot/Get-Planet2.ps1
  
      param(
          [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$name,
          [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$title,
          [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$InputFile
      )
  }
  
  Describe 'Get-Planet' {
      It 'Given no parameters, it lists all 8 planets' {
          $allPlanets = Get-Planet
          $allPlanets.Count | Should -Be 8
      }
  
      It 'Earth is the third planet in our Solar System' {
          $allPlanets = Get-Planet
          $allPlanets[2].Name | Should -Be 'Earth'
      }
  
      It 'Pluto is not part of our Solar System' {
          $allPlanets = Get-Planet
          $plutos = $allPlanets | Where-Object Name -EQ 'Pluto'
          $plutos.Count | Should -Be 0
      }
  
      It 'Planets have this order: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune' {
          $allPlanets = Get-Planet
          $planetsInOrder = $allPlanets.Name -join ', ' 
          $planetsInOrder | Should -Be 'Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune'
      } 
  
  }
  </code></pre>
  <p><strong>Call-Get-Planet2.ps1:</strong></p>
  <pre><code>$here = Split-Path -Parent $MyInvocation.MyCommand.Path
  $path = &quot;$here/Get-Planet2.Tests.ps1&quot;
  $parameters = @{name = &quot;John&quot;; title = &quot;Sales&quot;; InputFile = &quot;$here/test.json&quot;}
  
  write-host &quot;Path: $path&quot;
  write-host $parameters
  
  Invoke-Pester -Script @{Path=$path;Parameters=$parameters}
  </code></pre>
  <h2><strong>My Problem:</strong></h2>
  <p>When I run Call-Get-Planet2.ps1, I ended with the below error.  I can't figure out why it is doing this.  Need guidance.  Thanks</p>
  <p><em>System.Management.Automation.RuntimeException: <strong>No test files were found and no scriptblocks were provided.</strong>
  at Invoke-Pester, /Users/myaccount/.local/share/powershell/Modules/Pester/5.0.4/Pester.psm1: line 4520
  at , /Users/myaccount/repos/myrepo/Pester/Call-Get-Planet2.ps1: line 8
  at , : line 1</em></p>