5.2.1 - Invoke-PSUScript Change

@Support @adam

I know version 5 was a significant upgrade. Due to unforeseen circumstances, I had to upgrade these servers to the latest build. Overall, everything seems to work fine, except for a few buttons on a dashboard that call Invoke-UDScript. Here’s an example:

$uwfRUn = Invoke-PSUScript -Script 'TC\fixUWF.ps1' -uwfMachineName $txtWksNameUWF -userWhoRan $User -uwfSymptom $txtUWFsymptoms -email $userEmail

This keeps throwing the following error:

A parameter cannot be found that matches parameter name 'uwfMachineName'.

I also tried rewriting it following the documentation, but no luck:

$parameters = @{
    uwfMachineName = $txtWksNameUWF
    userWhoRan     = $User
    uwfSymptom     = $txtUWFsymptoms
    email          = $userEmail
}

$uwfScript = Get-PSUScript -Name 'TC\fixUWF.ps1'
$uwfRun = Invoke-PSUScript -Script $uwfScript -Parameters $parameters

Despite defining the parameters, the script doesn’t seem to recognize them. Below are the parameters explicitly defined in the script:

param (
    [string]$uwfMachineName,
    [string]$uwfSymptom,
    [string]$userWhoRan,
    [string]$email
)

When trying to run the script, the expected values in the UI no longer populate correctly. Any guidance or suggestions would be greatly appreciated!

Product: PowerShell Universal
Version: 5.2.1

Just verifying, you don’t see this kind of UI? If the UI doesn’t generate the form, I could see why Invoke-PSUScript wouldn’t see it.

Do you have an error notifications?

Morning @adam

I do not, not on any of my scripts. I thought maybe it was because I had 4.5.1 and 5.2.1 installed. Removed and restarted and still seeing the same thing. I think because I am not seeing the UI is why the Invoke-PSUScript is not seeing the parameters either.

Do you have any notification errors in your admin UI? Can you check for errors in your system log?