Mac / Docker / VMWare PowerCLI:
- Install Docker for Mac: https://store.docker.com/editions/community/docker-ce-desktop-mac
- Install Docker to your Applications folder
- Launch Docker
- Test with "$ docker version" or "$ docker ps" from your terminal app
- Create a local folder for your own powercli scripts
- Mine is: "/Users/nathan/scripts/PS/VMW/"
- Edit or create a ".bashrc" file in your home directory with the following two aliases.
- alias powercli-start='docker run --name PowerCLI --detach -it --rm --volume '/Users/nathan/scripts/PS/VMW/':/usr/scripts vmware/powerclicore:latest'
- alias powercli='docker attach PowerCLI'
- Relaunch your terminal (aliases won't take effect until .bashrc is referenced)
- Run the following command to start the PowerCLI docker
- $ powercli-start
- Run the following to attach to the PowerCLI docker image
- $ powercli
- You may have to hit "return" a few times to see the PS prompt.
- Upon exiting the powershell terminal the docker is terminated.
Now to figure out
what to do with PowerCLI.This is new to me.
If you want to throw
it away run:
$ docker rmi vmware/powerclicore
Thanks
to railroadmanuk for help with attaching to the
local scripts folder: https://virtualbrakeman.wordpress.com/2017/03/15/powercli-core-on-docker-with-macos/
Comments
Post a Comment