At this stage, Git supplies the path to the commit message as the first argument; this can simply be used in the script block. An alternative way would be to export the variable as an environment variable, and grab that in the PowerShell script, as shown in https://stackoverflow.com/a/56758774
This (and other) git hook can be used by default by setting the config globally:
git config --global core.hooksPath /path/to/my/centralized/hooks
For a more granular, repository-level approach, you can set a directory that is under version control to be your git hooks directory, e.g., MY_REPO_DIR/.githooks
and execute this command after cloning:
git config --local core.hooksPath .githooks/