Manage and Change the Attributes of a File
Problem
You want to update the ReadOnly, Hidden, or System attributes of a file.
Solution
Most of the time, you will want to use the familiar attrib.exe program to change the attributes of a file:
attrib +r test.txt
attrib s test.txt To set only the ReadOnly attribute, you can optionally set the IsReadOnly property on the file:
$file = GetItem test.txt $file.IsReadOnly = $true
To apply a specific set of attributes, use the Attributes property on the file:
- Read more about Manage and Change the Attributes of a File
- Log in or register to post comments