fsutil hardlink create %WINDIR%\system32\windowspowershell
\v1.0\psh.exe %WINDIR%\system32\windowspowershell\v1.0\powershell.exe
It works from with cmd.exe, as you'd expect, but not from within
powershell.exe. (I didn't really expect it to, though.)
It there a way to get powershell to resolve system environment
variables or do I need to retrieve them using PowerShell and build a
command line?
Never mind. Found it: $env:windir, hence:
fsutil hardlink create $env:WINDIR\system32\windowspowershell
\v1.0\psh.exe $env:WINDIR\system32\windowspowershell
\v1.0\powershell.exe
PS> [System.Environment]::ExpandEnvironmentVariables("%WINDIR%")
C:\Windows
- Oisin
That could be handy. Thanks.