June 13, 2009

Understanding Powershell Profiles


Powershell uses profiles to configure the user experience. There are two main profiles that are typically configured, the machine profile and the user's personal profile.

MSDN has a nice description of the different profiles found in Powershell. You can pre-define variables, drive mappings, custom functions, etc. Shared routines can be loaded into the machine profile to provide access to ANY Powershell user on the system.

The machine profile is found at
%windir%\system32\WindowsPowerShell\v1.0\profile.ps1
and is used to configure the Powershell session for ALL users on the system. I generally use the machine profile to define custom functions that should be available to anyone who logs onto the box and will use Powershell. Examples could include writing a custom function and add it to the machine profile on a domain controller that would open a csv file or make a database connection, read its data, and create a new AD user, configure a home directory on a file share for that user, and add them to the appropriate security groups.

Another example would be writing a function that lives in the machine profile of an Exchange server, available to ALL admins who log onto the machine. I have a custom script that I've turned into a Powershell function for planned failover of our clustered mailbox servers. The script (function) takes input from the admin, verifies that the target node is not already the active node, displays the status of the cluster copy queue, then warns the admin that this procedure will failover the production mailbox cluster. No browsing folders searching for the location of the failover script... when it's defined as a function, it's available from any location.

The user personal profile is found at
%UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
and is used to configure the user's personal settings. Screen color preferences, personal drive mappings (psdrives) , and functions that should not be made public on that system. Security Credential Objects that will be used within the Powershell session can also be defined here.

You can edit this profile with any standard text editor such as Notepad, but there are many IDE applications available to make script editing easier. Powershell 2.0 includes a builtin IDE.



Notes for this post
Get a quick reference here.

.end

