I want to execute a cmd on PowerShell and this command uses semicolons. Then PowerShell interprets it as multiple commands. How do I make PowerShell ignore the semicolons and ex
The easiest way to ignore a semicolon? Simply use a single quote versus double quote!
In PowerShell, the type of quote you use matters. A double quote will let PowerShell do string expansion (so if you have a variable $something = someprogram.exe, and run "$something", PowerShell substitutes in "someprogram.exe").
If you don't need string substitution/variable expansion then just use single-quotes. PowerShell will execute single-quoted strings exactly as listed.
Another option if you want to use string expansion is to use a here-string instead. A here string is just like a regular string, however it begins and ends with an @ sign on its own separate line, like so:
$herestring = @"
Do some stuff here, even use a semicolon ;
"@
This is a best-of-both-worlds scenario, as you can use your fancy characters and have them work, but still get Variable expansion, which you do not get with single-quotes.