title: remote powershell scripts on windows not running through python script in linux
body: <p>I have a python script written using paramiko and pysphere.this script is in linnux box.i have some powershell scripts on windows machine which i have to run one after the other(after each script ends obviously),but the point here is through my pythonscript it is not running the powershell scripts on windows machine.Kindly help.
  PS;i have to run python script fromlinux and powershell scriupts on windows.
  Here is a snippet of code for running powershell scripts:</p>
  
  <pre><code>target_vm1 = connect_Esxi_Server(return_list[0])
  
  print "Again connected to vm:" + return_list[0]
  
  target_vm1.login_in_guest(vmUser,vmPass)
  
  list_scripts = target_vm1.list_files(VM_SCRIPT_LOCATION)
  
  for f in list_scripts:
  
      size = f['size']
      **if size &lt;&gt; 0:**
  
          paths = f['path']
  
          print paths
  
          #for all_scripts in paths:
          *****print "script running is :" , paths*****
          path_l = os.path.join(VM_SCRIPT_LOCATION + '\\'+ paths)
          *****print path_l*****
          run_script =            
  subprocess.Popen([r'c:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe',". path_l"], shell=True)
  
          result = run_script.wait()
          print "result is:", result
  </code></pre>
  
  <p>I doubt whether subprocess will work.</p>
  
  <p>Please note that the bold prints given above are giving the correct script to run.there are many powershell scriptsinside the fo;der,so looping throught it and running each one of them.</p>
  
  <p><em><strong>Any help would be appreciated,this thing is eating my heads off.....argghhhhhhhh..</em></strong></p>
  
  <p>Cheers,
  NJ</p>