且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当前执行powershell脚本的路径

更新时间:2022-12-02 18:28:44

对于 PowerShell 3.0 用户 - 以下适用于模块和脚本文件:

For PowerShell 3.0 users - following works for both modules and script files:

function Get-ScriptDirectory {
    Split-Path -parent $PSCommandPath
}