Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active January 6, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/fbd74693085a4e98991c to your computer and use it in GitHub Desktop.
Save techthoughts2/fbd74693085a4e98991c to your computer and use it in GitHub Desktop.
User Choices
#will we disable NICs in the team to determine if each NIC connection is good?
while("yes","no" -notcontains $Script:nicCheckSetting){
$Script:nicCheckSetting = Read-Host "Would you like to run the NIC Team connectivty check to check each NIC in the team? (yes/no)"
}
#for standalone Hyps - which drive will the VMs be stored on?
while("c:","d:","e:","f:","g:","h:","i:","j:","k:","l:","m:","n:","o:","p:","q:","r:","s:","t:","u:","v:","w:","x:","y:","z:" -notcontains $Script:vmVHDLocation){
$Script:vmVHDLocation = Read-Host "What drive letter will the VMs and VHDs be stored? (Ex. D: or S:)"
}
if ([System.Windows.Forms.MessageBox]::Show("Is this device part of a Highly Available Cluster?", "HA or NA?", [System.Windows.Forms.MessageBoxButtons]::YesNo) -eq "Yes") {
$highlyAvailable = $true
}
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$device = [Microsoft.VisualBasic.Interaction]::InputBox("Provide server CORE ID", "Core ID:", "0000000")
#prompt user for the server#
while ($device -notmatch '^\d{6}$') {
$device = Read-Host "Provide server CORE ID"
}
#ask user if this server is part of a HA cluster or not
while ("Y", "N", "y", "n" -notcontains $ha) {
$ha = Read-Host "Is this device part of a Highly Available Cluster? (Y/N)"
}
if ($ha -eq "Y" -or $ha -eq "y") {
$highlyAvailable = $true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment