Skip to content

Instantly share code, notes, and snippets.

#Variable declaration
$vCenterIPorFQDN="192.168.243.40"
$vCenterUsername="Administrator@vsphere.local"
$vCenterPassword="vmware"
$ESXiHost="192.168.243.62"
$outputFile="C:\Users\Paolo\Desktop\mycharts.html"
$stat = "mem.usage.average" #Stat to measure
#Available stats
#cpu.usage.average
##################BEGIN FUNCTIONS
function connectServer{
try {
$connect = Connect-VIServer -Server $serverTextBox.Text -User $usernameTextBox.Text -Password $passwordTextBox.Text
$buttonConnect.Enabled = $false #Disable controls once connected
#Variable declaration
$vCenterIPorFQDN="10.0.1.210"
$vCenterUsername="Administrator@vsphere.local"
$vCenterPassword="vmware"
$LocationName="Datacenter" #This could be: Datacenter Name, Cluster Name, Host Name
$ClusterName="TestCluster" #Name of the Cluster on which you need to run the report
$OutputPath="C:\" #Location where you want to place generated report
Write-Host "Connecting to vCenter" -foregroundcolor "magenta"
Connect-VIServer -Server $vCenterIPorFQDN -User $vCenterUsername -Password $vCenterPassword
@HostileCoding
HostileCoding / Invoking Scripts in Guest-VM.ps1
Last active August 29, 2015 13:57
Automate Oracle DB install using Invoke-VMScript
#Variable declaration
$vCenterIPorFQDN="10.0.1.210"
$vCenterUsername="Administrator@vsphere.local"
$vCenterPassword="vmware"
$ESXiHost="10.0.1.62"
$NumberOfVmToDeploy=2 #How many VM deploy from template
$OracleTemplate="OraTemplate"
$DestinationDatastore="datastore1"
$ESXiHostUsername="root" #ESXi Host username
$ESXiHostPassword="mypassword" #ESXi Host password