Everytime when open a powershell, I always change the directory where my scripts reside which is C:\scripts folder. There is an easy way to accomplish this. We can save all these customization in to our profile so that when we open a session, they will get applied automatically. Some of these are below as examples;
(check whether it’s already been created if not create one
new-item $profile -Force
Then start putting your changes in to your profile
Add-Content -Value ‘cd c:\Scripts’ -Path $profile
Add-Content -Value ‘$host.privatedata.errorforegroundcolor=”green”‘ -Path $profile
Add-Content -Value ‘write-host “Hello Murat – Nice to see you again!” -foregroundcolor magenta’ -Path $profile
You can do a lot more but these are just a few examples..
Let’s have a looks….