Recently, I was trying to publish a module and ran into an error:
Failed to generate the compressed file for module ‘Attempting to build package …’
After searching for a bit, I found someone who fixed a similar issue with a nuget reisntall. That got me thinking that my psd1 was not problematic, but rather my PowerShellGet was problematic.
So I Save-Module PowerShellGet -Path C:\temp then deleted the current PowerShellGet (manually using Explorer), reinstalled and voila. I was able to publish my module.