File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,13 @@ type pwsh struct{}
30
30
var Pwsh Shell = pwsh {}
31
31
32
32
const hook = `
33
+
34
+ # All environment variables must be set in global scope
35
+ # DO NOT PUT IN MODULE
33
36
{{.EnvContent}}
34
37
38
+ $env:__VFOX_PID = $pid;
39
+
35
40
# remove any existing dynamic module of vfox
36
41
if ($null -ne (Get-Module -Name "version-fox")) {
37
42
Remove-Module -Name "version-fox" -Force
@@ -45,7 +50,6 @@ New-Module -Name "version-fox" -ScriptBlock {
45
50
#>
46
51
& '{{.SelfPath}}' env --cleanup 2>$null | Out-Null;
47
52
48
- $env:__VFOX_PID = $pid;
49
53
$originalPrompt = $function:prompt;
50
54
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = [Text.UTF8Encoding]::UTF8;
51
55
@@ -70,7 +74,6 @@ New-Module -Name "version-fox" -ScriptBlock {
70
74
# perform cleanup on removal so a new initialization in current session works
71
75
$ExecutionContext.SessionState.Module.OnRemove += {
72
76
$function:prompt = $originalPrompt
73
- Remove-Item -Path Env:__VFOX_PID
74
77
Unregister-Event -SubscriptionId $subscription.Id
75
78
}
76
79
} | Import-Module -Global
You can’t perform that action at this time.
0 commit comments