title: How to remove read-only attribute of a folder by powershell?
body: <p>I have tried many code but still I am not able to remove read-only property of that particular folder.</p>
  
  <p>Below is the code which removes read-only property of the files present under that folder but does not remove read-only attribute of that Folder :</p>
  
  <pre><code>$Path = "C:\Suraj\powershell scripts\review script" 
  $Files = Get-ChildItem $Path -Recurse
  ForEach ($File in $Files) {
      Write-Host file:$File IsReadOnly: $File.IsReadOnly 
      if ($File.Attributes -ne "Directory" -and $File.Attributes -ne "Directory, Archive") {
          try {
              Set-ItemProperty -Path $Path"\"$File -name IsReadOnly -value $false 
          }
          catch { 
              Write-Host "Error at file " $Path "\" $File 
          }
      } 
  }
  </code></pre>