Startup: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided

Hi, I am fighting with this one error that I can seem to figure out with New-UDGrid. This was working in UniversalDashboard but i have not been able to get this to work in PU. This code snippet below is outside of the New-UDDashboard. The $CacheDatalist is properly populated and verified in regular powershell.

the error shown below happens on line 186 which is the $gridapp = New-UDGrid

what am i missing here? Am I using a different definition of New-UDGrid?

------- Code snippet --------

   $CacheDatalist = [System.Collections.Generic.List[pscustomobject]]::new()
.
. populate $CacheDatalist  (verified in powershell to have the correct data)
.
.
$gridapp = New-UDGrid -Id 'gridapp' -Title "Release Information" -PageSize 30 -Headers @('ApplicationName', 'CI', 'QA', 'RC', 'HF', 'QC', 'BETA', 'BLUE', 'GREEN') -Properties @('ApplicationName', 'CI', 'QA', 'RC', 'HF', 'QC', 'BETA', 'BLUE', 'GREEN') -Endpoint {
    $CacheDatalist | Where-Object -Property 'Type' -EQ "Application" | Out-UDGridData
}

------ Error in logs ------

Startup:    at System.Management.Automation.CmdletParameterBinderController.ThrowAmbiguousParameterSetException(UInt32 parameterSetFlags, MergedCommandParameterMetadata bindableParameters)
   at System.Management.Automation.CmdletParameterBinderController.ValidateParameterSets(Boolean prePipelineInput, Boolean setDefault)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
   at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
   at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
   at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
   at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
--- End of stack trace from previous location ---
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
   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)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Startup: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
Startup: at <ScriptBlock>, C:\ProgramData\UniversalAutomation\Repository\dashboards\version\version.ps1: line 186
at <ScriptBlock>, <No file>: line 1

Another dashboard that I started looking at moving over has the same kind of New-UDGrid.

$gridservices = New-UDGrid -Id ‘gridservices’ -Title “Services Heartbeats” -PageSize 30 -Endpoint { }

and I am getting the same kind of error. im guessing im using an incorrect definition of New-UDGrid

Startup: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
Startup: at <ScriptBlock>, C:\ProgramData\UniversalAutomation\Repository\dashboards\updown\updown.ps1: line 3
at <ScriptBlock>, <No file>: line 1

UDTable is has replaced UDGrid in v3. Try this:

$CacheDatalist = [System.Collections.Generic.List[pscustomobject]]::new()
# populate $CacheDatalist  (verified in powershell to have the correct data)
$Columns = @('ApplicationName', 'CI', 'QA', 'RC', 'HF', 'QC', 'BETA', 'BLUE', 'GREEN') | ForEach-Object {
   New-UDTableColumn -Property $_ -Title $_
}
$gridapp = New-UDTable -Id 'gridapp' -Title "Release Information" -PageSize 30 -Columns -Data ($CacheDatalist | Where-Object -Property 'Type' -EQ "Application")

Thanks Adam,

do I need to add the $Columns after the -Columns in the New-UDTable statement?

also is there a place where I can look at the current V3 Powershell Universal commands? I am getting confused with the older UD commands.

I dont see where its clear what all the commands are.

All the components are documented here: https://docs.powershelluniversal.com/userinterfaces/dashboards/components

And i did fat finger that. You do need the columns added to New-UDTable.

$Columns = @('ApplicationName', 'CI', 'QA', 'RC', 'HF', 'QC', 'BETA', 'BLUE', 'GREEN') | ForEach-Object {
   New-UDTableColumn -Property $_ -Title $_
}
$gridapp = New-UDTable -Id 'gridapp' -Title "Release Information" -PageSize 30 -Columns $Columns -Data ($CacheDatalist | Where-Object -Property 'Type' -EQ "Application")

Here’s all the table documentation: Table - PowerShell Universal