PowerCLI: PowerShell 환경 설정 및 스크립트 실행 절차
1. Windows PowerShell ISE 실행 (관리자로 실행)

2. VMWare Powershell 설치 (Nuget) (최초 수행)
1) "Install-Module -Name VMware.PowerCLI -Scope CurrentUser" 명령어 실행

2) "Set-ExecutionPolicy Unrestricted" 명령어 실행

PowerCLI 모듈 및 스크립트 사용을 위해 서명되지 않은 PowerShell 스크립트에 대한 호출 제약을 해제 함.
조회 명령: Get-ExecutionPolicy
3) "Import-Module VMware.PowerCLI" 명령어를 실행

PowerCLI 모듈 사용 준비 완료
폐쇄망에서의 VMware.PowerCLI Import https://kkangi.tistory.com/3 |
3. vCenter 연결
4) "Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false" 명령어를 실행

vCenter와 접속 시 SSL 경고를 무시하도록 함
5) "Connect-VIServer [vCenter서버IP주소]" 명령어를 실행 (실행 후 화면)

사용자 이름 및 암호 입력
혹은, “Connect-VIServer -Server [vCenter_IP] -User [USERNAME] -Password [PASSWORD]”
vCenter에 올바르게 접속 됨을 확인

1. Script 실행
1) 스크립트 파일 위치의 폴더로 이동 (cd 혹은 Set-ChildItem 명령 사용 가능)
Ex) cd c:\ps

실행하고자 하는 스크립트 구동
> ./***.ps1