poshoholic.com
PowerShell Deep Dive: Using $MyInvocation and Invoke-Expression to support dot-sourcing and direct invocation in shared PowerShell scripts
When creating PowerShell script (ps1) files to share with the community, there are a few different ways you can configure their intended use. You can configure a ps1 file so that it contains one o…