Gmail.ps
Gmail.ps copied to clipboard
Import-Module : Could not load file or assembly
Have you seen this error?
@jaredneedell I'm getting the same error on Windows Server 2012 R2.
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
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 } }