<?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>article How to Move a Template in VMware PowerCLI Documents</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/How-to-Move-a-Template/ta-p/2772800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was surprised this morning to find that you can't directly move templates using the existing cmdlets.  Looks like you can either a) change template to a VM using set-template or b) use Get-View on a Folder object and then call its &lt;A href="http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#moveInto"&gt;MoveIntoFolder&lt;/A&gt; method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method A&lt;/STRONG&gt; - there and back again&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;$vm = Get-Template wind* | Set-Template -ToVM | 
	Move-VM -Destination (Get-Folder templates) 
$vmView = $vm | Get-View
$vmView.MarkAsTemplate()&lt;/PRE&gt;&lt;P&gt;TotalSeconds      : 8.9222029&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method B&lt;/STRONG&gt; - do it folder style&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one should be much faster...let's see:&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;$TmplView = Get-Template wind* | Get-View
$FolderView = Get-Folder Templates | Get-View
$FolderView.MoveIntoFolder( $TmplView.MoRef )&lt;/PRE&gt;&lt;P&gt;TotalSeconds      : 2.0466224&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a winner &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the timing was performed on my home lab.  I imagine on nice hardware method B would take less than a second.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Aug 2008 16:33:13 GMT</pubDate>
    <dc:creator>halr9000</dc:creator>
    <dc:date>2008-08-17T16:33:13Z</dc:date>
    <item>
      <title>How to Move a Template</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/How-to-Move-a-Template/ta-p/2772800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was surprised this morning to find that you can't directly move templates using the existing cmdlets.  Looks like you can either a) change template to a VM using set-template or b) use Get-View on a Folder object and then call its &lt;A href="http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#moveInto"&gt;MoveIntoFolder&lt;/A&gt; method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method A&lt;/STRONG&gt; - there and back again&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;$vm = Get-Template wind* | Set-Template -ToVM | 
	Move-VM -Destination (Get-Folder templates) 
$vmView = $vm | Get-View
$vmView.MarkAsTemplate()&lt;/PRE&gt;&lt;P&gt;TotalSeconds      : 8.9222029&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method B&lt;/STRONG&gt; - do it folder style&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one should be much faster...let's see:&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;$TmplView = Get-Template wind* | Get-View
$FolderView = Get-Folder Templates | Get-View
$FolderView.MoveIntoFolder( $TmplView.MoRef )&lt;/PRE&gt;&lt;P&gt;TotalSeconds      : 2.0466224&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a winner &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the timing was performed on my home lab.  I imagine on nice hardware method B would take less than a second.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2008 16:33:13 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/How-to-Move-a-Template/ta-p/2772800</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2008-08-17T16:33:13Z</dc:date>
    </item>
  </channel>
</rss>

