danielbohannon/Invoke-CradleCrafter

CLI Argument Parsing in Powershell for Linux

ponkio opened this issue · 0 comments

While trying to use the built in '-Command' switch I was having some issues with how the program was parsing the argument. The exact command I was running was:
import-module ./Invoke-CradleCrafter/Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://192.168.1.226' -Command 'Memory\Certutil\All\1'
screenshot from 2018-06-01 05-14-09

And every time I kept receiving the following error:
screenshot from 2018-06-01 05-13-13

Looking at how the CLI arguments were getting parsed I noticed that they were getting split with a ',' but the example was showing '\':
screenshot from 2018-06-01 05-26-47

Changing my Command to use ',' instead managed to resolve the issue:
screenshot from 2018-06-01 05-25-58

This could just be a problem with Powershell for linux. Just thought that I would submit a ticket in case anyone else has a similar issue.