ant-druha / intellij-powershell

Adds PowerShell language support to IntelliJ-based IDEs.
https://plugins.jetbrains.com/plugin/10249-powershell
Apache License 2.0
72 stars 20 forks source link

Execute selection in integrated terminal #29

Open mikeTWC1984 opened 5 years ago

mikeTWC1984 commented 5 years ago

Is there a way to execute script or selection in the integrated console? Similar to what F5/F8 do in powershell ISE or VSCode?

pqant commented 5 years ago

is there any news about this? Thank you.

ngoov commented 2 years ago

Again, 3 years later, is there any news about this? This is the most useful feature, which seems to be missing. It seems contradictory to have to copy and paste stuff in a scripting language...

iam-take commented 2 years ago

This would be a really usefull feature for this plugin! Would love to hear if this is on the roadmap

ForNeVeR commented 1 year ago

I am not familiar with how it works in other tools. Should it just open a PowerShell terminal (if it's not yet) and literally send the selected text to it, and press Enter there? Should there be a session selector or something, in case several sessions are already open?

young-zhang commented 4 months ago

This feature is for a PowerShell REPL feature. In Rider (F#, C#) or PyCharm, you can select code, hit a hot key, and it basically pastes the code into the existing open console, and hit return. For example, I can simply keep editing and running code like this

$sql = "SELECT $somethingComplicated FROM SomeTable"
Invoke-Sqlcmd -ConnectionString $connStr -Query $sql | Select-Object -ExpandProperty Column1

Until I get it right. Sometimes you want to edit and run a little snippet until I get the proper output, and I don't want to / or can't easily run an entire script.