I have the following code :
$vcenterServer = "192.168.119.22"
$vcenterUsername = "user"
$vcenterPassword = "passwd"
$dataCeneterName = "dc"
$dsName = "datastore1"
$esxName = "192.168.119.1"
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false #discarding SSL connection
$vcenterInstance = Connect-VIServer -Server $vcenterServer -User $vcenterUsername -Password $vcenterPassword
But I get the following errror:
$vcenterInstance = Connect-VIServer -Server $vcenterServer -User $vcenterUsername -Password $vcenterPassword
Connect-VIServer: 4/11/2022 5:50:57 PM Connect-VIServer The SSL connection could not be established, see inner exception.
How can I solve it?
By the way, my pwsh is 7.2.1