SOLVED

Not sure where my profile file is

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
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).

@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.