Write-EVBEvent: Cannot find type [PutEventsRequestEntry]
See original GitHub issueDescribe the bug
Full error:
New-Object : Cannot find type [PutEventsRequestEntry]: verify that the assembly containing this type is loaded
PowerShell version: 5.1.19041.1682
Expected Behavior
Attempt to send the $entry in $events.
Current Behavior
Fails to send, citing the Type for $entry does not exist on the system.
Reproduction Steps
Sometimes the code works, sometimes it doesn’t. I haven’t been able to isolate what the root cause is though. Assuming it is something to do with the installation and underlying system changes.
Installation steps:
Install-Module -Name AWS.Tools.EventBridge
OR
Install-Module -Name AWS.Tools.Installer
Install-AWSToolsModule -Name EventBridge -CleanUp
Code:
$entry = New-Object -Type Amazon.EventBridge.Model.PutEventsRequestEntry
$entry.Detail = $detailObject
$entry.Source = "inbound"
$entry.DetailType = "record sent"
$entry.Time = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"
Write-EVBEvent -ProfileName $awsProfile -Region $region -Entry $events -Select "*"
Possible Solution
No response
Additional Information/Context
No response
AWS Tools for PowerShell version used
# Machine 1:
4.1.97 AWS.Tools.Common 4.1.97 AWS.Tools.EventBridge 1.0.2.4 AWS.Tools.Installer
# Machine 2:
4.1.111 AWS.Tools.Common
4.1.111 AWS.Tools.EventBridge
PowerShell version used
# Machine 1:
Name Value PSVersion 5.1.19041.1682 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.19041.1682 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
# Machine 2 (AWS WorkSpaces)
Name Value
PSVersion 5.1.14393.5127
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
BuildVersion 10.0.14393.5127
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Operating System and version
Windows 10
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
@comfytoday Looks like module is not auto-loaded by the PowerShell session. Please execute
Import-Module AWS.Tools.EventBridgeprior to executing above script and it works.Thanks, Ashish
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.