ironmansoftware / issues

Public Issue tracker for Ironman Software products.
https://ironmansoftware.com
32 stars 2 forks source link

environments.ps1 Cannot process command because of one or more missing mandatory parameters: Path. #3378

Closed Omzig closed 3 weeks ago

Omzig commented 3 weeks ago

Version

5.0.0-beta6 - (9424572094)

Severity

Low

Environment

Nested IIS

Steps to Reproduce

In notifications it says: Error | Invalid configuration: E:\src\psu\Beta_data\UniversalAutomation\Repository.universal\environments.ps1 | Cannot process command because of one or more missing mandatory parameters: Path.

at System.Management.Automation.CmdletParameterBinderController.PromptForMissingMandatoryParameters(Collection`1 fieldDescriptionList, Collection`1 missingMandatoryParameters)
   at System.Management.Automation.CmdletParameterBinderController.HandleUnboundMandatoryParameters(Int32 validParameterSetCount, Boolean processMissingMandatory, Boolean promptForMandatory, Boolean isPipelineInputExpected, Collection`1& missingMandatoryParameters)
   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)

Open the Environments.ps1 there seems to be line breaks in the generated file.

Expected behavior

image

Actual behavior

image

Additional Environment data

No response

Screenshots/Animations

No response

adamdriscoll commented 3 weeks ago

Is the integrated environment missing a path? It usually just defaults to Universal.Server

Omzig commented 3 weeks ago

Is the integrated environment missing a path? It usually just defaults to Universal.Server

looks like it:

New-PSUEnvironment -Name "Windows PowerShell 5.1" -Path "powershell.exe" -Variables @('*') -Description "Windows PowerShell 5.1" 
New-PSUEnvironment -Name "Integrated" -Version "7.4.2" -Variables @('*') -Description "An environment for running scripts directly in the PowerShell Universal server." 
New-PSUEnvironment -Name "Agent" -Version "7.4.2" -Path "E:\src\psu\Beta\Universal.Agent.exe" -Variables @('*') -Description "An environment for running scripts in an external PowerShell Universal agent process." 
New-PSUEnvironment -Name "PowerShell 7" -Path "pwsh" -Variables @('*') -Description "The current version of PowerShell 7." 
New-PSUEnvironment -Name "PowerShell 7.4.2" -Version "7.4.2" -Path "C:\Program Files\PowerShell\7\pwsh.exe" 
New-PSUEnvironment -Name "Windows PowerShell 5.1.17763.5820" -Version "5.1.17763.5820" -Path "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
adamdriscoll commented 3 weeks ago

Do you know how you got in this state? You should be able to add the path back in the file editor.

Omzig commented 3 weeks ago

Do you know how you got in this state? You should be able to add the path back in the file editor.

it came that way when i installed it, i did edit anything from the admin site, it just showed up in my repo

adamdriscoll commented 3 weeks ago

Was this v5? Or was it v4.2.21?

Omzig commented 3 weeks ago

oops, sorry, beta6

Omzig commented 3 weeks ago

updated ver in original post

Omzig commented 3 weeks ago

build 9474514428

OK, i figured out how to trigger this:

adamdriscoll commented 3 weeks ago

Thanks. Nice find. I also removed the mandatory on -Path since it really isn't. I've fixed the discovery.