PoshCode Archive  Artifact [0e47139eab]

Artifact 0e47139eab57c9989dad1201dc9ecd884d404f3af2f5cd3a8c4eb5015cf07006:

  • File LibraryInvocation.ps1 — part of check-in [98e35b771c] at 2018-06-10 13:06:48 on branch trunk — From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes (user: Lee Holmes size: 798)

# encoding: ascii
# api: powershell
# title: LibraryInvocation.ps1
# description: From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes
# version: 0.1
# type: script
# author: Lee Holmes
# license: CC0
# function: Get-ScriptName
# x-poshcode-id: 2192
# x-archived: 2016-03-19T00:33:13
# x-published: 2011-09-09T21:41:00
#
#
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)

Set-StrictMode -Version Latest

## Return the name of the currently executing script
## By placing this in a function, we drastically simplify
## the logic it takes to determine the currently running
## script

function Get-ScriptName
{
    $myInvocation.ScriptName
}

function Get-ScriptPath
{
    Split-Path $myInvocation.ScriptName
}