<?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: List snapshots older than and only powered on VM in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2920338#M107536</link>
    <description>&lt;P&gt;You could do something like this&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VM | Get-Snapshot |
select @{N='VM';E={$_.VM.Name}},
   @{N='Current PowerState';E={$_.VM.PowerState}},
   Name,
   @{N='PowerState';E={$_.VM.PowerState}}&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 25 Jul 2022 11:36:29 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2022-07-25T11:36:29Z</dc:date>
    <item>
      <title>List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859479#M102529</link>
      <description>&lt;P&gt;Hi gurus&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a list of all powered ON vm with snapshot older than 5 days, I have the following but as you can tell still curving some learning&lt;/P&gt;&lt;P&gt;$PowONvm = Get-VM |where {$_.powerstate -eq "PoweredOn"}| Get-Snapshot | Where {$_.Created -lt (Get-Date).AddDays(-5)} |select vm,name,powerstate&lt;/P&gt;&lt;P&gt;This bring powered off and on vm , can someone help on where I went wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 13:11:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859479#M102529</guid>
      <dc:creator>fborges555</dc:creator>
      <dc:date>2021-07-27T13:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859481#M102531</link>
      <description>&lt;P&gt;The object returned by Get-Snapshot contains a property named VM, under which you find the same object that is returned by Get-VM.&lt;BR /&gt;So you could do&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VM | Get-Snapshot |
    where {$_.VM.powerstate -eq "PoweredOn" -and $_.Created -lt (Get-Date).AddDays(-5)} |
    select vm,name,powerstate&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 13:22:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859481#M102531</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2021-07-27T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859489#M102533</link>
      <description>&lt;P&gt;L.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for some reason it bring the off and on VM&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snapshots.png" style="width: 400px;"&gt;&lt;img src="https://communities.vmware.com/t5/image/serverpage/image-id/90303iB8B30D67768294CA/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="snapshots.png" alt="snapshots.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 13:35:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859489#M102533</guid>
      <dc:creator>fborges555</dc:creator>
      <dc:date>2021-07-27T13:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859492#M102534</link>
      <description>&lt;P&gt;That PowerState is the state the VM was in when the snapshot was taken.&lt;BR /&gt;When you want to see the current powerstate you can do&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VM | Get-Snapshot |
    where {$_.VM.powerstate -eq "PoweredOn" -and $_.Created -lt (Get-Date).AddDays(-5)} |
    select @{N='VM';E={$_.VM.Name}},Name,@{N='PowerState';E={$_.VM.PowerState}}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 13:50:59 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2859492#M102534</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2021-07-27T13:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2920333#M107535</link>
      <description>&lt;P&gt;Hi LucD,&lt;/P&gt;&lt;P&gt;can you help me out on how to use this query for the &lt;EM&gt;current&lt;/EM&gt; powerstate in &lt;A href="https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Scripting-SnapShot-Create-Date-is-older-than-3-days/m-p/1400098" target="_self"&gt;this&lt;/A&gt; script?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 11:10:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2920333#M107535</guid>
      <dc:creator>rictusempra</dc:creator>
      <dc:date>2022-07-25T11:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: List snapshots older than and only powered on VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2920338#M107536</link>
      <description>&lt;P&gt;You could do something like this&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VM | Get-Snapshot |
select @{N='VM';E={$_.VM.Name}},
   @{N='Current PowerState';E={$_.VM.PowerState}},
   Name,
   @{N='PowerState';E={$_.VM.PowerState}}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Jul 2022 11:36:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/List-snapshots-older-than-and-only-powered-on-VM/m-p/2920338#M107536</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2022-07-25T11:36:29Z</dc:date>
    </item>
  </channel>
</rss>

