- In an object-oriented language, every object that is being used and returned is of an explicit object type. You have the benefit of encapsulation, polymorphism, and inheritance, which makes programming easier and fault-tolerant.
- # singleline comment and <# multiline comment #>.
- With regions, you can divide your code into separate blocks and name them. It is a good way to hide unnecessary code. #region newregion code #endregion
- You can use the same cmdlets for every PSProvider and list all objects.
- $stringvar = 'string' or [string]$stringvar = 'string'.
- Get-, Set-, New-, Remove-
- Get-Command
- Get-Help cmdlet
- In general, a pipeline sends the output of the preceding function or cmdlet to the next one. Its output is bound to the parameters of the following cmdlets, by type. The pipeline always executes from left to right.
-
[String], [Char], [Byte], [Int], [Long], [Decimal], [Single], [Double], [Bool], [DateTime], [XML], [Array], [Hashtable]
- if...else, if...elseif, switch
- for loop – iterates values
do until – executes code until a condition is fulfilled
do while – executes code while a condition is fulfilled - at least one iteration
while loop – executes code while condition is fulfilled
foreach loop – iterates through all objects in a list or array