AdhocAdam / smletsexchangeconnector

SMLets PowerShell based Exchange Connector for controlling Microsoft System Center Service Manager 2016+
https://adhocadam.github.io/smletsexchangeconnector/
GNU General Public License v3.0
29 stars 19 forks source link

Custom Events are incorrectly tied to a Logging Level #443

Closed AdhocAdam closed 1 year ago

AdhocAdam commented 1 year ago

Describe the bug Custom Events are only loaded if the Logging Level is set to 4 (i.e. Verbose). Without this, $ceScripts is $null

https://github.com/AdhocAdam/smletsexchangeconnector/blob/763652c6078583bace36732ada9239c17cd9df84/smletsExchangeConnector.ps1#L745-L764

Help us reproduce the bug Create a custom event for anything such as Invoke-AfterCreateIR. For example, write the $affectedUser to a CSV

function Invoke-AfterCreateIR {
  # This function occurs after a new incident work item is created.
  $affectedUser | export-csv c:\temp\user.csv
}

Expected behavior Custom Events should be loaded regardless of logging level

Workaround Change the logging level to 4 in the Settings UI

AdhocAdam commented 1 year ago

Will ship via #457