{"id":140,"date":"2010-08-10T07:25:21","date_gmt":"2010-08-10T11:25:21","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=140"},"modified":"2010-08-10T07:25:21","modified_gmt":"2010-08-10T11:25:21","slug":"create-a-bunch-of-snapshots-with-powercli","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/scripting\/create-a-bunch-of-snapshots-with-powercli\/","title":{"rendered":"Create a bunch of snapshots with PowerCLI"},"content":{"rendered":"<p>Last week I was working with snapshots in my lab.  I came up with this one liner to create a bunch of snapshots on the same virtual machine:<\/p>\n<pre>for ($i=1; $i -le 5; $i++) {get-vm \"snaptest\" |new-snapshot -name \"snapshot00$i\" -Description (get-date -format \"'Created: 'yyyy-MM-dd HH:mm\") -memory:$true}<\/pre>\n<p>As you can see I&#8217;m using the virtual machine snaptest and the snapshots will be named snapshot001-snapshot005 and have a description containing the date\/time the snapshot was created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I was working with snapshots in my lab. I came up with this one liner to create a bunch of snapshots on the same virtual machine: for ($i=1; $i -le 5; $i++) {get-vm &#8220;snaptest&#8221; |new-snapshot -name &#8220;snapshot00$i&#8221; -Description &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/scripting\/create-a-bunch-of-snapshots-with-powercli\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-scripting","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":2,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/142"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}