This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Scripting games puzzle for December 2015 | |
.DESCRIPTION | |
ALL REQUIREMENTS | |
1. Split $list into a collection of entries, as you typed them, and sort the results by length. As a bonus, see if you can sort the length without the number. | |
2. Turn each line into a custom object with a properties for Count and Item. | |
3. Using your custom objects, what is the total number of all bird-related items? | |
4. What is the total count of all items? | |
5. Using PowerShell what is the total number of cumulative gifts? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[parameter(Mandatory=$True)] | |
[string]$VMNameStr | |
) | |
$VMNames = ($VMNameStr.split(",")).Trim()|where-object {$_ -ne ""} | |
$VMNames | Foreach-object -Begin {$i = 0} -Process {set-variable -Name ("vmname" + $i) -value $_ ; $i++} | |
$VMNames | |
# Get-Variable -Include V* -Exclude "VerbosePreference" |