Came across a strange issue today when cloning my repository back down from GitHub.
An example would be the following line which works fine when ran independently in a local shell:
New-ItemProperty –Path HKCU:\SOFTWARE\Microsoft\Office\15.0\Common\Identity\ –Name EnableADAL -Value 1 -PropertyType DWord -Force | Out-Null
However when you commit this to GitHub and then clone it back, it no longer runs and returns the error as below:
New-ItemProperty : Cannot find drive. A drive with the name 'â€Path HKCU' does not exist. At Z:\Outlook-Master-Tool\v1.2.prerelease.ps1:60 char:1
- New-ItemProperty –Path HKCU:\SOFTWARE\Microsoft\Office\15.0\Common\ ...
As you can see, it adds †to the path somehow. Additionally, if you manually rewrite the command or copy the whole script into ISE, it runs fine.
What is going on? I really want to use GitHub for version control. I have a feeling it might be an encoding misconfiguration somewhere?
Thanks