Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Import-Module : Could not load file or assembly #11

Open
tekwreck opened this issue Jun 15, 2015 · 3 comments
Open

Import-Module : Could not load file or assembly #11

tekwreck opened this issue Jun 15, 2015 · 3 comments

Comments

@tekwreck
Copy link

Have you seen this error?

image

@mwleeds
Copy link

mwleeds commented Oct 5, 2015

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

@45413
Copy link

45413 commented Jan 10, 2016

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

@SPDEVGUY
Copy link

SPDEVGUY commented May 26, 2017

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
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants