<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Shutdown-VMGuest -VM $vm -RunAsync is not working in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919145#M107426</link>
    <description>&lt;P&gt;The Shutdown-VMGuest is an alias for Stop-VMGuest.&lt;BR /&gt;Both do exactly the same&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 13:09:49 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2022-07-18T13:09:49Z</dc:date>
    <item>
      <title>Shutdown-VMGuest -VM $vm -RunAsync is not working</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919105#M107421</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am getting the below error, while shutting down multiple VMs from a particular folder. I would like to shutdown multiple VMs in parallel&lt;/P&gt;&lt;P&gt;Stop-VMGuest : A parameter cannot be found that matches parameter name 'RunAsync'.&lt;BR /&gt;At D:\Date\Shutdown_VMs_Particular_Folder\Shutdown_VMs_Particular_Folder.ps1:6 char:54&lt;BR /&gt;+ Shutdown-VMGuest -VM $vm -Confirm:$false -RunAsync&lt;BR /&gt;+ ~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [Stop-VMGuest], ParameterBindingException&lt;BR /&gt;+ FullyQualifiedErrorId : NamedParameterNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.StopVmGuest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script&lt;/P&gt;&lt;P&gt;$VMList = Get-Folder MyTest | Get-VM&lt;BR /&gt;$report = @()&lt;BR /&gt;foreach($vm in $VMList){&lt;BR /&gt;if($vm.PowerState -eq 'PoweredOn'){&lt;BR /&gt;if($vm.Guest.State -eq "Running"){&lt;BR /&gt;Shutdown-VMGuest -VM $vm -Confirm:$false -RunAsync&lt;BR /&gt;} else {&lt;BR /&gt;Stop-VM -VM $vm -confirm:$false -RunAsync&lt;BR /&gt;}&lt;BR /&gt;Write-Host "Shutting Down $vm at $(get-date)"&lt;BR /&gt;Start-Sleep 10&lt;BR /&gt;$report += New-Object PSObject -Property @{&lt;BR /&gt;'VM_Name' = $vm&lt;BR /&gt;'Power_Off_Time' = Get-Date -Format 'MM/dd/yyyy HH:mm:ss'&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;$report | ft -auto&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 08:00:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919105#M107421</guid>
      <dc:creator>ganapa2000</dc:creator>
      <dc:date>2022-07-18T08:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Shutdown-VMGuest -VM $vm -RunAsync is not working</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919108#M107422</link>
      <description>&lt;P&gt;There is, as the error message states, no RunAsync switch for the &lt;A href="https://developer.vmware.com/docs/powercli/latest/vmware.vimautomation.core/commands/stop-vmguest/" target="_blank" rel="noopener"&gt;Stop-VMGuest&lt;/A&gt; cmdlet.&lt;BR /&gt;The reason is that the underlying &lt;A href="https://vdc-download.vmware.com/vmwb-repository/dcr-public/b50dcbbf-051d-4204-a3e7-e1b618c1e384/538cf2ec-b34f-4bae-a332-3820ef9e7773/vim.VirtualMachine.html#shutdownGuest" target="_blank" rel="noopener"&gt;ShutdownGuest&lt;/A&gt; method also has no _Task suffix.&lt;BR /&gt;&lt;BR /&gt;As an alternative, you could run each Stop-VMGuest via a &lt;STRONG&gt;Start-Job&lt;/STRONG&gt; cmdlet.&lt;BR /&gt;Then the cmdlet runs in the background, and you can start multiple in parallel&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 08:12:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919108#M107422</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2022-07-18T08:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shutdown-VMGuest -VM $vm -RunAsync is not working</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919143#M107425</link>
      <description>&lt;P&gt;LucD,&lt;/P&gt;&lt;P&gt;I would like to understand when I can use ShutdownVM-Guest and Stop-VMGuest&amp;nbsp; ? Does Stop-VMGuest powers off the VMs abruptly ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 12:47:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919143#M107425</guid>
      <dc:creator>ganapa2000</dc:creator>
      <dc:date>2022-07-18T12:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Shutdown-VMGuest -VM $vm -RunAsync is not working</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919145#M107426</link>
      <description>&lt;P&gt;The Shutdown-VMGuest is an alias for Stop-VMGuest.&lt;BR /&gt;Both do exactly the same&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:09:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Shutdown-VMGuest-VM-vm-RunAsync-is-not-working/m-p/2919145#M107426</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2022-07-18T13:09:49Z</dc:date>
    </item>
  </channel>
</rss>

