Keith's profileKeith Hill's BlogPhotosBlogListsMore Tools Help
    October 29

    PowerShell 2.0 – Accessing Different Profiles

    Just ran across a new feature of PowerShell 2.0 that is convenient.  Need the path to the various profile scripts on a system?  Try this:

    PS> $profile.psextended | Format-List

    AllUsersAllHosts       : C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
    AllUsersCurrentHost    : C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
    CurrentUserAllHosts    : C:\Users\Keith\Documents\WindowsPowerShell\profile.ps1
    CurrentUserCurrentHost : C:\Users\Keith\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

    To access individually you can use $profile.AllUsersAllHosts.

    psmdtag:variable Profile

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    Keith Hill has turned off comments on this page.

    Trackbacks

    Weblogs that reference this entry
    • None