Author Topic: Switch params in PowerShell are formatted weirdly  (Read 712 times)

spongyryno

  • Community Member
  • Posts: 53
  • Hero Points: 0
Switch params in PowerShell are formatted weirdly
« on: June 17, 2024, 08:40:13 PM »
This is a negative side-effect of this: https://community.slickedit.com/index.php/topic,19187.msg

If you don't apply that, the "switch" keyword doesn't get formatted as a keyword. But if you do, you get another bad behavior:

Create a new PowerShell script, such as foo.ps1.

Copy/paste the following code to define the parameters this script will take:

Code: [Select]
param(
[string]$Variable1,
[int]$Variable2,
[bool]$Variable3,
[switch]$Variable4,
[string]$Variable5,
[int]$Variable6,
[bool]$Variable7,
[switch]$Variable8
)

Now, one by one, go to the end of each parameter line and hit <enter>. Note how they all work correctly except for the switch one.

Can we get this fixed?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6966
  • Hero Points: 531
Re: Switch params in PowerShell are formatted weirdly
« Reply #1 on: June 17, 2024, 09:51:32 PM »
I'm not able to reproduce this but maybe I'm not following what you are saying needs to be done to reproduce this.

What happens with a default config: vs -sc c:\temp\newconfig

Please post a sample file instead of copy/paste.

Please post your user.cfg.xml.

Email support if you prefer
« Last Edit: June 17, 2024, 09:59:16 PM by Clark »