O'Reilly logo

Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 by Shannon Bray, Gary Lapointe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Add Conditional Logic

It is extremely common when working with Windows PowerShell to have to evaluate some data and perform some conditional action based on that evaluation. Just about every modern programming language (as well as old-school batch files) supports some mechanism to perform conditional logic. Windows PowerShell's capabilities are fully featured and mirror the capabilities of programming languages like C#, with only slight differences in syntax.

Before you start writing conditional logic statements, you must first understand Windows PowerShell's comparison operators and logic operators.

Use Comparison and Logic Operators

If you've ever written code in a language such as C# and are now working with Windows PowerShell, you may be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required