Welcome to TechNet Blogs Sign in | Join | Help

Syndication

Archives

[PowerShell] "Ctrl+C" is the key.

Did you ever lost the prompt within the PowerShell console?

I mean, did it happen to you that you pass a cmdlet and the prompt got changed from:

"[PS] C:\>" to ">>"

Plus, in that case whatever you type in the PowerShell console is doing NOTHING without the "natural" possibility to get back to the original prompt.

OK then, so I'm about to be ridiculous for those who know the trick, but it took me a while to understand how to get the prompt back.

Here I am playing with my VMs. Not a fancy thing, just running Exchange Management Shell (EMS) and by-the-way PowerShell to pass some cmdlets on my Exchange Server 2007 organization.

I pass several cmdlet without any problem, just like the one displayed in the following screenshot. REALLY basic stuff. With this cmdlet, I just want the occurrences of all mailboxes homed on a specific Mailbox database. The cmdlet is:

Get-Mailbox -Database:"E2K7-HTCAS\First Storage Group\Mailbox Database" | FT Name

The displayed occurrences are totally relevant with what I know about the situation.

Let's say now that I'm a bit tired and start "misspelling" my cmdlets. I re-run the previous cmdlet but forgot a specific character in the cmdline. In this case, the cmdlet is:

Get-Mailbox -Database"E2K7-HTCAS\First Storage Group\Mailbox Database" | FT Name

Note that ":" is missing just after "Database"

Result is my prompt got changed from "[PS] C:\>" to ">>" without any specific string to pass to return to my prompt.

And that is where the Ctrl+C keyboard shortcut save me as shown in the following screenshot (Thank you MS-DOS memories and CyrilBe!!!)

Th Bad Cmdlet

Honestly, I don't know where the command is locked on, and I didn't find anything about this specific behavior. But I'll be glad to get some explanation on this :-).

J-G@

by Jeremy Gagne | 0 Comments

Filed under: , ,

The Quan Object

OK, I finally decided to do like everyone else: Opening my own blog.

I'm a support engineer at Microsoft and specialized on the Exchange Server application. My job purpose is to visit customers to solve their daily issues. So I'm no developer, neither guru master on specific topics. I just fix problem and try to arrange the situation to have everyone happy and confident with Microsoft products.

When question occurs, my goal is to provide the best answer where the two most important conditions are met : Microsoft recommendations + Customers needs.

So I wish to have this blog dedicated to tips and tricks that help me on a daily work. Sometimes, this "tips and tricks" stuff might look really easy for most of people. My goal is not to show people how to do new stuff, but to have the stuff be done better.

Most of the time, I'm the type of guy who search the web prior requesting help. If I post something here, it means the topic covered was not that easy to find (at least for me). Then, if I'm posting about a specific topic, it is because I considered 2 things :

  1. It took me some times to figure out the answer to a specific question I had.
  2. If I encountered the problem, some might have encountered it as well.

Cheers

J-G@

PS : Every time you start a something new, you want to thank someone that make it possible (Honest, I do). I here would like to genuinely thanks GuillaumeD for his unconditional help over the past 10 years. Please visit his blog at http://blogs.technet.com/GuillaumeD it worth the time you'll spend there. If you don't know the guy, at least you'll have the taste of his approach on several topics.

by Jeremy Gagne | 1 Comments

Filed under: ,

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement  
Page view tracker