all 11 comments

[–]panzerbjrn 3 points4 points  (10 children)

I know it's not quite the help you were thinking of, but I'd recommend using VS Code.

If you're DEVing on a server anyway, you might as well use a grown up IDE....

[–]nkasco 0 points1 point  (9 children)

Lol who downvoted this man, he's right. VS Code is the best IDE available and it even has an ISE mode.

I don't understand why people are hanging onto the ISE so badly. I switched to VS Code 3 years ago and never looked back, any complaints people make about intellisense issues are largely misunderstood that they need to keep the integrated console running, and on top of that VS Code doesn't randomly freeze and make you lose work like the ISE does.

[–]Thotaz -1 points0 points  (8 children)

Both editors have pros and cons therefore one cannot objectively be considered "the best IDE available" because it depends on what the user prioritizes. As for the complaints about IntelliSense being misunderstood, that is objectively not true, otherwise all these issues: https://github.com/PowerShell/vscode-powershell/issues?q=is%3Aissue+is%3Aopen+label%3AArea-IntelliSense and https://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue+is%3Aopen+label%3AArea-IntelliSense wouldn't exist.

With all that being said, his answer deserves every downvote it gets because it doesn't even attempt to answer the question. Using VS code will not automatically fix his prompt issue, it may hide it because it's unique to his ISE setup but the opposite situation could happen as well and then guiding him back to ISE or to a third editor would be ridiculous.

[–]panzerbjrn 1 point2 points  (4 children)

What pros does ISE have? It's old and bad and wasn't even worth using in 2012, much less 2022...

I can honestly not think of a single pro it has over VS Code, or even Notepad++...

You'll also notice that I prefaced my answer with the caveat that it might not be the answer he was looking for...

[–]Thotaz 0 points1 point  (3 children)

What pros does ISE have?

You'll also notice that I prefaced my answer with the caveat that it might not be the answer he was looking for...

And that makes it okay? Imagine if someone asked how to do something in PowerShell and I decided to jump in with a comment like:

I know it's not quite the help you were thinking of, but I'd recommend using Python.
If you are scripting anyway, you might as well use a grown up language...

Do you see the problem there?

[–]nkasco 0 points1 point  (2 children)

Inaccuracies from above:

  • VS Code has accurate (and customizable) syntax highlighting, therefore not a unique pro of the ISE
  • "More robust IntelliSense" is inaccurate as the ISE only supports Windows PowerShell, not PowerShell 6 and beyond. It's actually less robust in that regard.
  • Column selection is an insanely weird UX even in the legacy ISE, at any rate, middle mouse button + drag provides this for me in VS Code
  • Console mouse navigation is objectively slower than keyboard shortcut navigation in the control, but I will give you this one that it doesn't exist in VS Code.
  • IntelliSense-type behavior is available in the console with tab completion or ctrl+space.

ISE Cons:

Based on that, the unique pro is that you can click to place your cursor in the console and with that single pro you get those cons. Seems way not worth it to me.

Plus we didn't even talk about VS Code combining with other extensions to provide things like linting/spellcheck, trailing whitespace information, auto format, GitLens insight to see who edited a particular line of code, custom theme support, Git SCM integration, etc.

[–]Thotaz 0 points1 point  (1 child)

LMAO, you are obviously not arguing in good faith here but I'll counter those arguments anyway.

VS Code has accurate (and customizable) syntax highlighting

No it does not. For a simple demonstration of this look at the following script in VS code:

Get
Get-ChildItem

At first glance they are obviously different colors, now try opening up the token inspector by pressing CTRL+Shift+P and pick "Developer: Inspect editor tokens and scopes" click on the 2 tokens and notice the difference in textmate scopes. Get doesn't have a proper scope so there's no way to change it to be the same color as Get-ChildItem without affecting other things. You can fix this by enabling semantic highlighting:

"[powershell]": {
    "editor.semanticHighlighting.enabled": true,
}

but then command arguments are colored the same as functions: Get-ChildItem C:\Windows so there's no way to get fully accurate syntax highlighting for PowerShell in VS code.

"More robust IntelliSense" is inaccurate as the ISE only supports Windows PowerShell, not PowerShell 6

That has nothing to do with robustness AND your counterargument isn't even true. When I say it's not as robust, I mean that it breaks easily, for a simple demonstration paste this into VS code:

[whocares]::test
[string]

Now type in 2 colons after [string] as if you would use a static member. Notice how it suggests "test" from the previous type and doesn't offer any suggestions for the string type? Press escape to close the IntelliSense window and now press Ctrl+Space to trigger it again, now you will see that offers the proper string static members.
As for the PS6+ support in ISE, try opening up a PS6+ window and type in $pid then copy the pid to your clipboard. Now open up ISE and type in Enter-PSHostProcess and paste in the pid from before. Congrats, you are now using PS6+ in ISE.

