Working with Objects in PowerShell

Introduction: An object is an instance of type, many cmdlets are available to get details of an object, create new or update an existing object. In PowerShell, an object can be created either using type of .Net Framework class or with ProgID of a COM object which holds properties and methods New-Object cmdlet: This cmdlet... Continue Reading →

Strings in PowerShell

Introduction: Dealing with strings is one of the most common operations in any scripting language. PowerShell supports lots of built-in functions for string manipulation which are already available form System.String class in .Net Framework. Additionally, there are more operations that can directly performed on string type. Let's see those with some examples: #Example - 1... Continue Reading →

Switch Statement in PowerShell

Introduction: The switch statement checks for multiple case value against a input variable, once a case matches against the input variable then code block in that particular case is executed. Let's see various switch statements examples as below. #Copy, Paste and run below examples in PowerShell to see the output. #Example - 1 : Simple... Continue Reading →

Loops in PowerShell

Introduction: The loops are part of any scripting language and PowerShell provides complete support for loops. Let's see them with some examples Foreach: This loop iterates through a collection and each value can be used further or just print to see the output. #Example 1 - Prints the value $CountryNames = @('India', 'UK', 'US', 'JAPAN',... Continue Reading →

Up ↑