Forman-Puppet-Windows Nodes - Unable to create remote directory

As in ssh $host $command?

The script uploading part roughly translates to echo $SCRIPT | ssh $HOST sh -c "cat > C:/Temp/foreman-ssh-cmd-b94c8218-8e5d-421e-a948-d87ca8e8b060/script"