'MSdeploy not update the destination folder throwing an error. - Source filePath does not match destination differing in attributes

I'm trying to deploy a web application into remote machines using MSDeploy and powershell script. Some files are not getting copied over since the files are in the subfolders. Unable to track down issue.

 $list = $(Machines)
      $lists = $list.split(“,”);
      $msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
      $lists | ForEach-Object{
      $computerName = $_
      [string[]]$msdeployArgs = @(
          "-verb:sync",
          "-source:package='SourceFilepath'",
          "-dest=auto,ComputerName='$($computerName)'",
          "-disableLink:AppPoolExtension",
          "-disableLink:ContentExtension",
          "-disableLink:CertificateExtension",
          "-setParam:name=`"IIS Web Application Name`",value=`"Default Web Site\${{parameters.DefaultWebApp}}`""
          "-enableRule:AppOffline,IgnoreFileLastWriteTime"
          "-verbose"
          )
        Write-Host $msdeployArgs

        Start-Process $msdeploy -NoNewWindow -ArgumentList $msdeployArgs

And getting error - Source filePath does not match destination differing in attributes.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source