How to handle dots in powershell commands? How to handle dots in powershell commands? powershell powershell

How to handle dots in powershell commands?


Using quotes can help, especially with actual PowerShell code. However you are just trying to use a regular command. You can keep the PowerShell parser from misinterpreting your code by using the stop-parsing parameter

The stop-parsing symbol (--%), introduced in Windows PowerShell 3.0, directs Windows PowerShell to refrain from interpreting input as Windows PowerShell commands or expressions.

When calling an executable program in Windows PowerShell, place the stop-parsing symbol before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation.

So for your command you could have also done this.

mvn --% clean install -"Denunciate.skip"

If you did have variables mixed in there then just move the stop parser as needed.


With trial and error this worked for me (I treated Denunciate.skip as a string by enclosing it in quotation marks)

 mvn clean install -"Denunciate.skip"


I feel I have to confirm and to add to developer747's answer. The double quotes need to completely wrap each argument in order for PowerShell to stop processing of the argument contents. (No monkeying around placing double quotes way deep into the argument as in -foo.bar="baz").

  • At the PowerShell prompt:

    function detect() { write-host "in detect"; write-host "arg 0: $($args[0])"; write-host "arg 1: $($args[1])"; } exit detect "-foo.bar=baz"

    in detectarg 0: -foo.bar=bazarg 1:
  • At the PowerShell prompt:

    function detect() { write-host "in detect"; write-host "arg 0: $($args[0])"; write-host "arg 1: $($args[1])"; } exit detect -foo.bar=baz

    in detectarg 0: -fooarg 1: .bar=baz
  • At the PowerShell prompt:

    function detect() { write-host "in detect"; write-host "arg 0: $($args[0])"; write-host "arg 1: $($args[1])"; } exit detect -foo.bar="baz"

    in detectarg 0: -fooarg 1: .bar=baz

To pass the double quotes from CMD to PowerShell, I had to prefix them with backslashes (not with carets!),

  • At the CMD prompt:

    powershell -Command function detect() { write-host "in detect"; write-host "arg 0: $($args[0])"; write-host "arg 1: $($args[1])"; } exit detect \"-bar.foo=baz\"

    in detectarg 0: -bar.foo=bazarg 1: