I'm still relatively new to Vista and although I like, some things drive me crazy: I am now using Powershell extensively and work a lot on the main profile which is located in C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1. I have an alias in Powershell to edit the profile in Notepad2.exe so I can quickly edit it and then reload the shell. When starting the shell, my profile show it's version as a date. Recently I noted that the date shown and the one in the profile.ps1 file don't match. After some poking around it turned out that I had started notepad2.exe as a normal user who doesn't have write access to the system directory. Even though it loads the file from C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 Vista's file virtualization kicks in when saving it, so it ends up at: C:\Users\pete\AppData\Local\VirtualStore\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 It's pretty useless there because Powershell still needs it under C:\Windows\System32\. So knowing this, I started only editing the profile as an administrator. I usually have a second Powershell open to run admin stuff, here the function I use for starting it:
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
C:\Users\pete\AppData\Local\VirtualStore\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
function su { if ($tnNT6x -eq $TRUE) { $ShellApp = New-Object -ComObject Shell.Application $ShellApp.ShellExecute("$PSHOME\powershell.exe","","","runas") } else { WinAppEx "runas.exe" "/user:$tnAdminUser $PSHOME\powershell.exe" } }
notepad2.exe $PSHOME\profile.ps1
notepad2.exe C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
notepad.exe C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
Remember Me
a@href@title, b