I have a Powershell script that copies files from one location to another. Once the copy is complete I want to clear the Archive attribute on the files in the source location t
You may use the following command to toggle the behaviour
$file = (gci e:\temp\test.txt)
$file.attributes
Archive
$file.attributes = $file.Attributes -bxor ([System.IO.FileAttributes]::Archive)
$file.attributes
Normal
$file.attributes = $file.Attributes -bxor ([System.IO.FileAttributes]::Archive)
$file.attributes
Archive