- This topic has 4 replies, 4 voices, and was last updated 2 months, 2 weeks ago by
March 13, 2020 at 8:06 pm #210216ParticipantTopics: 3Replies: 4Points: 23Rank: Member
I am learning power shell and I have a quick question relating to the -NoProfile parameter. I tried to google for the term but I have not successfully found an answer yet. Could you please explain of what does it mean if you know the answer.
I have an example such as
powershell -noprofile -windowstyle hidden -file “C:\Users\umktdm\Desktop\PowerShell Script\test.ps1”
That I execute from my command line , and I ‘d like to know what -noprofile does to my example.
Thank you so much in advance for the help.
March 13, 2020 at 8:27 pm #210222ParticipantTopics: 4Replies: 2247Points: 5,484Rank: Community MVP
That means that no Powershell profile will be loaded if there is one. If you don’t have one it does not make any difference. Run
to get the help.
March 13, 2020 at 10:59 pm #210237ParticipantTopics: 6Replies: 93Points: 427Rank: Contributor
And to add to that, this might help …
March 14, 2020 at 10:53 am #210270ParticipantTopics: 0Replies: 3Points: -4Rank: Member
<p style=”text-align: center;”>Let you explain more broadly.</p>
A profile is a file which contains code which runs every time when powershell is loaded. A profile is not created by default. You can just create it using this:
New-Item $profile -Type file
Now you can open your $profile and add code to it.
When you add NoProfile parameter, powershell will not load the profile. Look at powershell /? As Olaf pointed.
March 16, 2020 at 1:14 pm #210558ParticipantTopics: 3Replies: 4Points: 23Rank: Member
Thank you much All for the helps on NoProfile and what I need to look for the explanation on it.
- You must be logged in to reply to this topic.