Closed peetrike closed 3 years ago
Show-Karma -Topic AboutpsProviders
with PowerShell 5.1 it gets following error:
Invoke-Koan : Cannot find drive. A drive with the name 'TEMP' does not exist. At C:\Program Files\WindowsPowerShell\Modules\PSKoans\0.67.1\Public\Get-Karma.ps1:111 char:32 + $PesterTests = Invoke-Koan @{ + ~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (TEMP:String) [Invoke-Koan], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Invoke-Koan
https://github.com/vexx32/PSKoans/blob/c1ad5c98d63d0dbe02a50d4dd56d6a7fd5923810/PSKoans/Koans/Cmdlets%201/AboutPSProviders.Koans.ps1#L137 uses PSDrive TEMP: that is not defined in PowerShell 5.1.
Instead, it could use New-TemporaryFile cmdlet. That should work both in PowerShell 5.1 and 7.x
Alternatively, the TEMP: PSDrive should be created, when not existing...
Ah, good catch. I think given the intention of the topic, checking for and creating the TEMP: drive if need be would be preferable.
Describe "Koan Bug, Issue, or Help Request"
with PowerShell 5.1 it gets following error:
Context "The Problematic Assertions"
https://github.com/vexx32/PSKoans/blob/c1ad5c98d63d0dbe02a50d4dd56d6a7fd5923810/PSKoans/Koans/Cmdlets%201/AboutPSProviders.Koans.ps1#L137 uses PSDrive TEMP: that is not defined in PowerShell 5.1.
Instead, it could use New-TemporaryFile cmdlet. That should work both in PowerShell 5.1 and 7.x