[MSH] Profile.msh name and reloading

Discussion in 'Scripting' started by Keith Hill, Nov 9, 2005.

  1. Keith Hill

    Keith Hill Guest

    Is there a way to reload your profile without have to restart MSH? I tried
    dot executing it but I got errors. I having been customizing my profile a
    lot lately and having to restart the shell is getting old.

    Also, what's up with this name:
    Microsoft.Management.Automation.msh_profile.msh? It is a bit much don't you
    think? What's wrong with just a simple, short name like uh, say
    "profile.msh"?
     
    Keith Hill, Nov 9, 2005
    #1
    1. Advertisements

  2. We expect that there will be more than just one shell based on monad - we
    wanted a way to have specific shells find specific profiles - so profile.msh
    will get picked up by all shells but
    microsoft.management.automation.msh_profile.msh will only get sourced by the
    shell with $shellid -eq microsoft.management.automation.msh.

    we know it's a handfull to type, so just use $profile ^_^

    jim
     
    James Truher [MSFT], Nov 9, 2005
    #2
    1. Advertisements

  3. Keith Hill

    Keith Hill Guest

    That helps explain about the funky naming scheme but I don't see anything
    about the issue of reloading your profile within the same shell.

    Thanks,
    Keith
     
    Keith Hill, Nov 9, 2005
    #3
  4. What errors are you getting? Does your profile creates some constant or
    readonly variables, aliases, or functions?
     
    Jeff Jones [MSFT], Nov 10, 2005
    #4
  5. Keith Hill

    Keith Hill Guest

    I do this:

    remove-item alias:dir

    because I define my own dir function. It seems that it doesn't like to do
    this again. So I changed it to:

    remove-item alias:dir -ea SilentlyContinue

    and it doesn't error. Although I notice the changes are additive only. If
    I remove something from my profile that isn't reflected after I dot source
    it - not that I would expect that to happen knowing how dot sourcing works.
    It just makes me wonder if there is a "dump and reload" profile mechanism.
    Just curious as dot sourcing gets me most of what I want.
     
    Keith Hill, Nov 10, 2005
    #5
  6. Jon Newman [MSFT], Nov 15, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.