Remove-Item : Cannot find path 'C:\Users\Daniel\.cdHistory' because it does not exist.
At C:\Program Files (x86)\WindowsPowerShell\Modules\z\1.1.3\z.psm1:458 char:3
+ Remove-Item $cdHistory
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Daniel\.cdHistory:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
The above error appears when first changing directory after the module is installed (i.e. when .cdHistory doest not yet exist.) Although a .cdHistory file is created and subsequent directory changes work fine, the error does seem a bit scary, especially for first time users. Also, WriteHistoryToDisk() is slightly simplified by removing the temporary file, as it seems unnecessary.
The above error appears when first changing directory after the module is installed (i.e. when
.cdHistory
doest not yet exist.) Although a .cdHistory file is created and subsequent directory changes work fine, the error does seem a bit scary, especially for first time users. Also,WriteHistoryToDisk()
is slightly simplified by removing the temporary file, as it seems unnecessary.