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
Integrated Security = true; | |
Integrated Security = SSPI; |
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
public sealed class Singleton | |
{ | |
// Because Singleton's constructor is private, we must explicitly | |
// give the Lazy a delegate for creating the Singleton. | |
static readonly Lazy instanceHolder = | |
new Lazy(() => new Singleton()); | |
Singleton() | |
{ | |
// Explicit private constructor to prevent default public constructor. |
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
ping google.com & |
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
class Contact | |
{ | |
# Optionally, add attributes to prevent invalid values | |
[ValidateNotNullOrEmpty()][string]$First | |
[ValidateNotNullOrEmpty()][string]$Last | |
[ValidateNotNullOrEmpty()][string]$Phone | |
# optionally, have a constructor to | |
# force properties to be set: | |
Contact($First, $Last, $Phone) { |
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
$URL_Format_Error = New-Object System.FormatException "..." | |
Throw $URL_Format_Error |
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
Start-Process -NoNewWindow ping google.com |
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
$URL_Format_Error = [string]"..." | |
Write-Error $URL_Format_Error | |
return |
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
[PSCustomObject]@{ | |
PSTypeName = "Contact" | |
First = $First | |
Last = $Last | |
Phone = $Phone | |
} |
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
1,2,3 | %{ write-host $_ } |
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
add-type @" | |
public struct contact { | |
public string First; | |
public string Last; | |
public string Phone; | |
} | |
"@ |