# 載入 VMware PowerCLI
Add-PSSnapin VMware*
# 載入 Microsoft SCVMM 模組並加前綴避免衝突
Import-Module -Name VirtualMachineManager -Prefix MS
# 透過 Remoting 使用遠端伺服器的模組
$VWsession = New-PSSession -ComputerName "VMware-vCenter"
Invoke-Command -Session $VWsession -ScriptBlock { Add-PSSnapin VMware* }
Import-PSSession -Session $VWsession -Module VMware* -Prefix VW
$CXSession = New-PSSession -ComputerName "Citrix-DDC"
Invoke-Command -Session $CXSession -ScriptBlock { Add-PSSnapin Citrix* }
Import-PSSession -Session $CXSession -Module Citrix* -Prefix CX
$MSsession = New-PSSession -ComputerName "SCVMM-Server"
Invoke-Command -Session $MSsession -ScriptBlock { Import-Module VirtualMachineManager }
Import-PSSession -Session $MSsession -Module VirtualMachineManager -Prefix MS
PowerShell 需具備基本腳本與 .NET 物件概念。建議資源:
異構虛擬化環境已成常態,PowerShell 以原生跨平台模組、強大自動化與遠端管理能力,成為 IT 專業人員掌控大規模資料中心的最佳槓桿。