If I write a script that includes a default parameter value and then execute the script, the value for that parameter is null. I would expect the default parameter value to be honored.
If I run this without setting the $Query parameter in the Run wizard, I get this error:
[02/28/2020 13:50:28] [ERROR] The remote server returned an error: (500) Internal Server Error.
at <ScriptBlock>, <No file>: line 5
[02/28/2020 13:50:28] [ERROR] Cannot validate argument on parameter 'InputObject'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
at <ScriptBlock>, <No file>: line 6
[02/28/2020 13:50:28] [ERROR]
However, I can set the same value in the Run wizard and the script succeeds.
Version Information
Host Operating System: Windows 10
Host PowerShell Version: Windows PowerShell 5.1
Universal Automation Version: 1.0.1
Universal Dashboard Version: 2.9.0
UD Hosting Method: (Powershell, IIS, App Service, Etc.) PowerShell
If I write a script that includes a default parameter value and then execute the script, the value for that parameter is null. I would expect the default parameter value to be honored.
Consider this script:
If I run this without setting the
$Query
parameter in the Run wizard, I get this error:However, I can set the same value in the Run wizard and the script succeeds.
Version Information