Crucially, placing the PowerShell code into the post-commit file doesn't seem to work. Without the line #!/bin/sh git will report "error: cannot spawn .git/hooks/post-commit: No such file or directory". So some form of top comment or shebang is needed but I can't work out which. If pasted into powershell whilst inside a git repo the above code will run and update the site.
When using the curl code it is essential that no new lines at the top or tabs are added when saving in Windows.