none
profile.ps1 in use RRS feed

  • Question

  • Hi,

    I'm working with a normal account on my machine, but also an admin account to access network shares etc.
    Now I'm trying to edit my profile which is in C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 but when I try to save, it says it is in use/access denied. When I launc an unlock tool like IObit Unlocker it says it is not in use.

    I'm local admin on my computer. No clue what is going on.

    Please advise.
    J.


    Jan Hoedt

    Wednesday, March 9, 2016 1:58 PM

Answers

  • notepad $profile will always get you to the correct profile.  It will prompt if you haven't created it. Only use the system profiles if you are installing global items.

    \_(ツ)_/

    • Marked as answer by janhoedt Thursday, March 10, 2016 2:49 PM
    Wednesday, March 9, 2016 2:29 PM

All replies

  • Profiles should be in user directories, not a system directory.

    I do the same thing on my machine, my admin account has a slightly different profile from my standard account.


    Wednesday, March 9, 2016 2:03 PM
  • To edit your profile:

    notepad $profile

    Don't edit the system profile as you are trying to do.


    \_(ツ)_/

    Wednesday, March 9, 2016 2:09 PM
  • Ok, thanks but I don't understand why my profile settings are there in the first place.

    So it is the AllUsersCurrentHost Profile, one shouldn't edit it?

    <#
    $profile.AllUsersAllHosts:
    %windir%\system32\Windows­PowerShell\v1.0\profile.ps1 This is for all users of the computer and for all shells.
    #
    $profile.AllUsersCurrentHost:
    %windir%\system32\Windows­PowerShell\v1.0\Microsoft.Power­Shell_profile.ps1 This is for all users of the computer, but it is only for the Microsoft.PowerShell shell.
    #
    $profile.CurrentUserAllHosts:
    %UserProfile%\Documents\Windows­PowerShell\profile.ps1 This is for the current user only and all shells.
    #
    $profile.CurrentUserCurrentHost:
    %UserProfile%\Documents\WindowsPowerShell\Micro­soft.PowerShell_profile.ps1 This is for the current user only and only for the Microsoft.PowerShell shell.
    #>


    Jan Hoedt

    Wednesday, March 9, 2016 2:26 PM
  • notepad $profile will always get you to the correct profile.  It will prompt if you haven't created it. Only use the system profiles if you are installing global items.

    \_(ツ)_/

    • Marked as answer by janhoedt Thursday, March 10, 2016 2:49 PM
    Wednesday, March 9, 2016 2:29 PM