Signing Powershell scripts

1. create code signing certificate New-SelfSignedCertificate -FriendlyName “Friendly Name Code Signing Example” -CertStoreLocation Cert:\CurrentUser\My -Subject “ExampleName” -Type CodeSigningCert 2. locate…

TPM 2.0

Enable/Disable TPM support in UEFI BIOS Restart your computer Enter BIOD by pressing F2 or DEL Navigate to “Advanced” tab…

AutoMapper Usage Guidelines

Coutesy of Jimmy Bogard   Configuration √ DO initialize AutoMapper once with Mapper.Initialize at AppDomain startup in legacy ASP.NET AutoMapper’s static initialization is designed…

What types should I use to pass collections in C#?

Use IEnumerable<T> where possible Avoid passing concrete collection types Avoid modifying collections passed as parameters Consider IReadOnlyCollection<T> if you need to enumerate multiple times…

PowerShell script to register Windows Service

#Requires -Version 6.2 #Requires -RunAsAdministrator param( [Parameter(mandatory=$true)] [string] $Name, [Parameter(mandatory=$true)] [string] $DisplayName, [Parameter(mandatory=$true)] [string] $Description, [Parameter(mandatory=$true)] [System.IO.FileInfo] $Exe, [Parameter(mandatory=$true)] [string]…