Merge pull request #304 from seanpmassey/master

Update VMware.VMC.psm1
This commit is contained in:
Kyle Ruddy
2019-09-15 06:31:42 -04:00
committed by GitHub

View File

@@ -33,8 +33,8 @@ Function Connect-VMCVIServer {
Organization: VMware Organization: VMware
Blog: http://vmware.com/go/powercli Blog: http://vmware.com/go/powercli
Twitter: @powercli Twitter: @powercli
=========================================================================== ===========================================================================
.SYNOPSIS .SYNOPSIS
Cmdlet to connect to your VMC vCenter Server Cmdlet to connect to your VMC vCenter Server
.DESCRIPTION .DESCRIPTION
@@ -47,17 +47,25 @@ Function Connect-VMCVIServer {
Param ( Param (
[Parameter(Mandatory=$true)]$Org, [Parameter(Mandatory=$true)]$Org,
[Parameter(Mandatory=$true)]$Sddc, [Parameter(Mandatory=$true)]$Sddc,
[switch]$Autologin [switch]$Autologin,
[switch]$UseManagementIP
) )
If (-Not $global:DefaultVMCServers) { Write-error "No VMC Connection found, please use the Connect-VMC to connect" } Else { If (-Not $global:DefaultVMCServers) { Write-error "No VMC Connection found, please use the Connect-VMC to connect" } Else {
$creds = Get-VMCSDDCDefaultCredential -Org $Org -Sddc $Sddc $creds = Get-VMCSDDCDefaultCredential -Org $Org -Sddc $Sddc
Write-Host "Connecting to VMC vCenter Server" $creds.vc_public_ip If($UseManagementIP){
Connect-VIServer -Server $creds.vc_public_ip -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC" $Server = $creds.vc_management_ip
Write-Host "Connecting to VMC CIS Endpoint" $creds.vc_public_ip }Else{
Connect-CisServer -Server $creds.vc_public_ip -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC" $Server = $creds.vc_public_ip
}
Write-Host "Connecting to VMC vCenter Server" $Server
Connect-VIServer -Server $Server -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
Write-Host "Connecting to VMC CIS Endpoint" $Server
Connect-CisServer -Server $Server -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
} }
} }
Function Get-VMCOrg { Function Get-VMCOrg {
<# <#
.NOTES .NOTES