vexx32 / PSKoans

A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.
GNU General Public License v3.0
1.73k stars 176 forks source link

Undesired error with unresolved koan AboutPSProviders #434

Closed peetrike closed 3 years ago

peetrike commented 3 years ago

Describe "Koan Bug, Issue, or Help Request"

Show-Karma -Topic AboutPSProviders

emits following error:

Invoke-Koan: C:\Program Files\WindowsPowerShell\Modules\PSKoans\0.67.1\Public\Get-Karma.ps1:111
Line |
 111 |                  $PesterTests = Invoke-Koan @{
     |                                 ~~~~~~~~~~~~~~
     | This command cannot find a matching alias because an alias with the definition '____' does not exist.

The error appears with both PowerShell 7 and 5.1

Context "The Problematic Assertions"

The problem is with line https://github.com/vexx32/PSKoans/blob/c1ad5c98d63d0dbe02a50d4dd56d6a7fd5923810/PSKoans/Koans/Cmdlets%201/AboutPSProviders.Koans.ps1#L78

as soon as previous line gets correct cmdlet name, the error ceases to exist.

It would be good idea to add -ErrorAction SilentlyContinue to Get-Alias on that line.

vexx32 commented 3 years ago

Huh, haven't seen this come up before. Strange. Thanks for reporting, should be fairly straightforward to fix. 💖