title: How to change extended windows file attributes via Powershell without using attrib.exe?
body: <p>This seems to be a quite simple question, yet googling gave me nothing.
  Here is the error (PS 5.1, win 10.0.14393 x64):</p>
  
  <pre><code>Set-ItemProperty $myFileInfo -Name Attributes -Value ([System.IO.FileAttributes]::Temporary)
  The attribute cannot be set because attributes are not supported. Only the following attributes can be set: Archive, Hidden, Normal, ReadOnly, or System.
  </code></pre>
  
  <p><code>attrib.exe</code> seems to support most of <code>System.IO.FileAttributes</code>. Unfortunately is does not seem to work with files referenced using FileSystem PSDrives. That is what I am using extensively.</p>
  
  <p>Making wrapper for <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa365535%28v=vs.85%29.aspx" rel="nofollow noreferrer">SetFileAttributes</a> kernel API call would be the last resort.</p>
  
  <p>Am I missing any other [more simple] ways setting these extended file attributes?</p>
  
  <p>PS. Apart from <code>[System.IO.FileAttributes]::Temporary</code> I am interested in setting <code>[System.IO.FileAttributes]::NotContentIndexed</code>.</p>