VMware Cloud Community
vlaxa
Contributor
Contributor
Jump to solution

PowerCLI on the mac OS High Sierra?

Im trying to run PowerCLI 6.5.2 on the macOS High Sierra and there is this error if i try to load module:

Import-Module VMware.PowerCLI

Import-Module : The type initializer for 'VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory' threw an exception.

At line:1 char:1

+ Import-Module VMware.PowerCLI

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [Import-Module], TypeInitializationException

    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.Commands.ImportModuleCommand

Modules are:

Get-Module VMware* -ListAvailable                                                                                                                                                                                                                                                                                                                                             Directory: /usr/local/microsoft/powershell/6.0.0-beta.7/Modules                                                                                                                                                                                                                                                                                                                                                        ModuleType Version    Name                                ExportedCommands                                                               ---------- -------    ----                                ----------------

Binary     6.5.1.5... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

Binary     6.5.1.5... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Exp...

Manifest   6.5.2.6... VMware.PowerCLI

Binary     6.5.2.6... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Binary     6.5.1.5... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Manifest   6.5.1.5... VMware.VimAutomation.Common

Binary     6.5.2.6... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost...

Binary     6.0.0.5... VMware.VimAutomation.HA             Get-DrmInfo

Binary     7.1.0.5... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Binary     6.5.1.5... VMware.VimAutomation.License        Get-LicenseDataManager

