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
# Illustration (based on concepts in http://blogs.technet.com/b/heyscriptingguy/archive/2011/06/16/use-asynchronous-event-handling-in-powershell.aspx | |
# and code nicked from an answer in http://social.technet.microsoft.com/Forums/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell | |
# ) | |
##### | |
# | |
# PASTE LINES BELOW INTO CONSOLE | |
# | |
# |
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
<Query Kind="Statements"> | |
<Reference><RuntimeDirectory>\System.Security.dll</Reference> | |
<Namespace>System.Security.Cryptography.Xml</Namespace> | |
</Query> | |
// need to load System.Security via F4 | |
XmlDocument myDoc = new XmlDocument(); | |
myDoc.LoadXml("<root x='x' a='a'><trunk>etc</trunk></root>"); | |
myDoc.OuterXml.Dump("Attributes in original document order"); | |
XmlDsigC14NTransform t = new XmlDsigC14NTransform(); |
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
<Query Kind="Program" /> | |
// define regex to match $-delimited tokens, eg $name$ | |
static Regex toke = new Regex(@"\$(\w+)\$", RegexOptions.Compiled); | |
static void Main() | |
{ | |
string input = @"Dear $name$, as of $date$ your balance is $amount$"; | |
var args = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); | |
args.Add("name", "Mr Smith"); |
NewerOlder