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

Does not initialize properly on PowerShell Core #40

Closed
mpodwysocki opened this issue Nov 30, 2018 · 2 comments
Closed

Does not initialize properly on PowerShell Core #40

mpodwysocki opened this issue Nov 30, 2018 · 2 comments

Comments

@mpodwysocki
Copy link

Using PowerShell Core, currently version 6.1.1, z does not initialize properly with the following error:

Cannot index into a null array.
At C:\Program Files\PowerShell\Modules\z\1.1.9\z.psm1:655 char:1
+ $global:options['CustomArgumentCompleters']['z:JumpPath'] = $Completi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

Reproduction Steps:

Install-Module -Name z
Import-Module z

Workaround steps is to initialize the dictionary properly for the CustomArgumentCompleters:

if (-not $global:options['CustomArgumentCompleters']) { 
  $global:options = @{CustomArgumentCompleters = @{}} 
}

What should be the proper answer here?

@badmotorfinger
Copy link
Owner

badmotorfinger commented Dec 1, 2018

This does not happen for "normal" Powershell. I also do not have Powershell Core installed. Happy to accept a pull request for this :)

@marcinsmialek
Copy link

There are no issues with current z and PS Core 7

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

No branches or pull requests

3 participants