I'm trying to use powershell to run a command against another API. When running the script, powershell see's the symdg command (which is intended for the API) and tries to do something with it, which it cannot.
$command = "for /f "tokens=3" %a in ('symdg list -v ^|find /I "Group Name:"') do symdg delete %a -force"
The following shows Powershell trying to interpret the command.
Unexpected token 'tokens=3" %a in (`'symdg list -v ^|find /I "Group' in expression or statement.
At C:\test1.ps1:3 char:68
+ $cmd03 = "for /f "tokens=3" %a in ('symdg list -v ^|find /I "Group <<<< Name:"') do symdg delete %a -force"
+ CategoryInfo : ParserError: (tokens=3" %a in...|find /I "Group:String) , ParseException
+ FullyQualifiedErrorId : UnexpectedToken
Is there a way to put the command into a string that powershell will not try to interpret it? I've tried to put the command into "<command>", ""<command>"", and other combinations of single, double quotes, brackets, parenthasies.