But ideally in post modules we should use abstracted commands like expand_path or get_env rather than meterpreter specific functions to try and maintain shell & meterpreter compatibility. It doesn't matter too much in this case as its unlikely anyone would implement injection techniques for shell (although it would be possible with some powershell commands).