question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Write-EVBEvent: Cannot find type [PutEventsRequestEntry]

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ashishdhingracommented, Jun 27, 2022

@ashishdhingra I switched over to PS 7, and the same problem persists.

Uninstalled all traces of AWS.Tools modules, reinstalled using both options. No change.

Cannot find type [PutEventsRequestEntry]: verify that the assembly containing this type is loaded.

Name Value PSVersion 7.2.4 PSEdition Core GitCommitId 7.2.4 OS Microsoft Windows 10.0.14393 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

@comfytoday Looks like module is not auto-loaded by the PowerShell session. Please execute Import-Module AWS.Tools.EventBridge prior to executing above script and it works.

Thanks, Ashish

0reactions
github-actions[bot]commented, Jul 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS PowerShell EventBridge assembly model not found
New-Object : Cannot find type [PutEventsRequestEntry]: verify that the assembly containing this type is loaded.
Read more >
Write-EVBEvent Cmdlet | AWS Tools for PowerShell
Calls the Amazon EventBridge PutEvents API operation. Syntax. Write-EVBEvent. -Entry <PutEventsRequestEntry[]>.
Read more >
How to use Write-EVBEvent cmdlet? · Issue #110
I'm attempting to publish a custom event into the new EventBridge service using the Write-EVBEvent cmdlet. However, there's are no examples ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found