0

I have a strange problem when launching Powershell commands from VBS.

Sometimes, it works and sometimes, not. It occurs on startup scripts or GPOs (SYSTEM and USER permissions)

I don't see the issue when launching ps1 files instead, only with -command. The powershell opens (in taskmgr), doesn't exit, does nothing and there's a memory leak.

Here's two example of the code, it may stuck on any powershell -command. Tried -NoProfile, -NonInteractive, Exit-PSSession, Exit, etc.

objShell.run("powershell -NoProfile -NoLogo -NonInteractive -command ""& {Set-ExecutionPolicy unrestricted; import-module 'C:\Program Files\Microsoft Application Virtualization\Client\Appvclient'}""", 0, True)

objShell.run "powershell -command ""& { add-appxpackage -registerbyfamilyname -MainPackage Microsoft.Windows.Photos_8wekyb3d8bbwe }""",0,true 
  • OS: Windows 10 Education 20H2
  • Powershell: 5.1.19041.1320
  • Just want to follow up, we finally pinpointed the problem, it was McAfee Endpoint Security 10.6.1 (Platform 2286 / Threat protection 2335) updated to 2445/2495 Nov Update 2021 – Stéphane Lantin Nov 25 '21 at 15:28

0 Answers0