Returns the path to the script that will be executed
If the path cannot be determined, an attempt is made to obtain the path via the
$PSScriptRoot runtime variable. If this also fails, the current directory is returned.
Example 1:Returns the path of the script #
PS C:\> Get-ScriptDir
Returns the path of the calling script.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.