Events are not executed when using PE in VDF application or powerJobs Processor

Script files are not loaded when using PE in VDF application or powerJobs Processor

Description

When powerEvents is used in a VDF application or powerJobs Processor the script files are not loaded. The Modules are loaded correctly. 

It is not recommended to install powerEvents on the jobProcessor machine

Solution 1

This issue was fixed in powerEvents 24.0.12. Install this version or a newer version.

Solution 2

If an update is not possible you can use the following workaround:

As the module files are loaded correctly it is possible to make a module that loads the script files.

* Create a new file "C:\ProgramData\coolOrange\Client Customizations\Modules\VDF_Workaround.psm1" with the following script

if ($Processname -in @('powershell', 'powershell_ise', 'Connectivity.VaultPro')) {
    return
}
Get-ChildItem -LiteralPath "C:\ProgramData\coolOrange\Client Customizations" -File -Filter '*.ps1' `
| ForEach-Object { Import-Module $_.FullName }

If you don't want to load all of the scripts you can load specific files instead like this

if ($Processname -in @('powershell', 'powershell_ise', 'Connectivity.VaultPro')) {
    return
}
Import-Module "C:\ProgramData\coolOrange\Client Customizations\test.ps1"