{
	"id": "811852b5-c050-45e1-8240-0531314c6875",
	"created_at": "2026-04-06T00:14:35.636607Z",
	"updated_at": "2026-04-10T13:12:53.490887Z",
	"deleted_at": null,
	"sha1_hash": "90b00ad579c6a86e8a78b5c41d37ad4189c609ce",
	"title": "about_Profiles - PowerShell",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 97773,
	"plain_text": "about_Profiles - PowerShell\r\nBy sdwheeler\r\nArchived: 2026-04-05 18:08:26 UTC\r\nShort description\r\nDescribes how to create and use a PowerShell profile.\r\nLong description\r\nYou can create a PowerShell profile to customize your environment and add session-specific elements to every\r\nPowerShell session that you start.\r\nA PowerShell profile is a script that runs when PowerShell starts. You can use the profile as a startup script to\r\ncustomize your environment. You can add commands, aliases, functions, variables, modules, PowerShell drives\r\nand more. You can also add other session-specific elements to your profile so they're available in every session\r\nwithout having to import or re-create them.\r\nPowerShell supports several profiles for users and host programs. However, it doesn't create the profiles for you.\r\nProfile types and locations\r\nPowerShell supports several profile files that are scoped to users and PowerShell hosts. You can have any or all\r\nthese profiles on your computer.\r\nThe PowerShell console supports the following basic profile files. These file paths are the default locations.\r\nAll Users, All Hosts\r\nWindows - $PSHOME\\Profile.ps1\r\nLinux - /opt/microsoft/powershell/7/profile.ps1\r\nmacOS - /usr/local/microsoft/powershell/7/profile.ps1\r\nAll Users, Current Host\r\nWindows - $PSHOME\\Microsoft.PowerShell_profile.ps1\r\nLinux - /opt/microsoft/powershell/7/Microsoft.PowerShell_profile.ps1\r\nmacOS - /usr/local/microsoft/powershell/7/Microsoft.PowerShell_profile.ps1\r\nCurrent User, All Hosts\r\nWindows - $HOME\\Documents\\PowerShell\\Profile.ps1\r\nLinux - ~/.config/powershell/profile.ps1\r\nmacOS - ~/.config/powershell/profile.ps1\r\nCurrent user, Current Host\r\nWindows - $HOME\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 1 of 6\n\nLinux - ~/.config/powershell/Microsoft.PowerShell_profile.ps1\r\nmacOS - ~/.config/powershell/Microsoft.PowerShell_profile.ps1\r\nThe profile scripts are executed in the order listed. This means that changes made in the AllUsersAllHosts profile\r\ncan be overridden by any of the other profile scripts. The CurrentUserCurrentHost profile always runs last. In\r\nPowerShell Help, the CurrentUserCurrentHost profile is the profile most often referred to as your PowerShell\r\nprofile.\r\nOther programs that host PowerShell can support their own profiles. For example, Visual Studio Code (VS Code)\r\nsupports the following host-specific profiles.\r\nAll users, Current Host - $PSHOME\\Microsoft.VSCode_profile.ps1\r\nCurrent user, Current Host - $HOME\\Documents\\PowerShell\\Microsoft.VSCode_profile.ps1\r\nThe profile paths include the following variables:\r\nThe $PSHOME variable stores the installation directory for PowerShell\r\nThe $HOME variable stores the current user's home directory\r\nNote\r\nIn Windows, the location of the Documents folder can be changed by folder redirection or OneDrive. We don't\r\nrecommend redirecting the Documents folder to a network share or including it in OneDrive. Redirecting the\r\nfolder can cause modules to fail to load and create errors in your profile scripts. For information about removing\r\nthe Documents folder from OneDrive management, consult the OneDrive documentation.\r\nThe $PROFILE variable\r\nThe $PROFILE automatic variable stores the paths to the PowerShell profiles that are available in the current\r\nsession.\r\nTo view a profile path, display the value of the $PROFILE variable. You can also use the $PROFILE variable in a\r\ncommand to represent a path.\r\nThe $PROFILE variable stores the path to the \"Current User, Current Host\" profile. The other profiles are saved in\r\nnote properties of the $PROFILE variable.\r\nFor example, the $PROFILE variable has the following values in the Windows PowerShell console.\r\nCurrent User, Current Host - $PROFILE\r\nCurrent User, Current Host - $PROFILE.CurrentUserCurrentHost\r\nCurrent User, All Hosts - $PROFILE.CurrentUserAllHosts\r\nAll Users, Current Host - $PROFILE.AllUsersCurrentHost\r\nAll Users, All Hosts - $PROFILE.AllUsersAllHosts\r\nBecause the values of the $PROFILE variable change for each user and in each host application, ensure that you\r\ndisplay the values of the profile variables in each PowerShell host application that you use.\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 2 of 6\n\nTo see the current values of the $PROFILE variable, type:\r\n$PROFILE | Select-Object *\r\nYou can use the $PROFILE variable in many commands. For example, the following command opens the \"Current\r\nUser, Current Host\" profile in Notepad:\r\nnotepad $PROFILE\r\nThe following command determines whether an \"All Users, All Hosts\" profile has been created on the local\r\ncomputer:\r\nTest-Path -Path $PROFILE.AllUsersAllHosts\r\nHow to create a profile\r\nTo create a PowerShell profile, use the following command format:\r\nif (!(Test-Path -Path \u003cprofile-name\u003e)) {\r\n New-Item -ItemType File -Path \u003cprofile-name\u003e -Force\r\n}\r\nFor example, to create a profile for the current user in the current PowerShell host application, use the following\r\ncommand:\r\nif (!(Test-Path -Path $PROFILE)) {\r\n New-Item -ItemType File -Path $PROFILE -Force\r\n}\r\nIn this command, the if statement prevents you from overwriting an existing profile. Replace the value of the\r\n$PROFILE variable with the path to the profile file that you want to create.\r\nNote\r\nTo create \"All Users\" profiles in Windows Vista and later versions of Windows, start PowerShell with the Run as\r\nadministrator option.\r\nHow to edit a profile\r\nYou can open any PowerShell profile in a text editor, such as Notepad.\r\nTo open the profile of the current user in the current PowerShell host application in Notepad, type:\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 3 of 6\n\nnotepad $PROFILE\r\nTo open other profiles, specify the profile name. For example, to open the profile for all the users of all the host\r\napplications, type:\r\nnotepad $PROFILE.AllUsersAllHosts\r\nTo apply the changes, save the profile file, and then restart PowerShell.\r\nHow to choose a profile\r\nIf you use multiple host applications, put the items that you use in all the host applications into your\r\n$PROFILE.CurrentUserAllHosts profile. Put items that are specific to a host application, such as a command that\r\nsets the background color for a host application, in a profile that's specific to that host application.\r\nIf you are an administrator who is customizing PowerShell for many users, follow these guidelines:\r\nStore the common items in the $PROFILE.AllUsersAllHosts profile\r\nStore items that are specific to a host application in $PROFILE.AllUsersCurrentHost profiles that are\r\nspecific to the host application\r\nStore items for particular users in the user-specific profiles\r\nBe sure to check the host application documentation for any special implementation of PowerShell profiles.\r\nHow to use a profile\r\nMany of the items that you create in PowerShell and most commands that you run affect only the current session.\r\nWhen you end the session, the items are deleted.\r\nThe session-specific commands and items include PowerShell variables, environment variables, aliases, functions,\r\ncommands, and PowerShell modules that you add to the session.\r\nTo save these items and make them available in all future sessions, add them to a PowerShell profile.\r\nAnother common use for profiles is to save frequently used functions, aliases, and variables. When you save the\r\nitems in a profile, you can use them in any applicable session without recreating them.\r\nHow to start a profile\r\nWhen you open the profile file, it's blank. However, you can fill it with the variables, aliases, and commands that\r\nyou use frequently.\r\nHere are a few suggestions to get you started.\r\nAdd a function that lists aliases for any cmdlet\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 4 of 6\n\nfunction Get-CmdletAlias ($cmdletName) {\r\n Get-Alias |\r\n Where-Object -FilterScript {$_.Definition -like \"$cmdletName\"} |\r\n Format-Table -Property Definition, Name -AutoSize\r\n}\r\nCustomize your console\r\nfunction CustomizeConsole {\r\n $hostTime = (Get-ChildItem -Path $PSHOME\\pwsh.exe).CreationTime\r\n $hostVersion=\"$($Host.Version.Major)`.$($Host.Version.Minor)\"\r\n $Host.UI.RawUI.WindowTitle = \"PowerShell $hostVersion ($hostTime)\"\r\n Clear-Host\r\n}\r\nCustomizeConsole\r\nAdd a customized PowerShell prompt\r\nfunction prompt {\r\n $Env:COMPUTERNAME + \"\\\" + (Get-Location) + \"\u003e \"\r\n}\r\nFor more information about the PowerShell prompt, see about_Prompts.\r\nFor other profile examples, see Customizing your shell environment.\r\nThe NoProfile parameter\r\nTo start PowerShell without profiles, use the NoProfile parameter of pwsh.exe , the program that starts\r\nPowerShell.\r\nTo begin, open a program that can start PowerShell, such as Cmd.exe or PowerShell itself. You can also use the\r\nRun dialog box in Windows.\r\nType:\r\npwsh -NoProfile\r\nFor a complete list of the parameters of pwsh.exe , type:\r\npwsh -?\r\nProfiles and execution policy\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 5 of 6\n\nThe PowerShell execution policy determines, in part, whether you can run scripts and load configuration files,\r\nincluding the profiles. The Restricted execution policy is the default. It prevents all scripts from running,\r\nincluding the profiles. If you use the \"Restricted\" policy, the profile doesn't run, and its contents aren't applied.\r\nA Set-ExecutionPolicy command sets and changes your execution policy. it's one of the few commands that\r\napplies in all PowerShell sessions because the value is saved in the registry. You don't have to set it when you\r\nopen the console, and you don't have to store a Set-ExecutionPolicy command in your profile.\r\nProfiles and remote sessions\r\nPowerShell profiles aren't run automatically in remote sessions, so the commands that the profiles add aren't\r\npresent in the remote session. In addition, the $PROFILE automatic variable isn't populated in remote sessions.\r\nTo run a profile in a session, use the Invoke-Command cmdlet.\r\nFor example, the following command runs the \"Current user, Current Host\" profile from the local computer in the\r\nsession in $s .\r\nInvoke-Command -Session $s -FilePath $PROFILE\r\nThe following command runs the \"Current user, Current Host\" profile from the remote computer in the session in\r\n$s . Because the $PROFILE variable isn't populated, the command uses the explicit path to the profile. We use\r\ndot sourcing operator so that the profile executes in the current scope on the remote computer and not in its own\r\nscope.\r\nInvoke-Command -Session $s -ScriptBlock {\r\n . \"$HOME\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1\"\r\n}\r\nAfter running this command, the commands that the profile adds to the session are available in $s .\r\nSee also\r\nabout_Automatic_Variables\r\nabout_Execution_Policies\r\nabout_Functions\r\nabout_Prompts\r\nabout_Remote\r\nabout_Scopes\r\nabout_Signing\r\nSet-ExecutionPolicy\r\nSource: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nhttps://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles\r\nPage 6 of 6",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles"
	],
	"report_names": [
		"about_profiles"
	],
	"threat_actors": [],
	"ts_created_at": 1775434475,
	"ts_updated_at": 1775826773,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/90b00ad579c6a86e8a78b5c41d37ad4189c609ce.pdf",
		"text": "https://archive.orkl.eu/90b00ad579c6a86e8a78b5c41d37ad4189c609ce.txt",
		"img": "https://archive.orkl.eu/90b00ad579c6a86e8a78b5c41d37ad4189c609ce.jpg"
	}
}