PowerShell, Cmdlet Output to File

To send the output of a PowerShell cmdlet to a file use Out-File.


.\pwrshl.ps1 | Out-File -FilePath .\my.log


  • Use the -NoClobber to prevent from overriding an existing output file
  • There are ways to specify the output file encoding type



Shared by joubin on Thu Apr 08 2021


The SUBSTRING function has the following syntax:

SUBSTRING ( expression, start, length )


  1. It's an error to have a NULL expression
  2. The start is 1 based

To get around the NULL expression scenario, use the CASE WHEN ... expression in TSQL.




Shared by joubin on Wed Apr 07 2021

Setting commit user email, Git

Global Git configuration: (Windows) c:/users/{user}/.gitconfig

git config --global user.email "email@example.com"

git config --global user.name "John Doe"

Single Repository Level: /.git/config

git config user.email "email@example.com"

git config user.name "John Doe"


Shared by joubin on Wed Feb 20 2019

forkJoin, TypeScript

Use Case: In cases where there are multiple HTTP requests and the code needs to wait until the responses from all the HTTP requests are available.

forkJoin waits for each HTTP request to complete and group’s all the observables returned by each HTTP call into a single observable array and finally return that observable array.

The result of a forkJoin is an Observable. The data returned when all of the HTTP request are fullfilled, is an array with elements in the same order as they were presented in the array passed to the forkJoin rxjs library function.





Shared by joubin on Tue Nov 10 2020

OData, Functions vs. Actions

Actions are operations exposed by an OData service that MAY have side effects when invoked. Actions MAY return data but MUST NOT be further composed with additional path segments.

Functions are operations exposed by an OData service that MUST return data and MUST have no observable side effects.

These are similar to SQL functions versus stored procedures.

In SQL, functions are generally used to query, whereas stored procedures could be used for both query and modifications (update/insert/delete).



Shared by joubin on Wed Aug 12 2020

ngOnChanges lifecycle hook, Angular

Changes are only detected when the databound input property is changed via a template's binding. If the changes are done manually to a property on a component class, the change is not detected.



Shared by joubin on Mon Nov 02 2020

Tsql, Rename Table Column

sp_rename '{table_name}.{column_old_name}', '{column_new_name}', 'COLUMN';

Microsoft recommends that you drop and recreate the table so that scripts and stored procedures are not broken.


Shared by joubin on Thu Jan 04 2018

Tsql, Rename table

EXEC sp_rename 'schemaName.oldTableName', 'newTableName';



Shared by joubin on Wed Sep 23 2020

Software Test Fixture

A test fixture sets up the system under test (SUT) for the software testing process by initializing it (configuration and/or data) satisfying any preconditions the system may have.

Example: initialize a database with known parameters before running a test.

This allows for tests to be repeatable, which is one of the key features of an effective test framework.

In a non-software context, such as circuit boards, a test fixture is a setup or another device designed to hold the device under test (DUT) in place and allow it to be tested.



Shared by joubin on Wed Sep 21 2016

TSQL - Find duplicates in a column

SELECT   {col_name},
         COUNT({col_name}) AS dupe_cnt
FROM     {table_name}
GROUP BY {col_name}
HAVING   COUNT({col_name}) > 1


  1. {col_name} with the column name being examined
  2. {table_name} with the respective table name

Shared by joubin on Tue Jun 23 2020


Returns the table's column length in bytes:

COL_LENGTH ( 'table' , 'column' )



Shared by joubin on Wed Apr 29 2020

Using MSI for debugging in Visual Studio

To debug against Azure (e.g. getting access to Key Vault etc.) configure Visual Studio to use the account with which it uses to send credentials to Azure.

This configuration is under: Options => Azure Service Authentication => Account Selection




Shared by joubin on Fri Apr 17 2020

Azure Data Factory Trigger files

The trigger files are stored in a location similar to:


Each trigger has the following information:

  • the schedule/condition defintion
  • a collection of pipelines references



Shared by joubin on Fri Apr 03 2020

Roslyn & RyuJIT


  • The .NET Platform Compiler i.e. compiles your C# (etc) code into IL
  • Has a public API e.g. could be included in your app to compile other code on-the-fly


  • Compiles the Roslyn generated IL into native code (only x64)
  • No public API available

Shared by joubin on Thu Apr 02 2020

tracert, Windows

The TRACERT diagnostic utility determines the route to a destination by sending Internet Control Message Protocol (ICMP) echo packets to the destination.



Shared by joubin on Tue Mar 31 2020

.NET Portability Analyzer

The .NET Portability Analyzer is an open source tool that is utitlized to analyze assemblies, files or directory of files for compatibility across .NET implementations.

This tool reports on the compatibility of the current app across .NET implementations.

It comes as:

  1. Visual Studio Extension - analyzes individual assemblies/projects or the solution
  2. A console app (ApiPort) - analyzes assemblies/files/directories


Shared by joubin on Fri Sep 06 2019

Debugging modes, VS Code

In VS Code, there are two core debugging modes, Launch and Attach.

  1. Starting in the browser
    • When you open DevTools in a browser, you are attaching DevTools to the open browser tab.
  2. Starting in the code editor
    • The editor launches your process, and it automatically attaches its debugger to the newly launched process.


Shared by joubin on Fri Aug 09 2019

Launch Configuration, VS Code

A configuration file allows you to configure and save debugging setup details.

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder)


Shared by joubin on Fri Aug 09 2019

Angular Framework app version

1. ng --version (or ng v)

2. Open Developer Tools in the browser. Under the 'Elements' tab, look for html/body/app-root[ng-version]

3. To render the Angular version on a page, import VERSION from @angular/cli.

const version = VERSION.full;

Shared by joubin on Wed Jul 31 2019