Here is my code:
Class Tracker : WebObject {
$url
$username
$password
[Microsoft.SharePoint.Client.ClientContext] Context() {
$context = New-Object Microsoft.SharePoint.Client.ClientContext($this.url)
return $context
}
Tracker ([string]$url,[string]$username,[string]$password) {
$this.url = $url
$this.username = $username
$this.password = $password
}
I have added the require dlls at the top of the script:
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
However, when I run it I receive the following error:
Unable to find type [Microsoft.SharePoint.Client.ClientContext].
Any thoughts on what's going wrong?