In reply to Kate.

Kate,

The only method is to actually mark the file as READ ONLY in the operating system. Do this either with Windows Explorer (via file properties) or in your script.

$file = Get-Item $pth
$file.Attributes = 'ReadOnly'

Then reset:

$file.Attributes = 'Normal'