title: Set Folder Permission with icacls
body: <p>I am embarrased that I have to ask this, but  as the syntax of <code>icacls</code> apparently has changed in powershell, I seem to be unable to assemble a working command.</p>
  
  <p><strong>What I am trying to do:</strong></p>
  
  <p>I want to remove all permissions from a specific folder and then add the "Current logged on user" and "SYSTEM" to have Full Control. But not Admins or anything else.</p>
  
  <p><strong>What I have:</strong></p>
  
  <pre><code>icacls $MyFolder /inheritance:r /grant: $Domain\Env:Username:(OI)(CI)F /T /grant: SYSTEM:(OI)(CI)F /T
  </code></pre>
  
  <p>But everytime when I execute the command I get an error</p>
  
  <blockquote>
    <p>(OI)(CI) /T has not been recognized as a cmdlet or command...</p>
  </blockquote>
  
  <p>I have read some tricks on the internet to use different kind of quotes or backticks for the parameters, but nothing worked for me.</p>
  
  <p>Can anyone please tell my what I am doing wrong here?</p>