
ファイルに読み取り専用属性を付けるには、Set-ItemPropertyを使います。
例
test.logというファイルに読み取り専用属性を付けます。1 | PS C:\work> Set-ItemProperty test.log attributes ReadOnly |
Get-ItemPropertyで確認してみます。
1 2 3 4 5 6 7 8 9 | PS C:\work> Get-ItemProperty test.log ディレクトリ: C:\work Mode LastWriteTime Length Name ---- ------------- ------ ---- - -r --- 2016/11/23 17:39 1709 test.log |
読み取り専用になりました。
スポンサーリンク