Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle dots in powershell commands?

The command below works in command line

mvn clean install -Denunciate.skip 

But breaks in powershell with the error

[ERROR] Unknown lifecycle phase ".skip". You must specify a valid lifecycle phase or a goal in the format

like image 778
developer747 Avatar asked Jul 01 '15 16:07

developer747


1 Answers

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.

like image 54
Matt Avatar answered Nov 15 '22 22:11

Matt