New-UDGridLayout - Installed from Market Place, getting module not found trying to import

I installed New-UDGridLayout from the Market Place, then placed the following at the top of my dashboard:

Import-Module UniversalDashboard.GridLayout

However, I am getting an error saying that it cannot import the module:

Jul 2, 2021 6:14 PM Startup: The specified module 'UniversalDashboard.GridLayout' was not loaded because no valid module file was found in any module directory. 

The term 'New-UDGridLayout' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Also, my log is spewing tons of errors along with errors on my form that was not there in a previous version: @Support - Let me know if I need to put a separate post in for the errors below:

Jul 2, 2021 6:14 PM An error occurred: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
Endpoint: dc0b16f8-ac35-45dd-95ce-3a1fce0f036a
Session: bacb1658-1d3c-4052-b352-5ba95e2d565b
File: 
Endpoint Start Line: 3
Endpoint End Line: 36
Stack Trace: at <ScriptBlock>, <No file>: line 20
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind argument to parameter 'Data' because it is null.
Endpoint: dc0b16f8-ac35-45dd-95ce-3a1fce0f036a
Session: bacb1658-1d3c-4052-b352-5ba95e2d565b
File: 
Endpoint Start Line: 3
Endpoint End Line: 36
Stack Trace: at <ScriptBlock>, <No file>: line 33
 
Jul 2, 2021 6:14 PM An error occurred: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
Endpoint: 274b9477-8d43-4ce0-8ede-5a5ecf69f8e8
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: C:\ProgramData\UniversalAutomation\Repository\NoOffersDB.ps1
Endpoint Start Line: 164
Endpoint End Line: 287
Stack Trace: at <ScriptBlock>, <No file>: line 20
 
Jul 2, 2021 6:14 PM An error occurred: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
Endpoint: 274b9477-8d43-4ce0-8ede-5a5ecf69f8e8
Session: 55dd220e-5059-4d72-b059-3163986d3b90
File: C:\ProgramData\UniversalAutomation\Repository\NoOffersDB.ps1
Endpoint Start Line: 164
Endpoint End Line: 287
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: 63dc9018-8349-4a27-8926-050eaee010ffvalidate
Session: 55dd220e-5059-4d72-b059-3163986d3b90
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: 63dc9018-8349-4a27-8926-050eaee010ffvalidate
Session: 55dd220e-5059-4d72-b059-3163986d3b90
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: 63dc9018-8349-4a27-8926-050eaee010ffvalidate
Session: 55dd220e-5059-4d72-b059-3163986d3b90
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: 63dc9018-8349-4a27-8926-050eaee010ffvalidate
Session: 55dd220e-5059-4d72-b059-3163986d3b90
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d3c20450-f4c0-4f5d-9509-8061e71ee267validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d3c20450-f4c0-4f5d-9509-8061e71ee267validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d3c20450-f4c0-4f5d-9509-8061e71ee267validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d3c20450-f4c0-4f5d-9509-8061e71ee267validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d60b13f0-ad3b-4ce1-a795-3935dfac4cc3validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d60b13f0-ad3b-4ce1-a795-3935dfac4cc3validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d60b13f0-ad3b-4ce1-a795-3935dfac4cc3validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 4
 
Jul 2, 2021 6:14 PM An error occurred: Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
Endpoint: d60b13f0-ad3b-4ce1-a795-3935dfac4cc3validate
Session: da5e917c-fa90-420f-a365-57ce9a68ce54
File: 
Endpoint Start Line: 37
Endpoint End Line: 51
Stack Trace: at <ScriptBlock>, <No file>: line 5


- This shows up on the actual dashboard: 
Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."

Thank you!

Product: PowerShell Universal
Version: 2.1.1

I found where it was installed and imported it by path.
Now I am seeing the following error:

 One or more errors occurred

The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.

Hi @Mike27 just as no-one replied yet…there is no need to load the module…well not from script, in the admin console you can download the module (custom component you need) then in the admin console you load the module into the dashboard…there is no need for hard-coding the module, will try and record a gif I am sure this is documented, or in a video…but thats how you load custom modules (components) into PSU dashboard :smile: I hope this helps

1 Like

Hey @psDevUK!

You are 100% correct, I forgot about adding them once installed through the icon.
Let me try that !

@psDevUK , so I removed the import module line and added it the proper way. After adding the module, I received this on all tabs of the dashboard in red:

Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bid%2C%20name%2C%20path%2C%20version%2C%20latest%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.


span
_@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:527602
div
I@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:529244
f@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:190387
F@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:530870
div
E@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:533007
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:263754
X@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:264561
r@http://server:5000/admin/static/js/120.19aa3a93.chunk.js:1:282
ce<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:814317
div
div
div
p<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:254851
ne@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:812795
div
m<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:376559
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:73090
G@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:78078
se@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:814427
ae@http://server:5000/admin/static/js/0.52aed0d4.chunk.js:1:19007
form
ce@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:91730
a@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:52150
M@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:808041
le@http://server:5000/admin/static/js/0.52aed0d4.chunk.js:1:19772
ie@http://server:5000/admin/static/js/0.52aed0d4.chunk.js:1:18636
f@http://server:5000/admin/static/js/96.fe4d3315.chunk.js:1:340
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:846935
Suspense
j@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:796
div
div
y@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:942610
k@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:19022
div
p<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:254851
E@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:5746
div
m<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:376559
S@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:5376
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:846935
Suspense
j@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:796
f@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:4872
y@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:5050
984/t.default@http://server:5000/admin/static/js/29.534c1a6b.chunk.js:1:24056
d@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:24770
h@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:25110
h
d@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:24770
h@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:25110
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:846935
Suspense
j@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:796
main
h@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208715
o@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208547
section
v<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208977
o@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208547
div
div
t@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:731285
X@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:53800
section
v<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208977
o@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208547
section
v<@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208977
o@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:208547
Ut@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:65023
d@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:24770
n@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:846935
Suspense
j@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:796
p@http://server:5000/admin/static/js/main.5fe21ac1.chunk.js:1:49052
l@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:224267
c@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:139285
h@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:25110
p@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:24847
s@http://server:5000/admin/static/js/20.93be5e36.chunk.js:2:60288
Ht

Then on the page I have the component, I am getting the following error:

The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.