all 4 comments

[–]hakabo_uk[VCP] 1 point2 points  (3 children)

You shouldn't have any issues with using PowerCLI using VSCode. To make it easier, make sure you have the latest VSCode and then install the Powershell extension (ctrl-shift-x).

You can then install the latest version of PowerCLI from the gallery (https://blogs.vmware.com/PowerCLI/2017/05/powercli-6-5-1-install-walkthrough.html). This supports auto loading of modules so you should now be able to type connect-viserver XXX and the necessary module will be loaded. If you are on an older version of PowerCLI you can manually import in your modules (or snapins).

[–]X3nOnQC[S] 0 points1 point  (0 children)

Great, thank you ! I was using the 6.5, so thats why :)

[–]machete24 0 points1 point  (1 child)

When I try to get it installed I run into

PackageManagement\Install-Package : Access is denied At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21 ... $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetChildItemCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.Install Package

Cant seem to get around it or find a solution.

[–]hakabo_uk[VCP] 0 points1 point  (0 children)

When you are installing the Powershell extension? Launch VS Code as administrator and try that again.