Quantcast
Channel: User brunnerh - Super User
Viewing all articles
Browse latest Browse all 13

Answer by brunnerh for How do I make PowerShell run as administrator start in my home directory?

$
0
0

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.


Viewing all articles
Browse latest Browse all 13

Latest Images

Trending Articles





Latest Images