If you always use a shortcut you can just add the arguments:
-NoExit -Command "cd ~"
If you want this to always execute you can make a profile, to do this create the file (and missing folders on the path):
%userprofile%\Documents\WindowsPowerShell\profile.ps1
And place the cd command (cd ~
) inside it.
To allow the scripts execution on startup you need to change the execution policy to be less restrictive or bypass it.
To bypass you can pass an argument when starting powershell:
-ExecutionPolicy Bypass
To change the policy run powershell as admin and execute:
Set-Executionpolicy RemoteSigned
Do this at your own risk of course. If you did you will always end up in your home folder on startup.
Do you only want this to take effect when you open the PS CLI, or system-wide (ie: when scripts are run, etc.)? – Ƭᴇcʜιᴇ007 – 2011-11-14T14:55:26.390
@techie007 When I open the CLI. Hadn't actually considered the script case. – aknuds1 – 2011-11-14T15:06:59.197