Changing the Lync Server Management Shell’s Default Folder

 

When you first start the Lync Server Management Shell, your working folder is set, by default, to your user folder, something like C:\Users\kenmyer. (To find out what your user folder is, type $homepath at the Lync Server Management Shell prompt and press ENTER.) Is there a problem with using your user folder as your default folder? Folder-wise, no; after all, one default folder is as good as any other. But if you do want to change the default folder, all you have to do is make one minor change to your Windows PowerShell profile.

 

We won’t discuss profiles in detail in this little article; for more information, see this article on that very topic. Suffice to say that profiles function like .INI files for Windows PowerShell: you can put configuration information (or other information) in there and PowerShell will use that information each time it starts. Would you prefer to have the Management Shell start in the C:\ folder? Then do this:

 

  1. At the PowerShell prompt, type $profile to retrieve the path to your profile; this will be something like C:\Users\ken­myer\Documents\WindowsPowerShell\Microsoft.Pow­erShell_profile.ps1. Note that the path referenced above might not exist; you can verify that by using this command: Test-Path “PowerShell_profile.ps1”. If the file doesn’t exist, use Notepad to create it. (You might have to cre­ate a folder or two along the way as well.)

  2. After you know your profile exists, type this at the PowerShell prompt and then press ENTER:

    notepad $profile

  3. When the file loads, type the following command on a line of its own and then save the file:

    cd C:\

  4. Now, restart the Lync Server Management Shell and take a peek at your prompt. If all goes well (and everything always goes well with PowerShell) you should see a nice little change.