Closed Bizarrorollins closed 5 years ago
@Bizarrorollins When defining the middleware hooks in the configuration file, you'll need to use the following names, just drop Hooks
from the end. Notes that these can also be an array of hashtables like in the PostExecute
example below.
MiddlewareConfiguration = @{
PreResponse = @{
Name = 'preresponse'
Path = 'C:\poshbot\middleware\preresponse.ps1'
}
PostResponse = @{
Name = 'postresponse'
Path = 'C:\poshbot\middleware\postresponse.ps1'
}
PostReceive = @{
Name = 'postreceive'
Path = 'C:\poshbot\middleware\postreceive.ps1'
}
PreExecute = @{
Name = 'preexecute'
Path = 'C:\poshbot\middleware\preexecute.ps1'
}
PreReceive = @{
Name = 'dropuser'
Path = 'C:\poshbot\middleware\prereceive.ps1'
}
PostExecute = @(
@{
Name = 'postexecute'
Path = 'C:\poshbot\middleware\postexecute.ps1'
}
@{
Name = 'postexecute2'
Path = 'C:\poshbot\middleware\postexecute2.ps1'
}
)
}
Oh Ok. I will give that a try. I should mention that the configuration file was not generated by hand and this created using Save-PoshBotConfiguration
although admittedly it may have originally been created using a pre-0.11.1 version of the module.
Middleware Configurations set in a Poshbot Configuration file are not being loaded using the
Get-PoshBotConfiguration
commandExpected Behavior
Middleware Configuration should be imported and set within $config.middlewareconfiguration
Current Behavior
Any middleware configurations appear to be ignored and need to be loaded separately from the configuration file setup
Possible Solution
Steps to Reproduce (for bugs)
Context
I have added a new step in my startup script which performs the middleware configuration, but this should be enabled during initial import
Your Environment