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
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$a = ([xml](new-object net.webclient).downloadstring("http://channel9.msdn.com/Events/BUILD/BUILD2011/RSS/wmv")) | |
$a.rss.channel.item | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$sessionUrl = New-Object System.Uri($_.link) | |
$file = $sessionUrl.segments[-1] + " - " + $_.title.Replace("""", "'").Replace(":", "-") + ".wmv" | |
if (!(test-path $file)) | |
{ | |
Write-Host "Downloading $file" | |
(New-Object System.Net.WebClient).DownloadFile($url, $file) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using FluentAssertions; | |
using Ploeh.AutoFixture.Xunit; | |
using Xunit.Extensions; | |
namespace XunitSample | |
{ | |
public class TestClass |
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 ObserveringType | |
{ | |
// Use Is prefix here because the purpose of this class it to describe the other class | |
public bool IsEnabled { get; protected set; } | |
public ObservingType(SomeType type) { ... } | |
} | |
public class SomeType |
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
try | |
{ | |
directoryEntry.Children.Find(objectName, "domainDns"); | |
} | |
catch (DirectoryServicesCOMException exception) | |
{ | |
if (exception.ErrorCode != 0x2030) | |
{ | |
throw; | |
} |
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
Dear Microsoft New Zealand Speaker Selection Team, | |
Wouldn’t you love to get bang for your buck while investing in me being here? There is a way: speaking at Microsoft TechEd New Zealand 2012. This year, the annual event will be held in Auckland from September 4 to 7 and it is the best way for me to meet some awesome developers and share my experiences - to add value to their team and their bottom line. | |
Microsoft TechEd 2012 is New Zealand’s largest technology conference, and it always has the best content because they bring down speakers from overseas. I could be one of them! I can get help deliver the most comprehensive training on Microsoft products, even those that haven't been released yet. | |
An added benefit this year is that I can update my industry certification on-site, as well as the skills that will help our organisation better understand, deploy and manage technologies. | |
In addition to over 160 unique breakout sessions with Microsoft and industry speakers, the conference would offer me the chanc |
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
<?xml version="1.0" encoding="utf-16"?> | |
<instrumentationManifest xsi:schemaLocation="http://schemas.microsoft.com/win/2004/08/events eventman.xsd" xmlns="http://schemas.microsoft.com/win/2004/08/events" xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:trace="http://schemas.microsoft.com/win/2004/08/events/trace"> | |
<instrumentation> | |
<events> | |
<provider name="Company-Product-Module" guid="{11111111-3709-4551-821E-CF1DF1644D14}" symbol="company_product_module"> | |
<events> | |
<event symbol="ApplicationStart" value="1" version="0" channel="Company-Product-Module/Operational" level="win:Informational" task="win:None" opcode="win:Start" message="$(string.Company-Product-Module.event.1.message)" /> | |
<event symbol="ApplicationEnd" value="2" version="0" channel="Company-Product-Module/Operational" level="win:Informational" task="win:None" opcode="win:Stop" message= |
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
using System; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Transactions; | |
using FluentAssertions; | |
// ReSharper disable CheckNamespace | |
namespace System.Data.Linq | |
// ReSharper restore CheckNamespace | |
{ |
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
// Need to go direct to the registry as the EventLog.CreateEventSource | |
// method cycles through all logs, including the Security log, to | |
// verify that the source does not exist and is unique | |
try | |
{ | |
var logKeyName = String.Format(CultureInfo.InvariantCulture, @"SYSTEM\CurrentControlSet\Services\EventLog\{0}", log); | |
var sourceKeyName = String.Format(CultureInfo.InvariantCulture, @"SYSTEM\CurrentControlSet\Services\EventLog\{0}\{1}", log, source); | |
using (Registry.LocalMachine.OpenSubKey(logKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree) ?? | |
Registry.LocalMachine.CreateSubKey(logKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree)) | |
using (var sourceKey = Registry.LocalMachine.OpenSubKey(sourceKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree) ?? |
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 Set-WebSiteOffline { | |
param( | |
[Parameter(Mandatory=$true)][string]$ServerName, | |
[Parameter(Mandatory=$true)][string]$SiteName, | |
[string]$UserName, | |
[string]$Password | |
) | |
$EncodedSiteName = [System.Web.HttpUtility]::UrlEncode($SiteName); | |
$SiteManagementEndpoint = "https://$ServerName.contoso.com:8172/MSDeploy.axd?Site=$EncodedSiteName"; |
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
$CurrentFolder = $(Get-Location).Path | |
Import-Module SQLPS -DisableNameChecking | |
Set-Location $CurrentFolder |
OlderNewer