skip to Main Content

For a better and faster use of the PowerShell terminal we can create various scripts.
With the default settings we have a big disadvantage:  we have to always change the path to our scripts.
To remove this problem, we can create a new profile.

How it’s done ?

  • check if a profile exists using this command: Test-Path $profile
  • If the results is False then:
    • paste the following command: New-Item -path $profile -type file –force
Now a new profile is created in this locationC:\Documents and Settings\Alexandru\My Documents\WindowsPowerShell 

How to create a custom PowerShell profile ?

  • now we will create a folder for our scripts in a desired location: D:\Scripturi
How to create a custom PowerShell profile ?
  • go to C:\Documents and Settings\Alexandru\My Documents\WindowsPowerShell and witha  text editor program open the Microsoft.PowerShell_profile.ps1 file.
By default, that file is empty, but depending on our needs, we can customize that file.
For example:
  • I want to change the default launch path;
  • I want to change the size of the PowerShell window;
  • I want to change the buffer size;
  • etc.

 How to create a custom PowerShell profile ?

Save and close the profile file.
Now open PowerShell and observe the new changes.

How to create a custom PowerShell profile ?

Because we changed the default path in the profile file, now we don’t need to use the cd command anymore. 
All we have to do is either type the script name, either type .\ and press the Tab key to navigate between scripts. 

(Visited 8 times, 1 visits today)

Cosmin Tătaru

Pasionat de blogging și tehnologie încă din 2009, Cosmin este aici să vă ajute să vă creșteți vânzările și productivitatea punând tehnologia la treabă pentru dumneavoastră.

Mergeți sus