Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

restart-vmhostservice with start-job

$
0
0

I am trying to restart a service with a background job since restart-vmhostservice does not support runasync

 

restartvmhostservice.ps1

 

$vmhosts = get-datacenter -name xx | get-vmhost

$vmhosts | get-vmhostservice | ?{$_.key -eq "TSM-SSH"} | Restart-VMHostService -confirm:$false

 

 

start-job -filename restartvmhostservice.ps1

 

the job says it completed sucessfully but i do not see a task or the service being restarted

 

any idea?


Viewing all articles
Browse latest Browse all 175326


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>