Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Finding Drive #8

Open
dprice opened this issue Feb 6, 2017 · 4 comments
Open

Error Finding Drive #8

dprice opened this issue Feb 6, 2017 · 4 comments

Comments

@dprice
Copy link

dprice commented Feb 6, 2017

I installed PoShLucecene via Install-Module -Name PoShLucene and tried searching for a variety of file extensions on my C: and D: drives. Each time I get a similiar error at the command line as the UI shows no errors occurred:

D:\dnx\dnx-util [master ↓ +9 ~10 -1 !]> Invoke-PoshLucene
Get-ChildItem : Cannot find path 'D:\dnx\dnx-util\-rec -File' because it does not exist.
At line:1 char:1
+ Get-ChildItem "-rec -File"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\dnx\dnx-util\-rec -File:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Any ideas on what's happening?

Thanks,
Derek

@dfinke
Copy link
Owner

dfinke commented Feb 6, 2017

Can you post a screen shot of the UI of what you typed in?

@dprice
Copy link
Author

dprice commented Feb 6, 2017

Here's my command line:

D:\dnx\dnx-util [master ↓ +9 ~10 -1 !]> Invoke-PoshLucene
Get-ChildItem : Cannot find path 'D:\dnx\dnx-util\-rec -File' because it does not exist.
At line:1 char:1
+ Get-ChildItem "-rec -File"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\dnx\dnx-util\-rec -File:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Cannot find drive. A drive with the name '-rec d' does not exist.
At line:1 char:1
+ Get-ChildItem "-rec d:\dnx-util\*.ps1 -File"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-rec d:String) [Get-ChildItem], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

And my screenshot:
poshluceneerror

@dfinke
Copy link
Owner

dfinke commented Feb 7, 2017

Bummer, weird. I tried some things, but have no clue yet.

Is your D: drive a mounted network drive?

What happens if you type this in the PS console?

ls -rec d:\dnx-util\*.ps1 -File | % fullname

That's where the code is failing in the psm1.

@dprice
Copy link
Author

dprice commented Feb 7, 2017

I think I figured out what's going on here. I had an alias set for ls for this function Get-ChildItem-Color. I'm assuming that you were using ls and not Get-ChildItem in your module, which is why it failed on my system.

I was able to run it successfully this morning but did notice an error at the prompt after doing what seemed a successful search:

C:\Users\derek.price> Invoke-PoshLucene
Index operation failed; the array index evaluated to null.
At C:\Program Files\WindowsPowerShell\Modules\PoShLucene\1.0\PoShLucene.psm1:257 char:13
+             $lastResult = $script:totalDocs[$script:lastSelectedResul ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArrayIndex

Honestly - I love what you've done here! I think the UX could be slightly improved on for the Target field. It would be nice if you could easily select a path rather than type it in. Some folders on Windows can be very painful to type and get correct. Might be nice to be able to provide the Target when calling Invoke-PoshLucene since the folder navigation is easy with tabbing.

Thanks again for the fast help!
--Derek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants