Closed wekempf closed 6 years ago
The first time you import the module on a new system you receive the following.
PS> import-module z Get-Content : Cannot find path 'C:\Users\bkempf\.cdHistory' because it does not exist. At C:\Users\bkempf\Documents\WindowsPowerShell\Modules\z\1.1.7\z.psm1:624 char:20 + ... global:history += Get-Content -Path $cdHistory -Encoding UTF8 | ? { ( ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\bkempf\.cdHistory:String) [Get-Content], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
I don't have time to look at the code or provide a PR, but simply wrapping this functionality with a Test-Path check would fix it.
Thanks for taking the time to log this issue.
Issue resolved. You can grab the latest version for the PowerShell gallery.
The first time you import the module on a new system you receive the following.
I don't have time to look at the code or provide a PR, but simply wrapping this functionality with a Test-Path check would fix it.