47 comments:

  1. Your way of telling the whole thing in this paragraph is really good, all can easily be aware of it, Thanks a lot.


    My blog post ... duritajam.web.id/lainya/..

    ReplyDelete
  2. Can I simply just say what a relief to discover someone who really knows
    what they are talking about on the web. You definitely know how to
    bring a problem to light and make it important.
    More and more people have to read this and understand this side of the story.
    It's surprising you're not more popular given that you most certainly possess the gift.


    Here is my weblog :: How to Make Steroids

    ReplyDelete
  3. These are genuinely wonderful ideas in concerning blogging.
    You have touched some nice things here. Any way keep up wrinting.


    My site; Author's external home page...

    ReplyDelete
  4. I don't drop a ton of remarks, but after reading a few of the responses on "Understanding Powershell Profiles". I actually do have 2 questions for you if it's okay.
    Could it be just me or does it look like like a few of the comments come across as if they are left by brain dead visitors?
    :-P And, if you are writing at additional sites, I'd like to keep up with everything fresh you have to post. Would you post a list of the complete urls of your social networking pages like your twitter feed, Facebook page or linkedin profile?

    My weblog ... how to buy steroids

    ReplyDelete
  5. I am sure this piece of writing has touched all the internet users,
    its really really pleasant post on building up new weblog.


    Look at my website; simply click the up coming document

    ReplyDelete
  6. I've learn several good stuff here. Certainly value bookmarking for revisiting. I wonder how much effort you set to make this kind of great informative web site.

    Feel free to visit my web page: Buy Steroid Powder

    ReplyDelete
  7. whoah this blog is wonderful i really like studying
    your posts. Keep up the good work! You realize, many people are looking round for this information,
    you could aid them greatly.

    Here is my web page - Author's external home page...

    ReplyDelete
  8. Does your site have a contact page? I'm having trouble locating it but, I'd like to shoot you an email.

    I've got some recommendations for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it improve over time.

    My website: click through the next web page - -

    ReplyDelete
  9. What i don't realize is in fact how you're now not actually much more neatly-liked than you may be now.
    You're so intelligent. You understand therefore significantly with regards to this subject, made me personally consider it from a lot of varied angles. Its like men and women don't seem to be involved unless it is one thing
    to accomplish with Lady gaga! Your own stuffs outstanding. At
    all times deal with it up!

    My site ... buy hgh

    ReplyDelete
  10. Hi there, this weekend is good for me, for the reason that this occasion i am reading this enormous educational
    piece of writing here at my house.

    my website ... Read the Full Document :: ::

    ReplyDelete
  11. I just like the helpful info you provide to your articles.
    I will bookmark your blog and take a look at again here regularly.
    I am moderately sure I will learn plenty of new
    stuff right right here! Good luck for the next!


    Feel free to visit my website :: More Support

    ReplyDelete
  12. Wow that was unusual. I just wrote an extremely long comment but after I clicked submit my
    comment didn't appear. Grrrr... well I'm not writing all that over again.
    Regardless, just wanted to say superb blog!

    Also visit my website http://cannatv.org/users/TyroneGat - -

    ReplyDelete
  13. I like the valuable information you provide in your articles.
    I will bookmark your blog and check again here regularly.
    I am quite certain I will learn plenty of new stuff right here!
    Best of luck for the next!

    my web page - mouse click for source

    ReplyDelete
  14. hi!,I really like your writing so so much! percentage we communicate more about
    your article on AOL? I require a specialist in this area to unravel my problem.

    Maybe that's you! Having a look ahead to look you.

    Here is my page - http://www.libreseneltiempo.org/diego/wiki/index.php?title=Usuario:ShannaBlu ()

    ReplyDelete
  15. Hello there! This blog post could not be written any better!
    Going through this post reminds me of my previous roommate!
    He always kept talking about this. I most certainly will send this post to
    him. Pretty sure he's going to have a great read. Thank you for sharing!

    my blog: Author's external
    home page...

    ReplyDelete
  16. Ridiculous story there. What occurred after? Thanks!

    My web site ... simply click the up coming internet page ::
    :
    :

    ReplyDelete
  17. You can have the old one set just like new when working with
    this retailer. Imagine typing the complete time, and walking
    around your working environment, in my situation the class.


    Also visit my web-site :: cydia ios 7; ,

    ReplyDelete
  18. Hello! I've been following your site for some time now
    and finally got the bravery to go ahead and give you a shout out from Dallas Texas!
    Just wanted to say keep up the good work!


    my homepage :: GHD Straightener

    ReplyDelete
  19. Then I began signing before work on during work and after that and after
    that in the middle of the night time. Therefore be mindful using striped candy within this amount.
    You need to guard the base at all costs!

    my page - hay day cheats

    ReplyDelete
  20. Excellent ρost! Ԝe will be linking to thnis great content
    oon our website. Ҝeeep uρ the grеat writing.


    Feel freе to sսrf to my blog bounce house water slide

    ReplyDelete
  21. Do you know that feeling when you're at
    one with life; when you're just content and happy.
    We played a game of Petonque (or as we would call it, bocci ball.
    Privacy structures generally need to provide seclusion from 1 or
    both sides of a home.

    Also visit my blog post :: здоровое питание рецепты блюд

    ReplyDelete
  22. Previously, he headlined many pay per view championship cards and graced the covers of several magazines.
    ufc 174 In 2006,
    the UFC started a new reality show on Spike TV called The
    Ultimate Fighter that was a huge success.
    Yes, such clothing has proven to be so popular that it maintains a mainstream appeal outside of traditional training circles.

    ReplyDelete
  23. Howdy just wanted to give you a brief heads up andd let you know a few of the images aren't loading correctly.
    I'm not sure why but I think its a linkinbg issue. I've
    tried it in two different web breowsers and both show the same outcome.



    Here is my web-site: iphone 5 icloud activation

    ReplyDelete
  24. I don't even know how I ended up here, but I thought
    this post was great. I don't know who you are but definitely you're
    going to a famous blogger if you aren't already ;)
    Cheers!

    Also visit my web blog: DARK SOULS II TELECHARGER

    ReplyDelete
  25. Pretty nice post. I just stumbled upon yur weblog and wished to say that I've truly enjoyed bfowsing your blog posts.
    After alll I'll be subxcribing tto your rss
    feed and I hpe you write aagain soon!

    Also visit my page - Lies of Astaroth Hack cheat

    ReplyDelete
  26. The allure of role-playing games is embarking on a mysterious adventure, weaving through labyrinthine environments, conquering armies of fearsome
    creatures and returning with spectacular items, which help symbolize the quest.
    That doesn't mean that I didn't have to shift
    through a bunch of awesome to find them though.
    Just imagine a toxic monkey-wrench being
    thrown into the delicate machinery that is your endocrine system.


    Have a look at my web blog buy wow gold ()

    ReplyDelete
  27. You made some good points there. I looked on thhe web for more
    info about the issue annd found most people will go along with
    your views on this web site.

    my blog post minomonsters cheats ifile

    ReplyDelete
  28. Only if all the conditions mentioned above are met, the entrepreneur is sure to witness a dramatic and immense development in the website's online
    traffic. - It will increase the web traffic coming to your website.
    MSN Careers states that 'SEOs typically supplement their knowledge of how various search engines operate and determine page rankings with strong marketing skills, as well as the ability to communicate effectively and program using HTML.


    Also visit my site high pr backlinks

    ReplyDelete
  29. Magnificent beat ! I would like to apprentice even as you amend your web
    site, how can i subscribe for a weblog website?
    The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided brilliant transparent concept

    Feel free to surf to my blog post :: nike designer airmax

    ReplyDelete
  30. Everything is very open with a clear explanation of the issues.
    It was truly informative. Your site is very helpful. Thanks for sharing!



    Feel free to surf to my webpage - affordable dental near austin tx

    ReplyDelete
  31. Hi, after reading this remarkable article i am as well happy to share my
    know-how here with mates.

    Here is my weblog :: castle clash cheats

    ReplyDelete
  32. I've been browsing online more than three hours today, yet I never found any interesting
    article like yours. It is pretty worth enough for me.
    In my opinion, if all webmasters and bloggers made good content as you did, the net will
    be a lot more useful than ever before.

    my web-site Ropa Interior Hombre

    ReplyDelete
  33. Ideal anti spam software is the one that allows you to customize it according
    to your needs and that ensures that you avoid email spam.
    Perhaps the greatest challenge is that people wish for instant spirituality and flock to these rooms.
    On the other hand, when you convey a message to someone through email or online chat then you are not able to see the facial expressions as
    well as the body language of the speaker.


    Also visit my web page; chaturbate wm recorder - ,

    ReplyDelete
  34. You're so interesting! I ddo not believe I've truly read through anything like this before.
    So wonderful to discover another person with genuine thoughts on this issue.

    Seriously.. thank you for starting this up. This website is one thing that's needed
    on the web, someone with some originality!



    Here is my site ... bubble witch saga 2 hack android

    ReplyDelete
  35. Microsoft also produced the Microsoft Area with Windows RT.
    A pc has changed into a need inside our everyday lives.
    It's the hottest social-networking website on the
    planet.

    Also visit my web blog; wechat for pc (http://goodfootballgames.com/profile/ke38m)

    ReplyDelete
  36. They must tell the tow company why the car is being towed.
    Criminal and tax evading funds are idle and non-productive.

    California Follows Texas's Lead but with More Money -Oct 1, 1994
    -The San Diego border patrol puts Operation Gatekeeper into play amid much fanfare.


    Also visit my page: Towing and Repossession Software

    ReplyDelete
  37. Wonderful blog! I found it while browsing on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo
    News? I've been trying for a while but I never seem
    to get there! Appreciate it

    My web site :: Digital Camera Advice, Www.Digitalcameratips.Co.Uk,

    ReplyDelete
  38. within ambiance at the statistics 'tween your "gilt" and the policies and
    the figure of the wealth that you can use this performing of commercial enterprise a fabric merchant that potency customers to
    bed a new supply, your topical homeschooling religious text.
    You may be something that volition Louis Vuitton Outlet Online (http://arcadenights.com/profile/edswanson) Oakley
    Sunglasses - red2.co,
    Chanel Outlet Online Michael
    Kors Shoes For Sale (http://m.hd-wallz.com/profile/gagoebel)
    Nike Free Toms Outlet (hry-online.org)
    Louis Vuitton Outlet Louis Vuitton Handbags Outlet Louis Vuitton Outlet
    - - Michael Kors Outlet Online
    Michael Kors Watches Online - game4ever.info - Louis Vuitton Outlet Online (allplaygame.com)
    Lululemon Outlet, http://go.lptipm.org/marcjacobshandbags402120, michael Kors outlet Giuseppe Zanotti Sneakers On Sale Michael Kors Watches Online Louis Vuitton Handbags Michael Kors Watches Online CHI Flat Iron Website
    Mac Cosmetics and can go in you feedback.
    You may not be aware of the greater reimbursement of reanimate.
    The physics who overcharged your friends or relatives for recommendations.
    They can easily pitch beast. By written communication this artefact, you are violating your ISP's policies by
    causing individual emails. fix your subscribers did

    Feel free to visit my web blog :: Hermes Outlet Online

    ReplyDelete
  39. It's very effortless to find out any matter on net as compared to books, as I found this post at this web site.


    Here is my homepage - natural green cleanse reviews

    ReplyDelete
  40. Hello! I've been reading your website for a long time now
    and finally got the bravery to go ahead and give you a shout out from New Caney Tx!
    Just wanted to tell you keep up the good job!

    my blog :: best gaming mouse 2014

    ReplyDelete
  41. I really love your website.. Very nice colors & theme. Did you make
    this website yourself? Please reply back as I'm trying to
    create my very own site and would like to find
    out where you got this from or exactly what the theme is called.
    Thank you!

    Here is my web blog :: frank kern kevin nations - http://emilytylers.com/That_You_Should_Be_successful_You_Need_To_Initial_Educate_Yourself_On_The_Internet_Marketing_On_this_page,

    ReplyDelete
  42. Asking questions are really pleasant thing if you are
    not understanding something entirely, but this paragraph gives pleasant understanding yet.


    my homepage - doha escort

    ReplyDelete
  43. .Coach Outlet Online Sale his name chang.Air Jordan 1 e, CBS Sports now stand.ray ban sunglasses rb3025 s for much m.glitch soccer cleats ore than its broad.cheap soccer jerseys casts of m.adidas ace 16 kids ajor sporting events.ray ban sunglasses red . We now.soccer jerseys long sleeve have a direct branding association with interactive coverage across the entire world of sports for our fans.”
    When Megan Whilden was appointed Pittsfield’s first director of cultural development in 2005

    ReplyDelete
  44. ite soccer get That's the way he
    , Mo. (AP) - Missouri Tigers basketball coach Mike Anderson told state lawmakers he believes helping student athletes be successful beyond athletics is part of his job.Anderson spoke in the House and Senate after lawmakers started their daily session Thursday. He also signed autographs on posters and T-shirts in a Capitol committee room.Anderson says teamwork and humility are important parts of his coaching strategy. He says helping players be successful off the court is just as important as racking up wins i.Aliexpressite games.The fifth-year Missouri coach says his team will make the state and the University of Missouri-Columbia proud.Copyright 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed. Let's go back to that trip to the principal's office. "The principal tells me, 'Lester, I already see your future and I can see you're going to be one of those guys who is going to be in and out of jail,.ite soccer '" Strode said, recalling the story. "Instead of maybe saying, 'Lester, let's talk and let me give you some insight on how this could affect your life.' It really didn't set in my mind, but the more I think about it today, it was a bad thing to say." What saved Strode from the life that principal predicted were his parents and his high-school coach, Leo Davis. "There was ignorance in the city, but my parents instilled in us that everybody doesn't agree .ite soccer store and everybody doesn't see everybody the same way," Strode said. "As long as they don't put their hands on you, you've got to ignore some of the stuff you hear. You're going to make yourself, not what somebody says about you, or what they say you can't do. "It's shown that if you want to be successful in life, it's up to you to take advantage of whatever opportunities you get." That's the way he was raised. And that's the message he tries to pass on to others. "We've come a long way in this country as black people," he said, "and we've had some great mentors and had a lot of people who have done a lot of great thing
    ite soccer store

    ReplyDelete
  45. ite soccer basketball coach Mike

    , Mo. (AP) - Missouri Tigers basketball coach Mike Anderson told state lawmakers he believes helping student athletes be successful beyond athletics is part of his job.Anderson spoke in the House and Senate after lawmakers started their daily session Thursday. He also signed autographs on posters and T-shirts in a Capitol committee room.Anderson says teamwork and humility are important parts of his coaching strategy. He says helping players be successful off the court is just as important as racking up wins i.Aliexpressite games.The fifth-year Missouri coach says his team will make the state and the University of Missouri-Columbia proud.Copyright 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.
    Let's go back to that trip to the principal's office. "The principal tells me, 'Lester, I already see your future and I can see you're going to be one of those guys who is going to be in and out of jail,.ite soccer '" Strode said, recalling the story. "Instead of maybe saying, 'Lester, let's talk and let me give you some insight on how this could affect your life.' It really didn't set in my mind, but the more I think about it today, it was a bad thing to say." What saved Strode from the life that principal predicted were his parents and his high-school coach, Leo Davis. "There was ignorance in the city, but my parents instilled in us that everybody doesn't agree .ite soccer store and everybody doesn't see everybody the same way," Strode said. "As long as they don't put their hands on you, you've got to ignore some of the stuff you hear. You're going to make yourself, not what somebody says about you, or what they say you can't do. "It's shown that if you want to be successful in life, it's up to you to take advantage of whatever opportunities you get." That's the way he was raised. And that's the message he tries to pass on to others. "We've come a long way in this country as black people," he said, "and we've had some great mentors and had a lot of people who have done a lot of great thing



    ite soccer store


    ReplyDelete