Skip to content

Instantly share code, notes, and snippets.

View kjeske's full-sized avatar

Krzysztof Jeske kjeske

View GitHub Profile
@kjeske
kjeske / ObjectExtensions.cs
Last active May 7, 2019 09:21
Immutable changes in objects using AutoMapper
public static class ObjectExtensions
{
private static readonly ConcurrentDictionary<Type, Func<object, object>> MemberwiseCloneCache =
new ConcurrentDictionary<Type, Func<object, object>>();
public static T With<T>(this T obj, Action<T> mutator) where T : class
{
if (obj == null)
{
return null;
param ([string]$excelFileName)
Set-ExecutionPolicy Bypass -Scope Process
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US"
Function ExportWSToCSV ($excelPath, $csvFileName)
{
$excelFile = Get-Item $excelPath
$excelLocation = $excelFile.DirectoryName
$E = New-Object -ComObject Excel.Application