Copy-ContentToCache Error in 3.10.2

Hi

I’ve seen this on a few packages now using this function (Copy-ContentToCache), where log throws an error. I think it’s when it tries to run the below code and will state this only for the first file it comes across outside of the toolkit

Set-ItemProperty -LiteralPath $RobocopyDestination -Name Attributes -Value ($DestFolderAttributes -band (-bnot [System.IO.FileAttributes]::Directory))

Below from log:

C:\Temp\3661-TSAWebtool\6.0\AppDeployToolkit\AppDeployToolkitMain.ps1
C:\Temp\3661-TSAWebtool\6.0\AppDeployToolkit\RunHidden.vbs
C:\Temp\3661-TSAWebtool\6.0\Files\3661_3_GBL_M_0101_TSAWebtool6.0-Prod.msi
Set-ItemProperty : The attribute cannot be set because attributes are not supported. Only the following attributes can be set: Archive, Hidden, Normal, ReadOnly, or System.
At C:\Temp\3661-TSAWebtool\6.0\AppDeployToolkit\AppDeployToolkitMain.ps1:5340 char:25
+ ...             Set-ItemProperty -LiteralPath $RobocopyDestination -Name  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (FileAttributes ...tContentIndexed:PSNoteProperty) [Set-ItemProperty], IOException
    + FullyQualifiedErrorId : SetPropertyError,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Can this be ignored or possibly a bug ?

Many Thanks

Grant

:smile:

Could be a bug.

If you can reproduce it consistently, report it here : Issues · PSAppDeployToolkit/PSAppDeployToolkit · GitHub

Thanks for reporting, that does indeed sound like a bug and I’ll look into it. You should be able to work around it for the time being by setting -UseRobocopy $false.

Issue confirmed, and I have a fix ready - however, it is not thowing a terminating error or even writing to the log in my case, only showing on the console output.

Is this the same behaviour you are seeing, or is this error causing the script to terminate for you?

1 Like

Good morning, Dan,

Thank you, yes this is the same behavior we are seeing. Script does not terminate, all files copy, error only showing in console output, so no major impact and we are staying with the version.

Regards

Thanks for confirming! I did create a fix here, but our efforts are focussed on v4 right now and we only want to release a new v3 update if a critical bug is found.

1 Like

Thank you, Dan, that worked clear after below.

Added in delimiter at line 5347 $RobocopyDestination to ${RobocopyDestination}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.