Powershell – How to Remove ReadOnly Attribute on File Using PowerShell

powershellpowershell-1.0scripting

How can I remove the ReadOnly attribute on a file, using a PowerShell (version 1.0) script?

Best Solution

You can use Set-ItemProperty:

Set-ItemProperty file.txt -name IsReadOnly -value $false

or shorter:

sp file.txt IsReadOnly $false