Set and remove the read-only file attribute with PowerShell

PHOTO EMBED

Fri Jul 08 2022 07:07:21 GMT+0000 (Coordinated Universal Time)

Saved by @pepo72 #powershell

$setRoAttributeTo = $true
Get-ChildItem -Path $folderPath | foreach {
    Set-ItemProperty -Path $folderPath\TestFile.txt -Name IsReadOnly -Value $setRoAttributeTo
}
content_copyCOPY

https://4sysops.com/archives/set-and-remove-the-read-only-file-attribute-with-powershell/