Users

All Posts (5)

avatar

dennisgoodspeed

Switch parameters appear broken in latest version

avatar
avatar
avatar
avatar
avatar

Hi, I was able to test version 2026.2.4 and it looks like switch parameters are fixed. Thank you!

Switch parameters appear broken in latest version

avatar
avatar
avatar
avatar
avatar

Hi Adam, sounds great. Thanks for the response.

Switch parameters appear broken in latest version

avatar
avatar
avatar
avatar
avatar

Thanks. I ran these test scripts and got ContentType = HTML as the output of the child script. So it seems like it's specifically [switch] parameter handling that's not working, not booleans in general. This does give us a workaround, but I'd still like to see the issue get fixed.

Switch parameters appear broken in latest version

avatar
avatar
avatar
avatar
avatar

Hi,

  • Last PSU version that was working: 2026.1.6.0

  • Locally hosted on Windows Server 2025, PowerShell 7

  • The call does not use '-Integrated'

  • The child script does not run successfully when run from the admin console

Here is the sanitized child script (Send-Alert.ps1):

param(
    [Parameter(Mandatory = $true)]
    [string[]]$Recipient,

    [Parameter(Mandatory = $true)]
    [string]$Subject,

    [Parameter(Mandatory = $true)]
    [string]$BodyContent,

    [switch]$ContentTypeHTML
)

And here is the sanitized parent script:

$Recipient = 'user1@example.com', 'user2@example.com'
$Subject   = 'Test Subject'
$Body      = '<html><body><p>Test</p></body></html>'

Invoke-PSUScript -Script 'Send-Alert.ps1' -Recipient $Recipient -Subject $Subject -BodyContent $Body -ContentTypeHTML

The parent script succeeds, but the child script fails with the error A positional parameter cannot be found that accepts argument 'True'. Using -ContentTypeHTML:$true also fails in the same manner.

Removing the -ContentTypeHTML switch from the parent script will make the child script succeed, but the content type will be Text instead of HTML. It seems like the switch value is being treated as a positional 'True' value rather than a switch by the child process.

Switch parameters appear broken in latest version

avatar
avatar
avatar
avatar
avatar

We have several scripts that are using the -ContentTypeHTML in the Convoke-PSUScript cmdlet which sends the 'true' value. This was working previously. We just upgraded to 2026.2.3 and we're now getting this error:

A positional parameter cannot be found that accepts argument 'True'.

at , : line 1

I can see that before the update it was also sending that value and was being accepted. So this functionality appears to be broken right now. I tried removing the -ContentTypeHTML switch from a script, and the child script does successfully run but of course the resulting text is not being interpreted as HTML anymore.

1 - 5 of 5 items