Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 772 other subscribers


  • LinkedIn
  • RSS Feed for Posts
  • Twitter
  • StumbleUpon

Start powershell with the same settings everytime.

Do you need to add the same command’s in powershell everytime you start powershell?

This can be done automatically !


I always start powershell with start-stranscript and change the default location to C:\Scripts.

You can execute this automatically :


First check wetter there is a Profile in use

Test-Path $profile


False => there is no profile => create a new profile

True => There already is a profile


Create a new profile:

New-Item -path $profile -type file –force


Edit an existing profile:

If ((Test-Path $Profile) -eq “True”) {Notepad $Profile}


You can view the location of you’re $Profile by executing :



Add you’re default command’s and save

Change the windows size + scroll back buffer

$Shell = $Host.UI.RawUI
$size = $Shell.WindowSize
$Shell.WindowSize = $size
$size = $Shell.BufferSize
$Shell.BufferSize = $size


Change title:



Change colors:

$shell.BackgroundColor = “Gray”
$shell.ForegroundColor = “Black”


Add alias to scripts you’ll often use:

new-item alias:cal -value C:\Windows\System32\calc.exe


Clear your screen :





Screen output :


Now we can call the scripts often used with their alias

(in this example I’ve used cal for calculator.exe, you can use every script you want)