When using the following command
".((gwmi win32_volume -f 'label=''BashBunny''').Name+'payloads\\$SWITCH_POSITION\a.cmd')"
It errors out
. : The term 'E:\payloads\\a.cmd' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+ .((gwmi win32_volume -f 'label=''BashBunny''').Name+'payloads\\a.cmd' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (E:\payloads\\a.cmd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
It is not grabbing the variable for $SWITCH_POSITION
What am I missing?
Thanks