PowerShell – create and edit profiles

PowerShell – create and edit profiles

No Comments on PowerShell – create and edit profiles

If you use aliases, functions or variables in PowerShell so they are only available for your active session. As soon as you quit your session, all changes are lost.

To permanently use your custom settings in PowerShell you can work with PowerShell Profiles. Here you can configure aliases, functions and variables. The profile is loaded every time you start a new PowerShell session and so your custom Settings are available to you.

Profiles can be created for single users or for all users of a system. Also, you can copy and deploy profiles to get an consistent PowerShell environment. Especially in large environments this can be very helpful.

Profiles

There are four types of profiles. More specific profiles override the gernal:

  • %windir%\system32\WindowsPowerShellv1.0profile.ps1
      profile for all users and all shells
  • %windir%\system32\WindowsPowerShellv1.0 Microsoft.PowerShell_profile.ps1
      profile for all users but only Microsoft.PowerShell shell
  • %UserProfile%\Documents\WindowsPowerShellprofile.ps1
      profile for current user and all shells
  • %UserProfile%\Documents\WindowsPowerShellMicrosoft.PowerShell_profile.ps1
      profile for current user but only Microsoft.PowerShell shell

Creation

Follow these steps to create a profile:

Now you can configure your custom setting… Have a look at the following idea from Jeff Wouters, how to configure PowerShell

Customize PowerShell Prompt

powershell

About the author:

Ich bin Eric Berg und bin Senior IT-Consultant für Microsoft Solutions und hauptsächlich im Bereich Virtualisierung, Client-Lifecycle Management, Private und Public Cloud aktiv. Seit 2015 bin ich System Center Cloud und Datacenter MVP. Seit 2014 bin ich Microsoft Partner Technical Solutions Professional (P-TSP) und agiere im Auftrag von Microsoft mit Kunden rund um die oben beschriebenen Themen. Alle Gedanken, Meinungen und Ideen auf dieser Website sind von mir und spiegeln nicht die Haltung meines Arbeitgebers oder von Microsoft wieder.

Related Posts

Leave a comment

Back to Top