rgel / PowerCLi

VMware PowerCLI scripts and modules

Home Page:https://ps1code.com/category/vmware-powercli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when importing module

lorriEDw opened this issue · comments

I am using VMware vSphere PowerCLI6.0 Release 3 and copied the Vi-Module to the modules folder
ProgramFiles(x86)/VMware/Infrastructure/vSpherePowerCLI/Modules
when I run the Import-Module Vi-Module -Force -Verbose I get the attached errors - should this work with powercli? or am I missing something?
Thanks

screen shot 2017-10-17 at 2 11 37 pm

commented

Duplicate Issue. Using PS Version 5.1, also removed Vi-Sdrs.ps1 script. Does not seem to matter, seems there is a valid error in the Expand-VMGuestPartition Function.

vi-moduleerror

It seems you had Copy-Pasted the RAW file from Github, try Clone or download button from the main PowerCLi repo page.

commented

The download was taken from the main PowerCLi page. But you gave me another idea to copy-paste from the RAW file from Github. That worked, the code is error free. Thanks.

without Vi-Sdrs.ps1
powershell_2017-12-20_11-32-42

If I had Copy-Pasted the RAW file from Github import module had been done.

This is known issue, sometimes files would be damaged while downloading from the GitHub :-(
There are two download methods: copy-paste raw files or download a whole repository zip file
image 007
image 008
The reason is your enterprise proxy or antivirus software.
Try to use different download method or download outside your organization.

I found that in Vi-Module.psm1 there was a ANSI character – that is displayed as - in UTF-8 encoding in 3 places. Once I replaced – with - it worked as expected.