In the recent days, being a SharePoint developer, most of the times, we are working on the Powershell and its been essential to have all the syntax of PowerShell as that of C#.
Recently, I was about to write a switch statement and thought of sharing here.
They are very straight forward. But even, then I just wanted to make sure that we have all the syntax handy. (For future reference J )
function ExecuteFunctions($input1)
{
switch($input1)
{
1
{
# Do the action
#
}
2
{
# Do the action
}
default
{
break
}
}
}
Happy Coding,
Sathish Nadarajan.
Leave a comment