O'Reilly logo

Mastering Windows PowerShell Scripting by Brenton J.W. Blawat

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting the mode and extended file and folder attributes

When you want to change the mode and the extended attributes of a file or folder, you need to access the extended property named Attributes. The Attributes property allows you to read and write to itself. This means that if you want to replace all of the file or folder attributes, you can just declare the new Attributes and set them to the Attributes property. Likewise, if you want to maintain the existing Attributes but want to add new Attributes, you declare a variable and call the existing Attributes property; then you add the new Attributes using a comma separator. You then set that new variable to the Attributes property of a file or folder.

To view and add a new extended file attribute, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required