Update VMware.VMC.psm1

This commit is contained in:
seanpmassey
2019-08-07 15:27:37 -05:00
parent 2c79a86531
commit 0ba0b870af

View File

@@ -25,46 +25,47 @@ Function Get-VMCCommand {
} }
Function Connect-VMCVIServer { Function Connect-VMCVIServer {
<# <#
.NOTES .NOTES
=========================================================================== ===========================================================================
Created by: VMware Created by: VMware
Date: 11/17/2017 Date: 11/17/2017
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
This will connect you to both the VMC ViServer as well as the CiSServer at the same time. This will connect you to both the VMC ViServer as well as the CiSServer at the same time.
.EXAMPLE .EXAMPLE
Connect-VMCVIServer -Server <VMC vCenter address> -User <Username> -Password <Password> Connect-VMCVIServer -Server <VMC vCenter address> -User <Username> -Password <Password>
.NOTES .NOTES
Easiest way is to pipe through your credentials from Get-VMCSDDCDefaultCredential Easiest way is to pipe through your credentials from Get-VMCSDDCDefaultCredential
#> #>
Param ( Param (
[Parameter(Mandatory=$true)]$Org, [Parameter(Mandatory=$true)]$Org,
[Parameter(Mandatory=$true)]$Sddc, [Parameter(Mandatory=$true)]$Sddc,
[switch]$Autologin, [switch]$Autologin,
[switch]$UseManagementIP [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
If($UseManagementIP){ If($UseManagementIP){
$Server = $creds.vc_management_ip $Server = $creds.vc_management_ip
}Else{ }Else{
$Server = $creds.vc_public_ip $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"
} }
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