Enforce dot sourcing. (#33363)
This commit is contained in:
Родитель
587856c11e
Коммит
13d9e9902f
|
@ -1,9 +1,12 @@
|
|||
#
|
||||
# This file must be used by invoking ". .\activate.ps1" from the command line.
|
||||
# You cannot run it directly.
|
||||
# To exit from the environment this creates, execute the 'deactivate' function.
|
||||
#
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.') {
|
||||
Write-Host -f Red "This script must be dot sourced. Run it by invoking '. .\activate.ps1'."
|
||||
return
|
||||
}
|
||||
|
||||
function deactivate ([switch]$init) {
|
||||
|
||||
# reset old environment variables
|
||||
|
|
Загрузка…
Ссылка в новой задаче