In a perfect world, there would be an easy way to run PS one-liners with a task⌠So that way I can hand it over to our MSP that is really PS dependent.
What does your Actionscript look like? Are you using the âPowerShellâ script type or trying to run this in native Actionscript, and if native Actionscript, did you escape the open-curlybrackets as {{ ?
Does that PowerShell give you results when you run it locally? On my test machines, it doesnât, but Iâve not explicitly installed modules using the Install-Module cmdlet. As described at https://docs.microsoft.com/en-us/powershell/module/powershellget/get-installedmodule?view=powershell-7.2 , the âGet-InstalledModuleâ doesnât list any default modules or those that are loaded by just adding them to the PS paths, it only lists the ones explicitly installed via Install-Module.
Install-Module can install to machine scope or just to the current user scope. I would expect Get-InstalledModule, when running as LocalSystem, should only show whatâs installed to the Machine scope.
To list the default modules or the ones loaded by copy to the PS paths, I think Get-Module -ListAvailable may be more fitting, and it does give me results when I send that one through BigFix.
I would think that the security context that the PS script runs in would be a factor in getting results. The Local System account doesnât have visibility into other usersâ security contexts.
This article on installing PowerShell Modules may provide other pathways to the information youâre looking for:
Important note here. Since BigFix runs a 32bit bit, it only has access to PowerShell 32bit, which is missing many modules and inability to import modules like vmware. This has created limitations for us when running scripts natively. I think there are workarounds, but this is something you will run into.
I am hoping this is now patched in 10.0.6, and that weâll be able to use cmdlets like âGet-NetConnectionProfileâ on x64, but I havenât been able to verify yet.
This will produce output lines matching one of two patterns:
Module-Name - Version
Module-Name - Version (Path)
When only a single version/instance of a module is present, the first output will be generated. If a module is installed in multiple locations or there are multiple versions of that module installed, the second output will be generated. In the event you only want the second pattern for all modules, you can use this instead:
Get-Module is a core PowerShell cmdlet that is fully cross-platform supported and uses the same internal code that performs the actual module loading for PowerShell to generate itâs output. This cmdlet will enumerate all the module paths that the current session knows about (via the environmental variable PSModulePath) regardless of architecture (32/64-bit) so running thru BigFix under the 32-bit context will produce valid results.