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
[EventSource(Name="Company-EventLog")] | |
public sealed class MyEventSource : EventSource | |
{ | |
public static MyEventSource Log = new MyEventSource(); | |
[Event(1, Message="Request submitted: {0}", Channel = EventChannel.Operational)] | |
public void RequestSubmitted(string requestId) | |
{ | |
this.WriteEvent(1, requestId); | |
} |
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
MyEventSource.Log.RequestSubmitted("12345"); |
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
wevtutil.exe im C:\temp\mynamespace.Company-EventLog.etwManifest.man /rf:"C:\temp\mynamespace.Company-EventLog.etwManifest.dll" /mf:"C:\temp\mynamespace.Company-EventLog.etwManifest.dll" | |
wevtutil um C:\temp\mynamespace.Company-EventLog.etwManifest.man |
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
logman.exe create trace my-trace-session -p Company-EventLog | |
logman.exe start my-trace-session | |
logman.exe stop my-trace-session | |
logman.exe delete my-trace-session |
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
var streamOverTime = Observable.Interval(TimeSpan.FromSeconds(1)); | |
var squaredStreamOverTime = streamOverTime.Select(value => Math.Pow(value, 2)); | |
squaredStreamOverTime.Subscribe(Console.WriteLine); |
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
function Retry-Command | |
{ | |
param ( | |
[Parameter(Mandatory=$true)][string]$command, | |
[Parameter(Mandatory=$true)][hashtable]$args, | |
[Parameter(Mandatory=$false)][int]$retries = 5, | |
[Parameter(Mandatory=$false)][int]$secondsDelay = 2 | |
) | |
# Setting ErrorAction to Stop is important. This ensures any errors that occur in the command are |
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
Retry-Command -Command 'Get-Process' -Args @{ Id = "8156" } -Verbose |
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
VERBOSE: Command [Get-Process] failed. Retrying in 2 seconds. | |
VERBOSE: Command [Get-Process] failed. Retrying in 2 seconds. | |
VERBOSE: Command [Get-Process] failed. Retrying in 2 seconds. | |
VERBOSE: Command [Get-Process] failed. Retrying in 2 seconds. | |
VERBOSE: Command [Get-Process] failed. Retrying in 2 seconds. | |
VERBOSE: Command [Get-Process] failed the maximum number of 5 times. | |
Cannot find a process with the process identifier 8156999. | |
At C:\Retry-Command-usage.ps1:line:19 char:13 | |
+ & <<<< $command @args |
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
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName | |
------- ------ ----- ----- ----- ------ -- ----------- | |
4197 559 1103124 1238548 2052 426.22 8156 devenv | |
VERBOSE: Command [Get-Process] succeeded. | |
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 class WelcomeController : TwilioApiController | |
{ | |
public HttpResponseMessage Post(VoiceRequest request) | |
{ | |
var response = new TwilioResponse(); | |
response.Say("Welcome to this Twilio demo app. Please enter your 3 digit pin code."); | |
response.Gather(new { numDigits = 3, action = string.Format("/api/Authenticate") }); | |
return this.TwiMLResponse(response); | |
} |
OlderNewer