Hey,
Thanks for the project, peak work !
I have this usecase where I need to put double quotes in my command.
What I enter in grumble shell:
powercliff exec Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "/temp/main_http.exe" -ComputerName 172.20.0.52
The layout is:
[Session 13: INLANEFREIGHT\Helen@SRV02] » powercliff exec --help
Exec a powershell cmd
Usage:
exec [flags] [args...]
Args:
args string list Argument of the Assembly
In my code, I ofc what to get back the Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "/temp/main_http.exe" -ComputerName 172.20.0.52 to use it.
To do that I just use
argString := ""
argStringList := c.Args.StringList("args")
for i := 0; i < len(argStringList); i++ {
argString += argStringList[i]
argString += " "
}
However argString variable is
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList /temp/main_http.exe -ComputerName 172.20.0.52
And not
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "/temp/main_http.exe" -ComputerName 172.20.0.52
Same behavior is seen when using \, the \ just disappear too !
A workaround is to escape the " into \" when entering the command and \ into \\.
I was wondering if this behavior is coming from my shell or grumble anf if anything can be done to avoid escaping quotes and \ and just treat them, as normal characters.
Thanks.
Hey,
Thanks for the project, peak work !
I have this usecase where I need to put double quotes in my command.
What I enter in grumble shell:
The layout is:
In my code, I ofc what to get back the
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "/temp/main_http.exe" -ComputerName 172.20.0.52to use it.To do that I just use
However argString variable is
And not
Same behavior is seen when using
\, the\just disappear too !A workaround is to escape the
"into\"when entering the command and\into\\.I was wondering if this behavior is coming from my shell or grumble anf if anything can be done to avoid escaping quotes and
\and just treat them, as normal characters.Thanks.