Binary     6.5.1.5... VMware.VimAutomation.PCloud         {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatace...

Manifest   1.0.0.5... VMware.VimAutomation.Sdk            {Get-PSVersion, Get-InstallPath}

Binary     6.5.1.5... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Binary     6.5.1.5... VMware.VimAutomation.Storage        {Copy-VDisk, Export-SpbmStoragePolicy, Get-NfsUser, Get-SpbmCapability...}

Script     1.0        VMware.VimAutomation.StorageUtility Update-VmfsDatastore

Binary     6.5.1.5... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup...

Binary     6.5.1.5... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Binary     6.5.1.5... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

Thank you for your help.

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Afaik only the (experimental) PowerCLI Core Fling will run on a Mac.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik only the (experimental) PowerCLI Core Fling will run on a Mac.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
vlaxa
Contributor
Contributor
Jump to solution

Thats good hint, but no success for me:

Get-Module -ListAvailable PowerCLI* | Import-Module

Import-Module : Could not load file or assembly '/Users/vlx/.local/share/powershell/Modules/PowerCLI.ViCore/VMware.VimAutomation.Vds.Types

'. The system cannot find the file specified.

At line:1 char:1

+ Get-Module -ListAvailable PowerCLI* | Import-Module

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

But files are there?

ls -lha

total 109096

drwxr-xr-x@ 90 vlx  staff   2,8K  3 říj 12:53 .

drwxr-xr-x   5 vlx  staff   160B  3 říj 12:53 ..

-rw-r--r--@  1 vlx  staff   650B 10 dub 06:40 ComponentDescriptor-VMware.VimAutomation.Vds.xml

-rw-r--r--@  1 vlx  staff   948B 10 dub 06:46 ComponentDescriptor-VMware.VimAutomation.ViCore.Cmdlets.xml

-rw-r--r--@  1 vlx  staff   525B 10 dub 06:40 ComponentDescriptor-VMware.VimAutomation.ViCore.xml

-rw-r--r--@  1 vlx  staff    32K 10 dub 06:46 ICSharpCode.SharpZipLib.Tar.dll

-rw-r--r--@  1 vlx  staff    96K 10 dub 06:46 ICSharpCode.SharpZipLib.Tar.pdb

-rw-r--r--@  1 vlx  staff   5,1K 10 dub 06:40 Initialize.ps1

-rw-r--r--@  1 vlx  staff    12M 10 zář  2016 InternalVimService50.dll

-rw-r--r--@  1 vlx  staff   238K 10 zář  2016 InventoryService55.dll

-rw-r--r--@  1 vlx  staff    19K 22 črv  2016 Microsoft.Extensions.Configuration.Abstractions.dll

-rw-r--r--@  1 vlx  staff    24K 22 črv  2016 Microsoft.Extensions.Configuration.dll

-rw-r--r--@  1 vlx  staff    27K 22 črv  2016 Microsoft.Extensions.Primitives.dll

-rw-r--r--@  1 vlx  staff   4,4K 10 dub 06:40 PowerCLI.ViCore.psd1

drwxr-xr-x@ 20 vlx  staff   640B  3 říj 12:53 Scripts

-rw-r--r--@  1 vlx  staff    91K  5 lis  2016 System.Collections.Concurrent.dll

-rw-r--r--@  1 vlx  staff    35K  5 lis  2016 System.Diagnostics.DiagnosticSource.dll

-rw-r--r--@  1 vlx  staff    32K 11 črv  2016 System.Drawing.Primitives.dll

-rw-r--r--@  1 vlx  staff    30K  5 lis  2016 System.Globalization.Extensions.dll

-rw-r--r--@  1 vlx  staff    22K  5 lis  2016 System.IO.FileSystem.Primitives.dll

-rw-r--r--@  1 vlx  staff   281K  5 lis  2016 System.Net.Http.dll

-rw-r--r--@  1 vlx  staff    70K  5 lis  2016 System.Runtime.Numerics.dll

-rw-r--r--@  1 vlx  staff    30K 11 črv  2016 System.Runtime.Serialization.Formatters.dll

-rw-r--r--@  1 vlx  staff    90K  5 lis  2016 System.Security.Cryptography.Algorithms.dll

-rw-r--r--@  1 vlx  staff    30K  5 lis  2016 System.Security.Cryptography.Cng.dll

-rw-r--r--@  1 vlx  staff    24K 10 dub 05:32 System.Security.Cryptography.Csp.dll

-rw-r--r--@  1 vlx  staff    46K  5 lis  2016 System.Security.Cryptography.Encoding.dll

-rw-r--r--@  1 vlx  staff    44K  5 lis  2016 System.Security.Cryptography.Primitives.dll

-rw-r--r--@  1 vlx  staff   160K  5 lis  2016 System.Security.Cryptography.X509Certificates.dll

-rw-r--r--@  1 vlx  staff    49K  5 lis  2016 System.Threading.dll

-rw-r--r--@  1 vlx  staff    43K 10 dub 06:46 VMware.AspNet.WebApi.Client.dll

-rw-r--r--@  1 vlx  staff    78K 10 dub 06:46 VMware.AspNet.WebApi.Client.pdb

-rw-r--r--@  1 vlx  staff    39K 10 dub 06:46 VMware.Binding.Ls2.dll

-rw-r--r--@  1 vlx  staff    98K 10 dub 06:46 VMware.Binding.Ls2.pdb

-rw-r--r--@  1 vlx  staff    13K 10 dub 06:46 VMware.Binding.Wcf.dll

-rw-r--r--@  1 vlx  staff    30K 10 dub 06:46 VMware.Binding.Wcf.pdb

-rw-r--r--@  1 vlx  staff   3,0M  6 říj  2016 VMware.System.Private.ServiceModel.dll

-rw-r--r--@  1 vlx  staff   1,5M 10 dub 06:46 VMware.Vim.dll

-rw-r--r--@  1 vlx  staff   5,3M 10 dub 06:46 VMware.Vim.pdb

-rw-r--r--@  1 vlx  staff    14K 10 dub 06:46 VMware.VimAutomation.Ceip.dll

-rw-r--r--@  1 vlx  staff    24K 10 dub 06:46 VMware.VimAutomation.Ceip.pdb

-rw-r--r--@  1 vlx  staff    74K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Impl.dll

-rw-r--r--@  1 vlx  staff   148K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Impl.pdb

-rw-r--r--@  1 vlx  staff   8,0K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Interop.dll

-rw-r--r--@  1 vlx  staff    12K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Interop.pdb

-rw-r--r--@  1 vlx  staff   8,0K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Types.dll

-rw-r--r--@  1 vlx  staff    30K 10 dub 06:46 VMware.VimAutomation.Cis.Core.Types.pdb

-rw-r--r--@  1 vlx  staff   5,5K 10 dub 06:46 VMware.VimAutomation.Common.Interop.dll

-rw-r--r--@  1 vlx  staff   7,5K 10 dub 06:46 VMware.VimAutomation.Common.Interop.pdb

-rw-r--r--@  1 vlx  staff   5,0K 10 dub 06:46 VMware.VimAutomation.Common.Types.dll

-rw-r--r--@  1 vlx  staff    12K 10 dub 06:46 VMware.VimAutomation.Common.Types.pdb

-rw-r--r--@  1 vlx  staff    39K 10 dub 06:46 VMware.VimAutomation.Common.Util10.dll

-rw-r--r--@  1 vlx  staff    86K 10 dub 06:46 VMware.VimAutomation.Common.Util10.pdb

-rw-r--r--@  1 vlx  staff    16K 10 dub 06:46 VMware.VimAutomation.Common.Util10Ps.dll

-rw-r--r--@  1 vlx  staff    26K 10 dub 06:46 VMware.VimAutomation.Common.Util10Ps.pdb

-rw-r--r--@  1 vlx  staff   227K 10 dub 06:40 VMware.VimAutomation.Format.ps1xml

-rw-r--r--@  1 vlx  staff    38K 10 dub 06:46 VMware.VimAutomation.Sdk.Impl.dll

-rw-r--r--@  1 vlx  staff    88K 10 dub 06:46 VMware.VimAutomation.Sdk.Impl.pdb

-rw-r--r--@  1 vlx  staff    15K 10 dub 06:46 VMware.VimAutomation.Sdk.Interop.dll

-rw-r--r--@  1 vlx  staff    18K 10 dub 06:46 VMware.VimAutomation.Sdk.Interop.pdb

-rw-r--r--@  1 vlx  staff    15K 10 dub 06:46 VMware.VimAutomation.Sdk.Types.dll

-rw-r--r--@  1 vlx  staff    42K 10 dub 06:46 VMware.VimAutomation.Sdk.Types.pdb

-rw-r--r--@  1 vlx  staff    52K 10 dub 06:46 VMware.VimAutomation.Sdk.Util10.dll

-rw-r--r--@  1 vlx  staff   142K 10 dub 06:46 VMware.VimAutomation.Sdk.Util10.pdb

-rw-r--r--@  1 vlx  staff    66K 10 dub 06:46 VMware.VimAutomation.Sdk.Util10Ps.dll

-rw-r--r--@  1 vlx  staff   180K 10 dub 06:46 VMware.VimAutomation.Sdk.Util10Ps.pdb

-rw-r--r--@  1 vlx  staff   193K 10 dub 06:46 VMware.VimAutomation.Vds.Impl.dll

-rw-r--r--@  1 vlx  staff   402K 10 dub 06:46 VMware.VimAutomation.Vds.Impl.pdb

-rw-r--r--@  1 vlx  staff    16K 10 dub 06:46 VMware.VimAutomation.Vds.Interop.dll

-rw-r--r--@  1 vlx  staff    12K 10 dub 06:46 VMware.VimAutomation.Vds.Interop.pdb

-rw-r--r--@  1 vlx  staff    21K 10 dub 06:46 VMware.VimAutomation.Vds.Types.dll

-rw-r--r--@  1 vlx  staff    48K 10 dub 06:46 VMware.VimAutomation.Vds.Types.pdb

-rw-r--r--@  1 vlx  staff   1,1M 10 dub 06:46 VMware.VimAutomation.ViCore.Cmdlets.dll

-rw-r--r--@  1 vlx  staff   3,6M 10 dub 06:40 VMware.VimAutomation.ViCore.Cmdlets.dll-Help.xml

-rw-r--r--@  1 vlx  staff   2,8M 10 dub 06:46 VMware.VimAutomation.ViCore.Cmdlets.pdb

-rw-r--r--@  1 vlx  staff   1,7M 10 dub 06:46 VMware.VimAutomation.ViCore.Impl.dll

-rw-r--r--@  1 vlx  staff   3,0M 10 dub 06:46 VMware.VimAutomation.ViCore.Impl.pdb

-rw-r--r--@  1 vlx  staff    92K 10 dub 06:46 VMware.VimAutomation.ViCore.Interop.dll

-rw-r--r--@  1 vlx  staff    40K 10 dub 06:46 VMware.VimAutomation.ViCore.Interop.pdb

-rw-r--r--@  1 vlx  staff   253K 10 dub 06:46 VMware.VimAutomation.ViCore.Types.dll

-rw-r--r--@  1 vlx  staff   936K 10 dub 06:46 VMware.VimAutomation.ViCore.Types.pdb

-rw-r--r--@  1 vlx  staff   111K 10 dub 06:46 VMware.VimAutomation.ViCore.Util10.dll

-rw-r--r--@  1 vlx  staff   330K 10 dub 06:46 VMware.VimAutomation.ViCore.Util10.pdb

-rw-r--r--@  1 vlx  staff    66K 10 dub 06:46 VMware.VimAutomation.ViCore.Util10Ps.dll

-rw-r--r--@  1 vlx  staff   134K 10 dub 06:46 VMware.VimAutomation.ViCore.Util10Ps.pdb

-rw-r--r--@  1 vlx  staff    12M 17 říj  2016 VimService.dll

-rw-r--r--@  1 vlx  staff   212K 27 zář  2016 log4net.dll

-rw-r--r--@  1 vlx  staff    23K  6 říj  2016 phclient.dll

-rw-r--r--@  1 vlx  staff   705K 21 bře  2017 vmware.vapi.client.bindings.dll

-rw-r--r--@  1 vlx  staff   291K 17 bře  2017 vmware.vapi.dll

Reply
0 Kudos
vlaxa
Contributor
Contributor
Jump to solution

So, it is working now, thanks to:

PowerCLI Core - Bugs

PowerShell beta is not supported ant Alfa version needs to be installed for the PowerCLI Core

Release v6.0.0-alpha.18 release of PowerShellCore · PowerShell/PowerShell · GitHub

Thanks LucD for the "Core" hint.

Reply
0 Kudos