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

Cannot index into a null array #2

Open
turturis opened this issue Sep 23, 2019 · 4 comments
Open

Cannot index into a null array #2

turturis opened this issue Sep 23, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@turturis
Copy link

turturis commented Sep 23, 2019

Describe the bug
When running any of the examples from Sample Commands such as:
Get-Phone -Name SEP706E6D10904E -Basic

i am met with:

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Public\Get-SettingsFile.ps1:32 char:3
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Public\Get-SettingsFile.ps1:32 char:3
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Private\Invoke-CUCMAPIRequest.ps1:22 char:2
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm_pat ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

I am on windows 10 using the most current version of the download as of today's date.

This happens if i am using ISE or PowerGUI.

It will ultimately produce the desired output but causes these errors along the way.

@tealise tealise added the bug Something isn't working label Sep 23, 2019
@tealise
Copy link
Owner

tealise commented Sep 23, 2019

Hi, did you run any command outside of a script or at the least the Get-SettingsFile command? It needs to be run interactively first so it can save your preferences before it will be usable in a script.

By running the Get-SettingsFile command, that will generate the Settings.xml file and save it in C:\Users\*\AppData\Local\AdminTools. Once that is complete, it should work without error.

Let me know how that works out.

@turturis
Copy link
Author

turturis commented Oct 4, 2019

worked. thank you.

@turturis
Copy link
Author

turturis commented Oct 4, 2019

I changed the CUCM_PATH value in the psm1 file and it didnt work. i found that it is both the psm1 and the psd1 file. once i changed the path in the psd1 file, then it worked.

is there a reason it is in both locations? is the CUCM_PATH necessary in the psm1 file?

@Kettoch
Copy link

Kettoch commented Oct 28, 2021

If you import the module using the psm1 then this error occurs.

If you import the module with the psd1 then it works correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants