title: powershell execute appcmd with /IN < pathToFile
body: <p>I in the process of building a ps1 file to create all my IIS site(s), Virtual Directories and app pools via appcmd.  I have used the appcmd list /xml to get the settings from the master machine and saved them into config files.  What I am trying to get powershell to execute an appcmd command</p>
  
  <pre><code>  appcmd add apppool /IN &lt; pathtoFile.xml
  </code></pre>
  
  <p>my issue is within powershell is I can not use the less than symbol:</p>
  
  <pre><code>PS C:\temp\deployments&gt; .\createIISSetup.ps1
  The '&lt;' operator is reserved for future use.
  At C:\temp\deployments\createIISSetup.ps1:36 char:28
  +     .$appcmd add apppool /IN &lt; &lt;&lt;&lt;&lt;  $pathToAppPoolSettings;
      + CategoryInfo          : ParserError: (&lt;:OperatorToken) [], ParseException
      + FullyQualifiedErrorId : RedirectionNotSupported
  </code></pre>
  
  <p>if I use the pipe:</p>
  
  <pre><code>  appcmd add apppool /IN | pathtoFile.xml
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>PS C:\temp\deployments&gt; .\createIISSetup.ps1
  Expressions are only allowed as the first element of a pipeline.
  At C:\temp\deployments\createIISSetup.ps1:36 char:51
  +     .$appcmd add apppool /IN | $pathToAppPoolSettings &lt;&lt;&lt;&lt; ;
      + CategoryInfo          : ParserError: (:) [], ParseException
      + FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline
  </code></pre>