2

My script call many other script and i need know each fullname (for log info).

but the same command doesn't work in Powershell_ISE

Alban
  • 297
  • 2
  • 7

1 Answers1

2

This code are avaible in Powershell_ISE and in script.ps1 file

function Get-ScriptFullName () { 
    if($hostinvocation -ne $null) {
        $hostinvocation.MyCommand.path
    } else {
        $script:MyInvocation.MyCommand.path
    }
}
Alban
  • 297
  • 2
  • 7