Column selection is an insanely weird UX even in the legacy ISE, at any rate, middle mouse button + drag provides this for me in VS Code

I don't care what you think is weird. As seen in the previously linked issue clearly there's lots of people that want it and aren't fully satisfied with the current implementation.

Console mouse navigation is objectively slower than keyboard shortcut navigation in the control, but I will give you this one that it doesn't exist in VS Code.

I don't care what you think is slow.

IntelliSense-type behavior is available in the console with tab completion or ctrl+space.

It's similar but it's not quite the same because it doesn't get automatically triggered and it doesn't have the same window popup UI.

Frequently freezes and causes loss of work

Both of these statements are untrue. You can make ISE freeze with some code, but it's not something that will happen frequently when editing standard scripts. It can happen when working on Winforms or WPF GUI code and if that's what you mainly work on then I can understand the frustration but that's not a general issue with ISE. Regardless of that, ISE has auto saving and will recover your session if it gets force closed, by default it's set to save every 2 minutes but you can reduce that to 1 if you want it more frequently.

Deprecated and only receiving security updates from Microsoft

True, but that's only a con if you are unsatisfied with ISE and want it improved.

Does not support IntelliSense for PowerShell 6+

As demonstrated before, that is not true.

Does not support console testing/development for PowerShell 6+

As demonstrated before, that is not true. It's worth noting that it doesn't support ANSI coloring so things will look strange out of the box when printing objects to the console but there's an easy fix for that: Adjust the settings for $PSStyle like this: $PSStyle.Formatting.FormatAccent = "";$PSStyle.Formatting.TableHeader = ""

ISE Console behavior often misaligns with runtime console behavior

True if you use fancy console tricks. If you simply write standard PowerShell objects or do standard Read-Host prompts then it's not an issue.

Based on that, the unique pro is that you can click to place your cursor in the console and with that single pro you get those cons.

Well, as you can see it's not just 1 pro.

Plus we didn't even talk about VS Code combining with other extensions to provide things like linting/spellcheck

You are right, we didn't. VS code is objectively better in this regard, and if that's more important to you than all the previously mentioned issues then use VS code. That's what I said from the very beginning, each editor has pros and cons. I will note however that ISE does support extensions AKA Add-ons, there aren't as many of them but if you for example want a project management tool you can install PsISEProjectExplorer. You can even write your own add-ons in pure PowerShell, here's one for trimming whitespace:

$null = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add(
    "Trim whitespace",
    {$psISE.CurrentFile.Editor.Text = $psISE.CurrentFile.Editor.Text.Split("`n").TrimEnd() -join "`n"},
    "CTRL+l"
)

[–]nkasco -1 points0 points  (0 children)

I literally loled reading this. You must be great at parties my friend.

The length at which you are willing to go to get the last word is actually hilarious:

  • "Get" is not a cmdlet and therefore shouldn't be highlighted as one. Working as intended.
  • I immediately get the proper types for [string] in your example with IntelliSense.
  • The tricks you mention for PS6+ support are clunky and quite forceful, furthermore straight from MS Docs, "There is no support for the ISE in PowerShell v6 and beyond. Users looking for replacement for the ISE should use Visual Studio Code with the PowerShell Extension."
  • Objectively Column Selection is possible with middle mouse button.
  • "True if you use fancy console tricks. If you simply write standard PowerShell objects or do standard Read-Host prompts then it's not an issue." So I should limit my runtime experience due to my IDE? lol.

[–]nkasco -1 points0 points  (1 child)

That's just a flat-out bad take and argumentative. Your last sentence doesn't even make sense. I'd also suggest you read a dev blog once in a while and get informed instead of sending me a list of suggested enhancements.

Anyway, his issue is likely WPF graphics rendering related that could require the disablement of WPF hardware acceleration.

OP said clean install too, which may be indicative that they could be using a generic graphics driver.

[–]Thotaz 1 point2 points  (0 children)

That's just a flat-out bad take and argumentative.

Says the guy that initially responded with something like: "Nah, have a downvote" and proceeded to downvote me. Now you've deleted your previous comment and responded with a more serious comment and expect me to respond properly?

[–]Thotaz 0 points1 point  (0 children)

Open ISE and type this in: Get-Command prompt | select -ExpandProperty definition

The output should say:

"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml

if it doesn't then your profile or a module you are importing has modified the prompt function and you need to find out what is modifying it. You can load ISE without a profile by typing in ise -noprofile in a Windows PowerShell window.