vors / ZLocation

ZLocation is the new Jump-Location
MIT License
567 stars 29 forks source link

Exception calling "Add" with "2" argument(s) - issue after updating powershell to 7.1 #112

Closed carl-berg closed 3 years ago

carl-berg commented 3 years ago

I keep getting this issue every time i start powershell and use ZLocation:

MethodInvocationException: C:\Users\my-user\Documents\PowerShell\Modules\ZLocation\1.4.2\ZLocation.Storage.psm1:12
Line |
  12 |          $hash.add($item.path, $item.weight)
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary:
     | 'C:\Develop\Sandbox\some-directory'  Key being added: 'C:\Develop\Sandbox\some-directory'"

If i use Remove-ZLocation C:\Develop\Sandbox\some-directory it will work there after but the issue will come back every time i open a new powershell terminal

richtea commented 3 years ago

I have also been experiencing this issue since upgrading PowerShell to 7.1.

I just checked in ~/z-location.db and the path is defined in 2 separate records. I also tried deleting the DB file and starting over, but the problem re-occurred.

The folder in error is in my quick access list - I mention this because these folders appear to get loaded up by Get-FrequentFolders in ZLocation.psm1, not sure if it has any impact.

athrunsun commented 3 years ago

I'm sorry but are we waiting for sth. to merge the fix?