Gmail.ps icon indicating copy to clipboard operation
Gmail.ps copied to clipboard

Import-Module : Could not load file or assembly

Open tekwreck opened this issue 9 years ago • 3 comments

Have you seen this error?

image

tekwreck avatar Jun 15 '15 15:06 tekwreck

@jaredneedell I'm getting the same error on Windows Server 2012 R2.

mwleeds avatar Oct 05 '15 21:10 mwleeds

Your screenshots are showing Install-Module not Import-Module.

Assuming that you have this module installed in Powershell modules path you should be able to run:

Import-Module gmail.ps

45413 avatar Jan 10 '16 06:01 45413

An example for using the script is, I've bolded the part that includes the referenced assembly

Import-Module ".\gmail.ps\Gmail.ps.psm1" Add-Type -Path '.\gmail.ps\AE.Net.Mail.dll'

$userName = "[YOUREMAILHERE]" $password = "[YOURPASSWORDHERE]" $nc = New-Object System.Net.NetworkCredential($userName, $password); $creds = new-object PSCredential($nc.UserName, (ConvertTo-SecureString $nc.Password -AsPlainText -Force))

Invoke-GmailSession -credential $creds -ScriptBlock { param($gmail) $msgs = $gmail | Get-Mailbox | Get-Message -unread foreach($msg in $msgs) { $msg.From $msg.Body } }

SPDEVGUY avatar May 26 '17 18:05 SPDEVGUY