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
namespace Util | |
{ | |
public static class ExceptionExtensions | |
{ | |
public static T Unwrap<T>(this Exception exception) where T : class | |
{ | |
return exception.InnerException?.Unwrap<T>() ?? exception as T; | |
} | |
public static Exception Unwrap(this Exception exception) |
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
using System; | |
using System.IO; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Serialization; | |
namespace Util | |
{ | |
public static class XmlUtil | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace Util | |
{ | |
public class FileHelper | |
{ | |
public bool IsDirectoryEmpty(string 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace Util | |
{ | |
public class FileHelper | |
{ | |
public bool IsDirectoryEmpty(string 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
Set-StrictMode -Version latest | |
$ErrorActionPreference = "Stop" | |
# Taken from psake https://github.com/psake/psake | |
<# | |
.SYNOPSIS | |
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode | |
to see if an error occcured. If an error is detected then an exception is thrown. | |
This function allows you to run command-line programs without having to | |
explicitly check the $lastexitcode variable. |
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
choco install sql-server-management-studio –y | |
choco install git –y | |
choco install putty -y | |
choco install gitextensions -y | |
choco install vscode –y | |
choco install azure-data-studio –y | |
choco install 7zip –y | |
choco install nodejs-lts -y | |
choco install googlechrome -y | |
choco install firefox –y |
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
# Original code from https://github.com/slavizh/OMSSearch/blob/master/OMSSearch.psm1 | |
# - Updated/fixed authentication method calls | |
# - Ensure ADAL DLL is loaded | |
Function Get-AADToken { | |
<# | |
.SYNOPSIS | |
Get token from Azure AD so you can use the other cmdlets. | |
.DESCRIPTION | |
Get token from Azure AD so you can use the other cmdlets. |
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 TC-Escape ([string] $text){ | |
return $text.Replace("|","||").Replace("'","|'").Replace("\n","|n").Replace("\r","|r").Replace("[","|[").Replace("]","|}") | |
} | |
Function Invoke-Exec | |
{ | |
[CmdletBinding()] param([Parameter(Position=0,Mandatory=1)][scriptblock]$cmd) | |
$scriptExpanded = $ExecutionContext.InvokeCommand.ExpandString($cmd).Trim() |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using CorrelationId; | |
using CorrelationId.Abstractions; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Options; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using JsonApiDotNetCore.Configuration; | |
using JsonApiDotNetCore.Controllers; | |
using JsonApiDotNetCore.Middleware; | |
using JsonApiDotNetCore.Queries; | |
using JsonApiDotNetCore.Queries.Expressions; | |
using JsonApiDotNetCore.Queries.Internal.Parsing; |