I created a powershell script to run as a commit hook to write the username to a file. The command I am using in powershell to extract the username is:
$repodir = "C:\Users\Administrator\Documents\Visual Studio 2012\Projects\testRepo"
cd $repodir
$hguser = hg --cwd $repodir tip | grep user
where $repodir is the directory of the repository. When I commit from the powershell command line the hook executes an extracts the username as desired. When I commit from within tortoisehg workbench the hook executes (I can see changes in my output file) but there is no information in $hguser, other hg commands also have no affect. Is there special syntax needed to execute hg from within tortoisehg, is it executing in the correct path?