September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,46 @@
# An empty Hash Table:
$hash = @{}
# A Hash table populated with some values:
$nfcCentralDivision = @{
Packers = "Green Bay"
Bears = "Chicago"
Lions = "Detroit"
}
# Add items to a Hash Table:
$nfcCentralDivision.Add("Vikings","Minnesota")
$nfcCentralDivision.Add("Buccaneers","Tampa Bay")
# Remove an item from a Hash Table:
$nfcCentralDivision.Remove("Buccaneers")
# Searching for items
$nfcCentralDivision.ContainsKey("Packers")
$nfcCentralDivision.ContainsValue("Green Bay")
# A bad value...
$hash1 = @{
One = 1
Two = 3
}
# Edit an item in a Hash Table:
$hash1.Set_Item("Two",2)
# Combine Hash Tables:
$hash2 = @{
Three = 3
Four = 4
}
$hash1 + $hash2
# Using the ([ordered]) accelerator the items in the Hash Table retain the order in which they were input:
$nfcCentralDivision = [ordered]@{
Bears = "Chicago"
Lions = "Detroit"
Packers = "Green Bay"
Vikings = "Minnesota"
}