Pages

Tuesday, August 31, 2010

Menu Looping in Powershell

Menu Looping is pretty easy to set up in Powershell.  You're basically setting a condition and looping back if that condition isn't met.

For example, we'll use $a as the variable we're keeping an eye on.

$a=0 #setting a to zero value
While ($a -ne 3) 


{
Write "1. Do something"
Write "2. Do something else"
Write "3. Quit"

$a = Read-host "enter choice"
Switch ($a)

{1
{

#code
}}


The above loop will look for the numeric condition of the variable 'a' and execute switches for other blocks of powershell code for them.

Monday, August 9, 2010

Blog Purpose

Hi,


If this is the first time you've visited this blog, my intent is to use it as a sort of catch all for technical content for things like PowerShell Scripting, Windows Sharepoint Server stuff as well as other general technical articles and notes.  Along the way I'll probably throw in some other non-related technical stuff and maybe a funny or hundred.  I'm also willing to take any questions of a technical nature for both Windows and MAC related stuff.

Enjoy,

John