我的脚本调用许多其他脚本,我需要知道每个全名(日志信息)。
但是相同的命令在Powershell_ISE中不起作用
这个代码可以在Powershell_ISE和script.ps1文件中find
function Get-ScriptFullName () { if($hostinvocation -ne $null) { $hostinvocation.MyCommand.path } else { $script:MyInvocation.MyCommand.path } }