vcptobe
Enthusiast
Enthusiast

Issue installing Powercli through powershell

Got this working on my own windows 10 laptop

Having issues getting it working onsite, they use a proxy

So i used the old msi (build VMware-PowerCLI-6.5.0-4624819) and that worked until today

I now get the error message

. : File C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1 cannot be

loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy.

At line:1 char:3

+ . "C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Init ...

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

    + CategoryInfo          : SecurityError: (:) [], PSSecurityException

    + FullyQualifiedErrorId : UnauthorizedAccess

Tried below link and changed it to unrestricted and its still the same

PowerCLI: “Initialize-PowerCLIEnvironment.ps1 cannot be loaded because the execution of scripts is d...

Any ideas on how best to get this working again? I think they may have created a policy so its not in use here but wanted to do my own checking first

0 Kudos
2 Replies
daphnissov
Immortal
Immortal

It looks like a GPO issue which is being enforced and then inherited by this machine. You'd need to check with the AD admin to see what is being linked here.

0 Kudos
MohammadrezaGha
Contributor
Contributor

Hi,

Please make sure the powershell Execution Policy has been set properly on your system (Set-ExecutionPolicy ), Also please note that there are 2 versions of powershell on system (32 and 64bit) and each has it's own Execution policy. You can check the current policy with Get-Executionpolicy command in powershell.

0 Kudos