title: Powershell App Pool set periodicRestart syntax
body: <p>I'm trying to set the <a href="http://www.iis.net/configreference/system.applicationhost/applicationpools/add/recycling/periodicrestart" rel="noreferrer"><code>periodicRestart</code></a> property using a powershell script, but I'm trying to use a slightly different syntax than what I've seen in code samples.</p>
  
  <p>Here's one way to do according to <a href="https://habaneroconsulting.com/insights/Set-the-Specific-Times-to-Recycle-an-Application-Pool-with-PowerShell#.VcEkn_lVhBc" rel="noreferrer">Set the specific times to recycle an application pool with PowerShell</a>:</p>
  
  <pre><code>Clear-ItemProperty $iisAppPoolName -Name Recycling.periodicRestart.schedule
  Set-ItemProperty   $iisAppPoolName -Name Recycling.periodicRestart.schedule `
                                     -Value @{value="01:00:00"}
  </code></pre>
  
  <p>However, I already have a block of code where I'm setting properties on the <code>$appPool</code> itself like this:</p>
  
  <pre><code>$appPool = New-WebAppPool $iisAppPoolName 
  $appPool.managedPipelineMode = "Classic"
  $appPool.managedRuntimeVersion = "c4.0"
  $appPool.recycling.periodicRestart.time = [TimeSpan]"00:00:00"
  $appPool | Set-Item
  </code></pre>
  
  <p>Which works fine, so I'd like to add the following line:</p>
  
  <pre><code>$appPool.recycling.periodicRestart.schedule = @{value="01:00:00"}
  </code></pre>
  
  <p>But I can't get the syntax for <code>@{value="01:00:00"}</code> to take.  The <code>schedule</code> property is expecting a hashtable which is what I'm passing it.</p>
  
  <p><img src="https://i.imgur.com/JEELNL0.png" alt="example"></p>
  
  <p>Any ideas?</p>