PowerShell Team

Automating the world one-liner at a time…

Suppressing return values in PowerShell functions

PSMDTAG:FAQ: How do I supress return values in PowerShell functions? This was asked in a newgroup with the clarification: What I mean is:When you call a function Foo that returns a bool, PS will write 'True' or 'False' to the screenby default. Is there anyway to get it to stop writing those return values? Let's illustrate the issue: PS> ...

Casting a scriptblock to an arbitrary delegate signature

Arild asked the following in http://arildf.spaces.msn.com/blog/cns!E99F8B43533149B0!140.entry?_c%3dBlogPart : PSMDTAG:FAQ: Delegates - how to cast a scriptblock to an arbitrary delegate signature? ANSWER - You can't in V1.0. In version 1.0 Windows PowerShell only supports casting scriptblocks to delegates with the ...

Issues with Windows PowerShell syntax

REI recently posted some comments/requests about Windows PowerShell syntax at: http://blogs.msdn.com/powershell/archive/2006/04/25/583273.aspx#675133 Let's go through a few of the points. ...the syntax was just way too cryptic and unintuitive. Often it's even dangerous. Like this: #PowerShell's syntax causes dangerous problems generating ...

Meet the Exchange Superstars!

Now you can meet the superstars (Vivek Sharma and Mihai Jalobeanu) behind the Exchange Management Shell in a video interview at:  http://msexchangeteam.com/archive/2006/07/20/428366.aspx You can also get a demo of the Exchange Management Shell (which is Windows PowerShell with Exchange snap-ins) at: http://msexchangeteam.com/archive/2006...

How to I set the title of my Console Window?

PSMDTAG:FAQ: How do I set the title of my console window?  ANSWER: $Host.UI.RawUI.WindowTitle = "PowerShell ROCKS" Jeffrey Snover [MSFT]Windows PowerShell/Aspen ArchitectVisit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/...

Exchange Management Shell

Here is a pointer to an Introduction To the Exchange Management Shell:  http://download.microsoft.com/download/6/d/4/6d4b5c51-dd72-41d3-b5b1-9dc22b1d35f1/IntroExchangeMgmtShell.pdf This is a nice glossy view of the important aspects of both Windows PowerShell and Exchange's use of it. PSMDTAG:FAQ: How does the Exchange Management Shell ...

PSMDTAG:FAQ: What is $OFS

In my blog entry regarding Cascading Type Casts ( http://blogs.msdn.com/powershell/archive/2006/07/15/Cascading_Type_Casts.aspx ) there was an example: PS> [string][char[]][int[]][char[]]"PowerShell" P o w e r S h e l l And in a comment was a question asking why there were spaces between the letters.  The answer is $OFS   ...

Variable expansion in strings and here-strings

PSMDTAG:FAQ: What is the difference between single quoted and double quoted strings?  ANSWER:  Double quoted string expand variables and single quoted strings do not. Example: PS> $x="TEST"PS> "This is a $x"This is a TESTPS> 'This is a $x'This is a $x   PSMDTAG:FAQ: How do variables expand in strings? PSMDTAG:FAQ: Why ...