update
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<#
|
||||
.Synopsis
|
||||
Connects to ITD's vCenter servers
|
||||
.DESCRIPTION
|
||||
Connects to ITD's vCenter servers
|
||||
.EXAMPLE
|
||||
Connect-ITDvCenter -Credential $PSCredential
|
||||
#>
|
||||
function Connect-ITDvCenter {
|
||||
[CmdletBinding()]
|
||||
Param
|
||||
(
|
||||
[PSCredential]
|
||||
$Credential
|
||||
)
|
||||
|
||||
Begin {
|
||||
Import-Module VMware.VimAutomation.Core
|
||||
$VIServers = "itdvmvc1.nd.gov", "itdvmvc2.nd.gov"
|
||||
}
|
||||
Process {
|
||||
If ($Global:DefaultVIServers) {
|
||||
Write-Verbose "VIServers already connected"
|
||||
}
|
||||
Else {
|
||||
If ($Credential) {
|
||||
Connect-VIServer -Server $VIServers -Credential $Credential | Out-Null
|
||||
}
|
||||
Else {
|
||||
Connect-VIServer -Server $VIServers | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
End {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user