Question related to -NoProfile parameter

Welcome Forums General PowerShell Q&A Question related to -NoProfile parameter

Viewing 4 reply threads
  • Author
    Posts
    • #210216
      Participant
      Topics: 3
      Replies: 4
      Points: 23
      Rank: Member

      Hello ,

      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.

      Tom

    • #210222
      Participant
      Topics: 4
      Replies: 2247
      Points: 5,484
      Helping Hand
      Rank: 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

      powershell /?

      to get the help.

    • #210237
      Participant
      Topics: 6
      Replies: 93
      Points: 427
      Helping Hand
      Rank: Contributor
    • #210270
      Participant
      Topics: 0
      Replies: 3
      Points: -4
      Rank: 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.

    • #210558
      Participant
      Topics: 3
      Replies: 4
      Points: 23
      Rank: Member

      Thank you much All for the helps on NoProfile and what I need to look for the explanation on it.

       

Viewing 4 reply threads
  • You must be logged in to reply to this topic.