I was having a similar problem and found a non-elegant knuckle dragger work around.
let's say you want to inject keystrokes <keystrokes that I want to inject> into cmd or powershell.
If there are double quotes and a pair of single quotes somewhere between the double quotes then everything else is injected as is. Your line could look like
Q STRING "<keystrokes that I want to inject> & '' "
the two ticks directly to the right of the ampersand are two single quotes
This does cause an error as '' is rightfully interpreted as garbage but it will execute whatever is on the left of the ampersand correctly and will simply complain then ready for the next command.