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