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
As the Attributes is basically a bitmask field, you need to be sure clear the archive field while leaving the rest alone:
PS C:\> $f = get-item C:\Archives.pst PS C:\> $f.Attributes Archive, NotContentIndexed PS C:\> $f.Attributes = $f.Attributes -band (-bnot [System.IO.FileAttributes]::Archive) PS C:\> $f.Attributes NotContentIndexed PS H:\>