SOLVED

Not sure where my profile file is

%3CLINGO-SUB%20id%3D%22lingo-sub-1624197%22%20slang%3D%22en-US%22%3ENot%20sure%20where%20my%20profile%20file%20is%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624197%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20in%20PowerShell%207.0.3.%20I've%20issued%20a%20%24Profile%20command%20at%20the%20PowerShell%20prompt%2C%20to%20see%20where%20my%20profile%20file%20is.%20It%20tells%20me%20that%20it%20is%26nbsp%3BDocuments%5CPowerShell%5CMicrosoft.PowerShell_profile.ps1%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I%20cd%20my%20way%20to%20the%20Documents%5CPowerShell%20folder%20and%20looked%20for%26nbsp%3BMicrosoft.PowerShell_profile.ps1.%20It%20isn't%20there.%20In%20fact%2C%20there's%20no%20.ps1%20file%20there.%20I%20even%20tried%20Windows%2010%20File%20Explorer%2C%20it's%20still%20not%20there.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20understand%20how%20PowerShell%20can%20think%20there's%20a%20profile%20file%2C%20but%20there%20isn't%20one.%20What's%20going%20on%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1624197%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1624543%22%20slang%3D%22en-US%22%3ERe%3A%20Not%20sure%20where%20my%20profile%20file%20is%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624543%22%20slang%3D%22en-US%22%3E%3CP%3E%24profile%20is%20just%20a%20variable%20pointing%20to%20the%20default%20location%20of%20the%20file.%20The%20file%20itself%20might%20or%20might%20not%20exist%2C%20in%20the%20latter%20scenario%20you%20need%20to%20create%20it%20(notepad).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1625111%22%20slang%3D%22en-US%22%3ERe%3A%20Not%20sure%20where%20my%20profile%20file%20is%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1625111%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3Boh%2C%20so%20if%20it%20did%20exist%2C%20that's%20where%20it%20should%20exist%20and%20it%20should%20be%20named.%20OK%2C%20a%20bit%20strange%2C%20but%20thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

I'm in PowerShell 7.0.3. I've issued a $Profile command at the PowerShell prompt, to see where my profile file is. It tells me that it is Documents\PowerShell\Microsoft.PowerShell_profile.ps1

 

So, I cd my way to the Documents\PowerShell folder and looked for Microsoft.PowerShell_profile.ps1. It isn't there. In fact, there's no .ps1 file there. I even tried Windows 10 File Explorer, it's still not there.

 

I don't understand how PowerShell can think there's a profile file, but there isn't one. What's going on?

2 Replies
Highlighted
Best Response confirmed by Rod Falanga (Frequent Contributor)
Solution

$profile is just a variable pointing to the default location of the file. The file itself might or might not exist, in the latter scenario you need to create it (notepad).

Highlighted

@Vasil Michev oh, so if it did exist, that's where it should exist and it should be named. OK, a bit strange, but thank you.