Skip to content

Instantly share code, notes, and snippets.

@gislig
gislig / SimpleExample1.ps1
Created May 10, 2018 09:14
Simple Powershell Example 1
$Cars = "Tyota","Hyundai","Ford"
#Foreach within the Array
$Cars | ForEach-Object { $_ }
#Foreach within the Array simpler
$Cars | ForEach { $_ }
#Foreach within the Array much simpler
$Cars | % { $_ }
@gislig
gislig / PowershellSimpleClass.ps1
Created May 10, 2018 09:06
Simple way to add class to Powershell
Class Fruit {
#Set the variable
[string]$FruitName
#Create the constructor
Fruit ($FruitName) {
$this.FruitName = $FruitName
}
}