{"id":5531,"date":"2018-05-15T23:15:20","date_gmt":"2018-05-15T21:15:20","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5531"},"modified":"2018-05-28T09:58:06","modified_gmt":"2018-05-28T07:58:06","slug":"vmware-powercli-eject-cd-dvd-media-from-vms","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/vmware-powercli-eject-cd-dvd-media-from-vms\/","title":{"rendered":"VMware PowerCli: Eject CD\/DVD Media from VMs"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5531 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5531')){$('.twoclick_social_bookmarks_post_5531').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"VMware%20PowerCli%3A%20Eject%20CD%2FDVD%20Media%20from%20VMs\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Awhen%20you%20have%20to%20eject%20or%20unmount%20DVD%20iso%20from%20your%20VMs%2C%20may%20be%20the%20iso%20files%20resists%20on%20datastore%20you%20want%20to%20remove%2C%20these%20one%20liner%20should%20help%20you.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/vmware-powercli-eject-cd-dvd-media-from-vms\\\/\",\"post_id\":5531,\"post_title_referrer_track\":\"VMware+PowerCli%3A+Eject+CD%2FDVD+Media+from+VMs\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>when you have to eject or unmount DVD iso from your VMs, may be the iso files resists on datastore you want to remove, these one liner should help you.<br \/>\n<!--more--><br \/>\nThis ejects all DVDs or CDs from your VMs<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; get-vm|Get-CDDrive|Set-CDDrive -NoMedia -Confirm:$false\r\n<\/pre>\n<p>This ejects all DVDs or CDs from your VMs where the iso files are at datastore0<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; get-vm|Get-CDDrive|?{$_.IsoPath -match &quot;^\\&#x5B;datastore0\\] .*&quot;}|Set-CDDrive -NoMedia -Confirm:$false\r\n<\/pre>\n<p>Or for a specific VM<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; get-vm &quot;yourVM&quot;|Get-CDDrive|Set-CDDrive -NoMedia -Confirm:$false\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, when you have to eject or unmount DVD iso from your VMs, may be the iso files resists on datastore you want to remove, these one liner should help you.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[344,7],"tags":[1184,1183,1182,1181,215,570,1185,14],"class_list":["post-5531","post","type-post","status-publish","format-standard","hentry","category-powershell-scripting","category-vmware","tag-all-vms","tag-cd","tag-dvd","tag-eject","tag-powercli","tag-vm","tag-vms","tag-vmware-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5531"}],"version-history":[{"count":4,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5531\/revisions"}],"predecessor-version":[{"id":5595,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5531\/revisions\/5595"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}