diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-22 18:18:53 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-23 14:16:06 -0800 |
| commit | a5fe308ea3c29c5f8715b8f0c78571759541c9b5 (patch) | |
| tree | 8427a2ccc17ddd61220fb426c55817243e1ae80d /scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | |
| parent | 62c8626f4d28344c3cc4b488ffeac51bddb8bbcd (diff) | |
| download | vcpkg-a5fe308ea3c29c5f8715b8f0c78571759541c9b5.tar.gz vcpkg-a5fe308ea3c29c5f8715b8f0c78571759541c9b5.zip | |
$script:MyInvocation.MyCommand.Definition
It works also in cases where scripts/functions are calling each other.
Without the $script prefix, it would instead give you the calling function OR the path if there was no parent function.
With the prefix, it always yields the directory of the script
Diffstat (limited to 'scripts/findAnyMSBuildWithCppPlatformToolset.ps1')
| -rw-r--r-- | scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 46ba767b9..570ebdf44 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -6,7 +6,7 @@ param( $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 if ($VisualStudioInstallationInstances -eq $null) { |
