I have an issue with the files needed for running PowerShell in relation to SharePoint online. I am using the following files to create the connection:
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Runtime\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Runtime.dll"
And this works on one PC, but not on others. Now the issue is that I know I need to set up the PC correctly first, but I cannot remember how I did this the first time around.
I tried copying the .dlls over to the new machine, but it does not work. I tried to install this: http://www.microsoft.com/en-us/download/details.aspx?id=35585, but that does not work either.
I am sure that I am running everything in Admin-mode, but it still does not work.
My guess is that it is some sort of dependencies that are missing, but I do not know which or how to identify if that is the problem.
Error:
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Program Files\Common Fi les\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll' or one of its dependencies. The sy stem cannot find the file specified." At C:\PowerShell\Builds\GrundfosFunctions.ps1:1549 char:2 + [Reflection.Assembly]::LoadFrom("$env:CommonProgramFiles\Microsoft Shared\Web S ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FileNotFoundException
And
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Program Files\Common Fi les\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll' or one of its dependencies . The system cannot find the file specified." At C:\PowerShell\Builds\GrundfosFunctions.ps1:1550 char:5 + [Reflection.Assembly]::LoadFrom("$env:CommonProgramFiles\Microsoft Shared\We ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FileNotFoundException