PowerShell

Profile File

To locate profile file simply type $profile in PowerShell prompt.

$profile

PowerShell and PowerShell ISE have different profile files!

PowerShell loads profile for each new session from file:

$HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

To create alias msb for msbuild:

New-Alias msb C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe

Snippets

Escape Processing Character

`

Apply Command to Each File

The following command converts all files in the directory to markdown format. It was used to convert files with .rst extension from Sphinx documentation to markdown format.

Get-ChildItem -File | foreach { pandoc -s $_.Name -o "$($_.BaseName).md"}

List Directory Content Recursively

Get-ChildItem -Recurse