I tried the one liner solution to capture screenshot via adb and the file is created successfully on PC but it is unreadable:
C:\Program Files\Android\android-sdk\platform-tools>adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > c:\users\utilisateur\desktop\android_screenshot1.png

The file seem to be correct but I think the Magic is not correct:

EDIT: The same issue happened with Git Bash for Windows.
PNGfiles on my system. As doessed-adb shell screencap -p | sed "s/\r\r$//g" > test.pngperl -pe "binmode(STDOUT);s/\r\n/\n/g"