獲取當前路徑,之前一直通過內置的$MyInvocation變量:
$CurrentyDir = Split-Path -Parent $MyInvocation.MyCommand.Definition;
PowerShell3.0之後,直接一個$PSScriptRoot解決問題。
獲取當前路徑,之前一直通過內置的$MyInvocation變量:
$CurrentyDir = Split-Path -Parent $MyInvocation.MyCommand.Definition;
PowerShell3.0之後,直接一個$PSScriptRoot解決問題。