This file contains hidden or 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
function IsEvenNumber($number) { | |
return $number % 2 -eq 0 | |
} |
This file contains hidden or 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
public class Tests | |
{ | |
[Fact] | |
public void IsEvenNumber_WhenGivenAnEvenNumber_ItReturnsTrue() | |
{ | |
var gna = new Gnabber(); | |
Assert.True(gna.IsEvenNumber(42)); | |
} | |
[Fact] |
This file contains hidden or 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
public class Gnabber | |
{ | |
public bool IsEvenNumber(int number) | |
{ | |
return number % 2 == 0; | |
} | |
} |
This file contains hidden or 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
$LinksCopy = Import-Clixml $Filename |
This file contains hidden or 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
$powerShellObject = Invoke-WebRequest "https://mallibone.com" | |
$Filename = ((Get-Date -format "yyyyMMMdd_HHmm") + "_mallibone_dump.xml") | |
$powerShellObject.Links | Export-Clixml $Filename |
This file contains hidden or 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
"Looks like I'll be the string ending up in a file..." >> "SomeFile.txt" | |
"What are you complaining about I'll be remembered as the second line..." >> "SomeFile.txt" |
This file contains hidden or 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
function DefaultValues | |
{ | |
Param( | |
[Parameter(Position = 0)][string]$Message = "Hello from the standard parameters", | |
[Parameter(Position = 1)][string]$SecondMessage = "", | |
[Parameter(Position = 2)][bool]$PrintItYellow = $false | |
) | |
if($PrintItYellow) | |
{ |
This file contains hidden or 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
.\MultipleParameter.ps1 -Message "Hello" -SecondMessage "Dear Reader" -PrintItYellow $true |
This file contains hidden or 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( | |
[string]$Message, | |
[string]$SecondMessage, | |
[bool]$PrintItYellow | |
) | |
if($PrintItYellow) | |
{ | |
Write-Host "$Message $SecondMessage" -ForegroundColor "Yellow" | |
} |
This file contains hidden or 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
function MultipleParameters | |
{ | |
Param( | |
[Parameter(Position = 0)][string]$Message, | |
[Parameter(Position = 1)][string]$SecondMessage, | |
[Parameter(Position = 2)][bool]$PrintItYellow | |
) | |
if($PrintItYellow) | |
{ |