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
From here:
function Get-FileAttribute{
param($file,$attribute)
$val = [System.IO.FileAttributes]$attribute;
if((gci $file -force).Attributes -band $val -eq $val){$true;} else { $false; }
}
function Set-FileAttribute{
param($file,$attribute)
$file =(gci $file -force);
$file.Attributes = $file.Attributes -bor ([System.IO.FileAttributes]$attribute).value__;
if($?){$true;} else {$false;}
}