---
title: "PowerShell Profile : A Getting Started Guide"
description: "Discover everything you need to know about the PowerShell Profile in this definitive guide with real-world examples!"
canonical: "https://adamtheautomator.com/powershell-profile-a-getting-started-guide/"
---

# PowerShell Profile : A Getting Started Guide

> Discover everything you need to know about the PowerShell Profile in this definitive guide with real-world examples!

Source: https://adamtheautomator.com/powershell-profile-a-getting-started-guide/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![PowerShell Profile : A Getting Started Guide](https://adamtheautomator.com/wp-content/uploads/2022/11/A-Getting-Started-Guide-to-the-PowerShell-Profile.jpg)

# PowerShell Profile : A Getting Started Guide

[![](https://secure.gravatar.com/avatar/a3e6f24b6b657f0acd2615f1802513a18663dea2e04d24e1df9c1530290e9b48?s=192&d=mm&r=g)Uzma Younas](https://adamtheautomator.com/author/uzma-younas/)23 November 20225 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Creating a PowerShell Profile](#creating-a-powershell-profile)
*   [Customizing a PowerShell Profile](#customizing-a-powershell-profile)
*   [Setting Aliases for Quick Commands and Functions Accessibility](#setting-aliases-for-quick-commands-and-functions-accessibility)
*   [Customizing How the PowerShell Console Looks](#customizing-how-the-powershell-console-looks)
*   [Supplying Default Values for Parameters](#supplying-default-values-for-parameters)
*   [Conclusion](#conclusion)

Have you ever felt tired of running the exact commands or scripts repeatedly? Why not let a PowerShell profile make your life easier?

A PowerShell Profile is a script composed of written instructions that execute when you launch a PowerShell session. And in this tutorial, you will learn many ways to configure your PowerShell profile.

Sounds interesting? Stay tuned and automate custom code executions!

## Prerequisites

*   A Windows or Linux computer – This tutorial uses Windows 11 PC.
*   PowerShell 7 or 5.1 installed on your system.

Related:[PowerShell 7 Upgrade : A How to Walk Through](https://adamtheautomator.com/powershell-7-upgrade/)

## Creating a PowerShell Profile

A PowerShell profile is a regular script that runs each time you start a PowerShell session. Depending upon the operating system, the PowerShell profile for ‘current user, current host’ is located at the following:

<table><tbody><tr><td>Operating System</td><td>PowerShell Profile Location</td></tr><tr><td>Windows</td><td><em>$Home\Documents\PowerShell\Microsoft.PowerShell_profile.ps1</em></td></tr><tr><td>macOS and Linux</td><td><em>~/.config/powershell/Microsoft.Powershell_profile.ps1</em></td></tr></tbody></table>

To create a PowerShell profile:

1\. Open [PowerShell as administrator](https://adamtheautomator.com/powershell-run-as-administrator/), and run the below Test-Path command to check if a PowerShell profile already exists.

```powershell
 Test-Path $profile
```

Related:[How to Use the PowerShell Test-Path Cmdlet](https://adamtheautomator.com/powershell-test-path/)

Below, you can see the command returned False, which confirms there is no existing PowerShell profile yet.

![Checking for an existing PowerShell profile](https://adamtheautomator.com/wp-content/uploads/2022/11/image-326.png)

Checking for an existing PowerShell profile

There are, in fact, different profiles for the current user and all users, as shown below. But when talking about the Windows PowerShell profile, you are referring to the ‘Current user – Current Host’ profile.

**Windows PowerShell 5.1**

<table><tbody><tr><td><strong>Profile</strong></td><td><strong>Path</strong></td></tr><tr><td>Current User – Current Host</td><td><em>$Home\[My ]Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1</em></td></tr><tr><td>Current User – All Hosts</td><td><em>$Home\[My ]Documents\WindowsPowerShell\Profile.ps1</em></td></tr><tr><td>All Users – Current Host</td><td><em>$PSHOME\Microsoft.PowerShell_profile.ps1</em></td></tr><tr><td>All Users – All Hosts</td><td><em>$PSHOME\Profile.ps1</em></td></tr></tbody></table>

> 💡 _The $Home variable references the current users home directory while the $PSHOME variable references the installation path of PowerShell._

**PowerShell 7.x**

<table><tbody><tr><td><strong>Profile</strong></td><td><strong>Path</strong></td></tr><tr><td>Current User – Current Host – Windows</td><td><em>$Home\[My ]Documents\Powershell\Microsoft.Powershell_profile.ps1</em></td></tr><tr><td>Current User – Current Host – Linux/macOS</td><td><em>~/.config/powershell/Microsoft.Powershell_profile.ps1</em></td></tr><tr><td>Current User – All Hosts – Windows</td><td><em>$Home\[My ]Documents\Powershell\Profile.ps1</em></td></tr><tr><td>Current User – All Hosts – Linux/macOS</td><td><em>~/.config/powershell/profile.ps1</em></td></tr><tr><td>All Users – Current Host – Windows</td><td><em>$PSHOME\Microsoft.Powershell_profile.ps1</em></td></tr><tr><td>All Users – Current Host – Linux/macOS</td><td><em>/usr/local/microsoft/powershell/7/Microsoft.Powershell_profile.ps1</em></td></tr><tr><td>All Users – All Hosts – Windows</td><td><em>$PSHOME\Profile.ps1</em></td></tr><tr><td>All Users – All Hosts – Linux/macOS</td><td><em>/usr/local/microsoft/powershell/7/profile.ps1</em></td></tr></tbody></table>

2\. Next, run the following [New-Item](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.2) command to create your PowerShell profile. This command creates a script file in the Current User – Current Host profile path ($profile).

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

![Creating a new PowerShell profile](https://adamtheautomator.com/wp-content/uploads/2022/11/image-327.png)

Creating a new PowerShell profile

Now, run each of the below commands to check the path of the PowerShell profile for each user.

```powershell
# Return the PowerShell profile path of the Current user - Current host
$profile
# Return the PowerShell profile path of the Current user - All hosts
$profile.CurrentUserAllHosts
# Return the PowerShell profile path of the All users - Current host
$profile.AllUsersCurrentHost
# Return the PowerShell profile path of the All users - Current host
$profile.AllUsersAllHosts
```

The outputs below display the path of each profile for PowerShell 5 and 7.

![Checking PowerShell 5 profiles location](https://adamtheautomator.com/wp-content/uploads/2022/11/image-328.png)

Checking PowerShell 5 profiles location

![Checking PowerShell 7 profiles location](https://adamtheautomator.com/wp-content/uploads/2022/11/image-329.png)

Checking PowerShell 7 profiles location

## Customizing a PowerShell Profile

A newly-created PowerShell profile is blank by default. You can include variables, aliases, and commands you frequently use in your PowerShell profile without recreating them in each session.

But first, you may want to change PowerShell’s execution policy since PowerShell disables the execution of scripts by default to prevent malicious scripts from affecting the system.

Run the command below to set PowerShell’s execution policy ([Set-ExecutionPolicy](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2)) to RemoteSigned.

The RemoteSigned policy dictates that any script should be signed if not created on the system where you run them. This policy requires a digital signature for the scripts to come from the internet or be downloaded by applications such as Internet Explorer, Outlook, or Messenger.

```powershell
Set-ExecutionPolicy RemoteSigned
```

![Setting execution policy to RemoteSigned](https://adamtheautomator.com/wp-content/uploads/2022/11/image-330.png)

Setting execution policy to RemoteSigned

Related:[Set-ExecutionPolicy for Managing PowerShell Execution Policies](https://adamtheautomator.com/set-executionpolicy/)

Now, run either of the following commands, which do not provide output, but open your PowerShell profile ($PROFILE) in PowerShell ISE or Notepad.

```powershell
# Opens PowerShell profile in PowerShell ISE
ise $PROFILE 
# Opens PowerShell profile in Notepad
notepad $PROFILE
```

### Setting Aliases for Quick Commands and Functions Accessibility

Aliases are the most common customizations, as they let you refer to PowerShell commands by your chosen name.

Add the following aliases to your PowerShell profile, save the changes but do not close the file yet.

```
# Create aliases for frequently used applications.
New-Alias np Notepad.exe
     
# Create aliases for frequently used commands
Set-Alias tn Test-NetConnection
```

### Customizing How the PowerShell Console Looks

Apart from aliases, you can also change how PowerShell operates and enhance its interactive experience with a personalized prompt.

1\. Include the following content in your PowerShell profile to reflect the changes in default settings, save the changes and close the file.

The Color-Console function below changes the default appearance of PowerShell by changing its color and displaying the current date/time.

```
# Create a function to change colors in PowerShell
function Color-Console {
	$Host.ui.rawui.backgroundcolor = "darkcyan"
	$Host.ui.rawui.foregroundcolor = "white"
	$hosttime = (Get-ChildItem -Path  $PSHOME\\PowerShell.exe).CreationTime
	$Host.UI.RawUI.WindowTitle  =  "PowerShell ($hosttime)"
	Clear-Host
}
 
# Calls the Color-Console function
Color-Console
```

2\. Now, run the below command to reload your PowerShell profile.

```powershell
 . $profile
```

You will see the following changes to your profile reflected on the PowerShell console.

![Reloading the PowerShell profile](https://adamtheautomator.com/wp-content/uploads/2022/11/image-331.png)

Reloading the PowerShell profile

3\. Lastly, run the tn alias you set in your PowerShell profile instead of the Test-NetConnection cmdlet to test your network connection. Likewise, you can use np to open the notepad.

```powershell
# Test network connection
tn
# Open notepad
np
```

![Testing network connection by running an alias of Test-NetConnection cmdlet](https://adamtheautomator.com/wp-content/uploads/2022/11/image-332.png)

Testing network connection by running an alias of Test-NetConnection cmdlet

### Supplying Default Values for Parameters

Instead of repeatedly specifying a hard-to-remember particular parameter value, why not use the $PSDefaultParameterValues preference variable? This feature is handy as it lets you specify custom values for a cmdlet or function.

The $PSDefaultParameterValues preference variable is a hash table with entries in two parts: the key and the value. Keys must match the pattern cmdlet:parameter, where values can be either a parameter (a string, boolean, or integer) or a script block.

The general syntax for using the $PSDefaultParameterValues preference variable is as follows:

```powershell
$PSDefaultParameterValues=@{"CmdletName:ParameterName"="DefaultValue"}
```

To see the $PSDefaultParameterValues preference variable in action:

1\. Run the below command, which does not provide output, but sets the Verbose parameter True for all commands (\*). A new entry will be added to the $PSDefaultParameterValues hash table.

```powershell
$PSDefaultParameterValues=@{"*:Verbose"=$True}
```

2\. Next, run the $PSDefaultParameterValues variable without parameters to verify the default parameter variable value.

```powershell
$PSDefaultParameterValues
```

![Changing default values for parameters](https://adamtheautomator.com/wp-content/uploads/2022/11/image-333.png)

Changing default values for parameters

Now, run the following tn alias to test your network connection.

```powershell
tn
```

Below, you can see the verbose details as the command runs since the Verbose parameter value is set to True by default for all commands.

![Testing the $PSDefaultParameterValues preference variable](https://adamtheautomator.com/wp-content/uploads/2022/11/image-334.png)

Testing the $PSDefaultParameterValues preference variable

## Conclusion

In this tutorial, you came across several features of the PowerShell profile and changed the looks of your PowerShell console. But more importantly, you learned how PowerShell lets you define and reuse frequently used scripts.

With this newfound knowledge, if you are mainly a PowerShell user, why not add new aliases and scripts to run on startups to assist with your workflow? Having a PowerShell profile configured indeed is a lifesaver!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-profile-a-getting-started-guide%2F&text=PowerShell%20Profile%20%3A%20A%20Getting%20Started%20Guide)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-profile-a-getting-started-guide%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-profile-a-getting-started-guide%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
