For complicated certificate/remoting reasons, we cannot use the PSSnapin Microsoft.SharePoint.PowerShell. I found a tutorial using CSOM objects, see example code:
Import-Module "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
$site = "https://contoso.sharepoint.com"
$context = New-Object Microsoft.SharePoint.Client.ClientContext($site)
Is there a way to get useful farm or site information using this approach? Similar to Get-SPFarm
or Get-SPSite
. This is on-premises SharePoint.