Background
I was working with a codebase from a Github repository, which needed to be dockerised. Docker however threw the following error:
failed to solve: archive/tar: unknown file mode ?rwxr-xr-x
Various internet searches implied that this was due to various files having an "Archive" attribute applied. Attributes can be viewed by using ls
in the directory, and are shown under the "Mode" column.

The simple solution to resolve this, if you're able, is to create an archive of all of the files, then extract them back into the same location, then remove the temporary archive - this removes the flag.
The script below achieves a similar result with a programmatic approach:
$path = "C:\your\directory\with\archive\files"
$files = Get-ChildItem -Path $path -Recurse
$attribute = [io.fileattributes]::archive
foreach($file in $files)
{
if((Get-ItemProperty -Path $file.fullname).attributes -band $attribute)
{
Write-Host "Removing $attribute bit from $file..."
$file.attributes = 'Normal'
}
}
