This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "Disconnecting The ISO From "$VM.Parent.Name"" | |
Get-CDDrive -VM $VM.Parent.Name | Set-CDDrive -NoMedia -Confirm:$false > $null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VM | Get-CDDrive | where {$_.IsoPath -ne $null} | Set-CDDrive -NoMedia -Confirm:$False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Deploy-VM { | |
Param ( | |
[parameter (Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
$VMNames | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Deploy-VM { | |
[CmdletBinding()] | |
Param ( | |
[parameter (Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
$VMNames | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Deploy-VM { | |
[CmdletBinding()] | |
Param ( | |
[parameter (Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
$VMNames | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Deploy-VM { | |
[CmdletBinding()] | |
Param ( | |
[parameter (Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
$VMNames | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################# | |
# Define variables to "Create all VMs specified in $NewVms" # | |
############################################################# | |
Write-Host "Enter The FQDN Of The ESXi Server That Will Host The Guest VM: " -ForegroundColor Yellow -NoNewline | |
$ESXiHost = Read-Host | |
#Needed To Create An Array From The Comma Separated List Stored In "$NewVMs" | |
Write-Host "Enter The Name Of The New Guest VM " -ForegroundColor Yellow -NoNewline | |
Write-Host "(Enter Multiples As A Comma Separated List)" -ForegroundColor Green -NoNewline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################### | |
# Load VMware PowerCLI Module # | |
############################### | |
. 'C:\Program Files\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1' | |
cls | |
########################################### | |
# Define variables to "Connect To Server" # | |
########################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################### | |
# Display VM Build Status # | |
########################### | |
$RunningTasks = $TaskTable.Count | |
while($RunningTasks -gt 0){ | |
Get-Task | foreach { | |
if($TaskTable.ContainsKey($_.Id) -and $_.State -eq "Success"){ | |
Write-Host " VM " -ForegroundColor Green -NoNewline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# Disconnect From Server # | |
########################## | |
Write-Host "" | |
Write-Host "Closing Connection To Server: " -ForegroundColor Green -NoNewline | |
Write-Host "$ServerInstance " -ForegroundColor Cyan | |
Disconnect-VIServer -Server $ServerInstance -Force -Confirm:$false | |
Write-Host "" | |
Write-Host "" |