We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a774b7 commit c09c484Copy full SHA for c09c484
1 file changed
ModuleFast.ps1
@@ -102,8 +102,9 @@ if ($installArgs) {
102
try {
103
[string]$bootstrapScript = "$EntryPoint $($installArgs -join ' ')"
104
Write-Debug "Detected we were started with args, running $bootstrapScript"
105
- #TODO: Find a less gross way to do this than Invoke-Expression
106
- Invoke-Expression $bootstrapScript
+ #Because we are using a module entry point, we don't need a child scope, we can run in current scope which will just
+ #pass to the module
107
+ . ([scriptblock]::Create($bootstrapScript))
108
} finally {
109
#Remove the bootstrap module if args were specified, otherwise persist it in memory
110
Remove-Module $bootstrapModule
0 commit comments