PowerShell spacing option between type and name

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 3 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
JohnMoe
Posts: 20
Last visit: Wed Dec 02, 2020 11:45 pm

PowerShell spacing option between type and name

Post by JohnMoe »

Currently, when I define a variable like this:

Code: Select all

[System.String] $myString
PowerShell Studio keeps "correcting" it to:

Code: Select all

[System.String]$myString
In my view, this mashes it together and makes it less readable. Can you please add a spacing option to leave that space?
User avatar
Alexander Riedel
Posts: 8473
Last visit: Tue Mar 19, 2024 1:15 am
Answers: 19
Been upvoted: 37 times

Re: PowerShell spacing option between type and name

Post by Alexander Riedel »

It is actually very common practice to 'mash', as you say, the type specifier and the object or variable together like that. In almost every language I know.
My personal opinion is that this actually enhances readability, since it makes the type cast stand out.
But I will of course forward your request to the team.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 3 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked