Use this topic when aliases/functions/modules/settings appear only in interactive shells, scripts behave differently with -NoProfile, startup is slow/failing, or automation accidentally depends on personal profile state.
Profiles
A PowerShell profile is a script that can run when a supported PowerShell host starts. Multiple profile paths can exist for current user/all users and current host/all hosts, and Windows PowerShell and PowerShell 7 can use different profile locations/contexts.
1. $PROFILE | fl * -Force — profile paths.
2. Exists? Test-Path $PROFILE.
3. Slow start → time it: pwsh -NoProfile vs normal.
4. Errors at startup → open the profile file.
5. Remote sessions do not load profiles.
PowerShell starts → loads AllUsers and CurrentUser profiles → aliases/functions available
Isolate the changed command/module/variable and retest in a clean explicit environment.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Do not copy a personal profile wholesale to servers. Do not store credentials/secrets directly in profile text. Avoid defining aliases that shadow critical command names in managed environments without clear documentation.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Reproduce an issue using -NoProfile. If behavior changes, inspect profile paths and bisect the profile content/modules. Compare command resolution and relevant variables before/after profile load. Move necessary operational initialization into version-controlled code.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Profiles customize sessions; they should not be hidden production dependencies.
$PROFILEexposes the current host/current user path and additional profile-path properties.- Different hosts/PowerShell products may load different profile files.
- Unattended/scheduled/remoting contexts may not load the same profile behavior as an interactive console.
-NoProfileis a strong differential test for profile-caused behavior.
$PSVersionTable— PowerShell edition and versionGet-Command <name>— which cmdlet/function/exe runsGet-Help <cmdlet> -Full— syntax and parametersGet-ExecutionPolicy -List— execution policy per scope
ReferenceWhat it is1 section · depth on demand
Core model
Profiles are ordinary PowerShell scripts loaded during session startup according to host/user scope. They can define functions, aliases, prompt customizations, environment changes and module imports. This convenience can create reproducibility problems when a production script silently depends on them.
ReferenceImportant terms & boundaries2 sections · depth on demand
PowerShell boundary
Windows PowerShell and PowerShell 7 are separate products, so profile locations and loaded modules can differ even for the same user. Automation should explicitly import required modules and set required options rather than assuming the operator profile prepared the session.
In depth
Profiles are scripts run at PowerShell start:
| Variable | Scope |
|---|---|
$PROFILE.CurrentUserCurrentHost | This user, this host (default $PROFILE) |
$PROFILE.CurrentUserAllHosts | This user, all hosts |
$PROFILE.AllUsersAllHosts | Everyone |
Test-Path $PROFILE; notepad $PROFILE
$PROFILE | Get-Member -Type NoteProperty | % { $PROFILE.($_.Name) }
pwsh -NoProfile -File script.ps1 # skip profiles in automation
Keep profiles light (slow startup) and never rely on them in scheduled scripts.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in PowerShell → Profiles. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
PowerShell → Profiles reference map
Fast lookup boundaries for PowerShell → Profiles.
| Item | Meaning | Evidence boundary |
|---|---|---|
| CurrentUserCurrentHost | Most specific common profile | host/product-specific path |
| CurrentUserAllHosts | User-wide customization | still user-context dependent |
| AllUsers profiles | Machine-level startup customization | requires managed change control |
| -NoProfile | Differential startup test | does not remove other session/environment differences |
| Explicit module/script | Reproducible dependency | preferred over hidden profile dependency |