dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.69k stars 800 forks source link

Play Nice with VMWare PowerCLI 6.5 #465

Closed admoseley closed 7 years ago

admoseley commented 7 years ago

System Details

Issue Description

I am experiencing a problem with... Running Posh-git with VMWare PowerCLI6.5 I would like to autostart both of these modules as I update scripts that work with vSphere. However, everytime i initialize the PowerCLI modules, it wipes the Posh-Git Prompt.

Before with posh-git loaded: C:\Users\username\dev\script [master ≡]>

After I initialize PowerCLI i've tried

.'C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1' Gives me: PowerCLI C:> and Import-module vmware.vimautomation.core Gives me: C:>

This also occurs if i reverse the order and Load PowerCLI first and Posh-git second.

dahlbyk commented 7 years ago

Try importing posh-git, after VMWare PowerCLI, with module arguments (specifically, the second should force setting prompt):

Import-Module C:\tools\poshgit\dahlbyk-posh-git-a4faccd\src\posh-git.psd1 -ArgumentList $true,$true
admoseley commented 7 years ago

works perfectly. thanks!