You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: activate.ps1
+8-1
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,16 @@
1
1
#
2
2
# This file must be used by invoking ". .\activate.ps1" from the command line.
3
-
# You cannot run it directly.
3
+
# You cannot run it directly. See https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scripts#script-scope-and-dot-sourcing
4
+
#
4
5
# To exit from the environment this creates, execute the 'deactivate' function.
5
6
#
6
7
8
+
if ($MyInvocation.CommandOrigin-eq'runspace') {
9
+
Write-Host-f Red "This script cannot be invoked directly."
10
+
Write-Host-f Red "To function correctly, this script file must be 'dot sourced' by calling `". $PSCommandPath`" (notice the dot at the beginning)."
0 commit comments