Packer failing to upload the remote cleanup script

Packer failing to upload the remote cleanup script.
Using Adminstrator account with auto generated password for Winrm connection
Sy prep step is completed successfully but failing on cleanup scripts with http response error 401-invalid content type
I am using packer version 1.7.5
Is anyone having similar issue and can you help