I’m trying to deploy a dashboard/app on 5.0.16. I started with moving over an existing app from 4.4.1 but it wouldn’t start, so I’m trying to go minimum viable code at this point, just to load something.
Module files/directory layout are below. Module is in $Repository\Modules<modulename><moduleversion>.
The .psm1 file has a single function in it, which is pretty much from the examples. New-UDApp was throwing an error Cannot process argument transformation on parameter 'Theme'.
, which is why -Theme is being specified with an empty hashtable.
function New-IamApp {
New-UDApp -Content {
New-UDButton -Text 'Click Me' -OnClick {
Show-UDToast "Ouch!"
}
} -Navigation (
New-UDList -Children {
New-UDListItem -Label "Home"
New-UDListItem -Label "Getting Started" -Children {
New-UDListItem -Label "Installation" -OnClick {}
New-UDListItem -Label "Usage" -OnClick {}
New-UDListItem -Label "FAQs" -OnClick {}
New-UDListItem -Label "System Requirements" -OnClick {}
New-UDListItem -Label "Purchasing" -OnClick {}
}
}
) -NavigationLayout permanent -Theme @{}
}
The dashboards.ps1
file included with the module is 1 line:
New-PSUApp -Name 'PowerIAM' -BaseUrl '/PowerIAM' -Module 'PowerIAM' -Command 'New-IamApp'
When attempting to start this app, the following shows up in the log:
The term 'D:\UniversalAutomation\Repository\dashboards\PowerIAM\PowerIAM.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The error is correct that there is no file in $Repository\dashboards, but I don’t understand why it’s trying to reference that file. It’s worth noting that installing apps from the gallery results in the same behavior. For example, after installing App.NetworkUtilities:
[11/28/2024 5:28:18 PM] [Error] [App-Network Utilities] Failed to get app. App was null. Make sure to return an app from your script.
[11/28/2024 5:28:18 PM] [Error] [App-Network Utilities] Startup: at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin, ExecutionContext context)
at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin)
at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[11/28/2024 5:28:18 PM] [Error] [App-Network Utilities] Startup: at <ScriptBlock>, <No file>: line 1
[11/28/2024 5:28:18 PM] [Error] [App-Network Utilities] Startup: The term 'D:\UniversalAutomation\Repository\dashboards\Network Utilities\Network Utilities.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I’m at a loss as to what I’m missing in the docs to get this working, so any help would be appreciated.
It’s worth noting that when I do create $Repository\dashboards\PowerIAM\PowerIAM.ps1
and in that file import the PowerIAM module and call New-IamApp
then the dashboard loads. I don’t understand this behavior, however.
0.2.0
│ PowerIAM.psd1
│ PowerIAM.psm1
│
└───.universal
dashboards.ps1
Product: PowerShell Universal
Version: 5.0.16