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
| $Outlook = New-Object -ComObject Outlook.Application | |
| PM> $Mail = $Outlook.CreateItem(0) | |
| PM> $Mail.to = "<email>" | |
| PM> $Mail.Body = $dte.Debugger.CurrentStackFrame.Locals | ForEach-Object {$_.Name, $_.Type} | |
| PM> $Mail.Send() |
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
| #addin "Microsoft.Office.Interop.Outlook" | |
| using Outlook = Microsoft.Office.Interop.Outlook; | |
| // ... | |
| Task("Send-email") | |
| .Does(()=> | |
| { | |
| //https://msdn.microsoft.com/en-us/library/office/bb644320.aspx | |
| var reportFilePath = MakeAbsolute(File("testReport.html")).ToString(); |
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
| // | |
| // http://stackoverflow.com/questions/52797/how-do-i-get-the-path-of-the-assembly-the-code-is-in | |
| // | |
| private static string AssemblyDirectory | |
| { | |
| get | |
| { | |
| string codeBase = Assembly.GetExecutingAssembly().CodeBase; | |
| UriBuilder uri = new UriBuilder(codeBase); | |
| string path = Uri.UnescapeDataString(uri.Path); |
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 obj = LoadNetDll() | |
| dllPath = '<full path to folder with .NET dll>\'; | |
| if isdir(dllPath) | |
| dllPath = fullfile(dllPath,'<.NET dll name>.dll'); | |
| end | |
| a = NET.addAssembly(dllPath); |
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
| Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException; | |
| AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; | |
| [HandleProcessCorruptedStateExceptions] | |
| [SecurityCritical] | |
| void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) | |
| { | |
| var ex = e.Exception; | |
| string message = ex.NameAndMessage(); | |
| string details = ex.GetDetailedMessage(); |
OlderNewer