by

How to connect to SPOService behind company proxy

Function Connect-SPOServiceBehindProxy{
[cmdletbinding()]
param(
    [parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)][string]$AdminUPN,
    [parameter(Mandatory=$true,Position=1,ValueFromPipeline=$true)][string[]]$Organization
    )
Begin{
$cred = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred
}

Process{
$Credential = Get-Credential -UserName $AdminUPN -Message "Type the password for ($AdminUPN)."
Connect-SPOService -Url https://$Organization-admin.sharepoint.com -Credential $Credential
}
}

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps