When you first start the Lync Server Management Shell, your working folder is set, by default, to your user folder, something like C:Userskenmyer. (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:
- At the PowerShell prompt, type $profile to retrieve the path to your profile; this will be something like C:UserskenmyerDocumentsWindowsPowerShellMicrosoft.PowerShell_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 create a folder or two along the way as well.)
- After you know your profile exists, type this at the PowerShell prompt and then press ENTER:
- When the file loads, type the following command on a line of its own and then save the file:
- 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.