Switch parameters appear broken in latest version

Switch parameters appear broken in latest version

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.

All Comments (6)

avatar

Hello dennisgoodspeed,

Thank you for reporting this behavior.

Based on your description, `Invoke-PSUScript` appears to be passing the switch value as a separate `True` argument after the upgrade to PowerShell Universal 2026.2.3. I have not yet confirmed whether this is a regression, but I will investigate and attempt to reproduce it.

To help me match your environment, could you please provide:

* The exact PSU version that worked before the upgrade.
* Your hosting method, operating system, and PowerShell environment used by both scripts.
* A minimal sanitized example containing the parent `Invoke-PSUScript` command and the child script’s `param` block.
* Whether the call uses `-Integrated`.
* Whether the same error occurs with a new test script containing only a single switch parameter.
* Whether the child script runs successfully when started directly from the administrative console with the switch enabled.

Because this is a public forum, please sanitize all evidence before posting. Remove credentials, tokens, license keys, cookies, private keys, full connection strings, email addresses, usernames, customer data, tenant or account identifiers, internal domains, hostnames, IP addresses, and private URLs. Please do not upload unredacted HAR files, memory dumps, database backups, or complete configuration files to this public thread.

Best regards,

Ruben Tapia

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.

avatar

Hello dennisgoodspeed,

Thank you for providing the sanitized examples and environment details. The additional information is very helpful.

Since the same failure occurs both through `Invoke-PSUScript` and when launching the child script from the administrative console, this does not appear to be limited only to the parent script call.

As a temporary troubleshooting test, please create a copy of the child script and replace the switch parameter with a Boolean parameter:

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

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

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

[bool]$ContentTypeHTML = $false
)

Then call the copied script using:

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


Please perform this only with a test copy rather than changing the production script. This test will help determine whether the issue is specific to `[switch]` parameter handling or affects Boolean values more generally.

I will also attempt to reproduce your exact scenario in the lab by comparing PSU 2026.1.6.0 with PSU 2026.2.3. I will test both direct administrative-console execution and execution through `Invoke-PSUScript`.

Because this is a public forum, please sanitize any results before posting. Remove credentials, tokens, license keys, email addresses, usernames, customer data, internal domains, hostnames, IP addresses, and private URLs.

Best regards,
Ruben Tapia

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.

avatar

Hi @dennisgoodspeed, I've opened an issue in our backlog to get this resolved. The development team will be looking into it shortly.

Adam Driscoll
PowerShell Expert and Developer at Devolutions

avatar

Hi Adam, sounds great. Thanks for the response.