I went ahead and opened a ticket, but this is driving me crazy. Basically, I get this toast error Value Cannot Be Null (Parameter ‘s’) whenever I create a new module Pic: . And the Folder and files get created but it is not immediately added to the Modules page. If I restart the service it appears to then detect the module, but I don’t like functional issues like this, if I don’t know the root cause.
I’m not certain but I think you should be able to see info about the module when you click the little plus (+) next to the module. Mine show empty:
I have been debugging and I’ve seen a lot of different issues, but I have been able to explain most of it. I would provide more info, but I don’t really know any more. I would appreciate any assistance anyone can provide. Thanks.
I discovered several hours ago that when I view the $env:PSModulePath variable value while using any environment terminal, it shows the same directory 3 times:
C:\Users\USERNAME\Documents\PowerShell\Modules;
C:\Program Files\PowerShell\Modules; C:\Program Files (x86)\Universal\Modules; C:\Program Files (x86)\Universal\Modules;
C:\Program Files\WindowsPowerShell\Modules;
C:\Windows\system32\WindowsPowerShell\v1.0\Modules;
C:\ProgramData\UniversalAutomation\Repository\Modules; C:\Program Files (x86)\Universal\Modules
I’ve been trying to both figure out why and to stop it.
Not sure this matters but I noticed on the windows PATH (and I realize that isn’t the ModulePath), there are two backslashes in this path: C:\Program Files (x86)\Universal\Modules\Universal:
Is that correct? I’ve removed it and everything still functions. But my issue persists.
I don’t really have any progress to add but I thought it was worth sharing while I continue to dig.
I know this is an old thread, but I have an automation which code has remained unchanged for the past 6months or so, it runs on a schedule monthly and collects data from various sources (api, sql, AD etc), then spits out some excel files, and uploads them to sharepoint (via pnponline).
Now the last run failed with the error message in this thread:
Value cannot be null. (Parameter 's')
I ran the script locally in vscode, and the whole thing worked without issue, so not sure what’s going on. One thing I can only really put it down to though is the fact that I’ve upgraded to 5.6.1 since the last time the schedule ran.
Does anyone have any more details on the error above and what was causing it?
In my scheduled job i’m using Invoke-SQLCmd2 (function not a module), a splunk api module, PSPolly, PnPOnline, MGGraph, ExportExcel and ActiveDirectory. Most of which are in my PSU Modules folder.
My next step is to add more verbose logging to my script so I can figure out at exactly which point this is being thrown, but figured i’d also post here to see if anyone else had ideas given that it’s come up before.
To note, other jobs and schedules are working fine.