I’ve started using VScode to help me write Posh scripts. It’s an improvement on copy pasting from chatgpt, as it’s designed to give less blather and has a button for dumping what it came up with into the terminal.
However, if the terminal throws an error, or if it generates an output which is nothing like what I describe, the VSCode AI – Copilot – does not ‘see’ this.
For example, suppose I ask Copilot
Write a banal, cliched and trivial script which does nothing but
pointlessly hail everybody on earth.
What I obviously want is the output
I say: hello, world!
However, copilot often does things like this
$exclamation = "I say"
$greeting = "hello"
$recipient = "world"
$wholething = "$exclamation: $greeting $recipient"
This of course returns:
| Variable reference is not valid. ':' was not followed by a valid variable name character.
| Consider using ${} to delimit the name.
What I would like is CoPilot to actually look at the output, realise it’s not what’s being asked for, remove or properly escape the colon, and run the script again.
I’m new to VScode so it’s possible this is a feature I haven’t seen. If not, what other tool can I use? Free preferred.