How to Change File Properties (ReadOnly, CreationTime etc.) Using PowerShell

Changing file properties is quite easy with PowerShell.

 

Remove ReadOnly attribute:

 

Change CreationTime (90 days back in time):

 

 

 

Handling attributes with hyphens in PowerShell

Sometimes we need working with PowerShell objects which have attributes with hyphens. That can be a bit difficult as PowerShell assumes hyphens are used with operators and parameters.

Below is an example on how to get around this, and rename the attribute: