Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 690 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle dots in powershell commands?

#1
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
Reply

#2
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"
Reply

#3
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](

[To see links please register here]

)

> 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.
Reply

#4
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 detect
arg 0: -foo.bar=baz
arg 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 detect
arg 0: -foo
arg 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 detect
arg 0: -foo
arg 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 detect
arg 0: -bar.foo=baz
arg 1:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through