Call Powershell Script from Unix Shell Script
Hi All,
Trust you're all having a great day.
I have a powershell script on my Windows server which does some active directory operations. I wish to call that script from another Linux machine using a shell script. I have installed powershell server on my Windows server and can communicate with my linux machine using key based ssh authentication. The issue is that my script just stops once the command for ssh to Windows server is executed.
My shell script below:
!/bin/bash
echo "script run" GROUP=$1 ACCOUNT=$2 ssh Administrator@ sleep 10 echo "\scriptname.ps1 -group $GROUP -account $ACCOUNT" sleep 5 echo "exit" exit
I have tried without the echo command as well and it still hangs. Any idea what I must be doing wrong here? How can I make it work please?
Regards, Gaurav
Tried the operation using an "expect" script and it all works well now.