Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Powershell将企业资源添加到Project Online。运气不佳_Powershell_Csom - Fatal编程技术网

如何使用Powershell将企业资源添加到Project Online。运气不佳

如何使用Powershell将企业资源添加到Project Online。运气不佳,powershell,csom,Powershell,Csom,添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsoft.ProjectServer.Client.dll” 添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsoft.SharePoint.Client.Runtime.dll” 添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsof

添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsoft.ProjectServer.Client.dll” 添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsoft.SharePoint.Client.Runtime.dll” 添加类型-路径“C:\Users\klkc510\Downloads\DeleteResources\bin\Microsoft.SharePoint.Client.dll”

$pwaPath=“” $projContext=新对象Microsoft.ProjectServer.Client.ProjectContext($pwapath) $UserName=“” $Password=“”

$credentials=新对象Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,(ConvertTo SecureString$Password-AsPlainText-Force))
$projContext.Credentials=$Credentials

$projContext.Load($projContext.EnterpriseResources)
$projContext.ExecuteQuery()  
$erp = $projContext.EnterpriseResources
$enterprise_resourceid = [Guid]::NewGuid()
$resname = "Test"
$body = {parameters:{'Id:$enterprise_resourceid"",Name:$resname}}
$erp.Add.$body
Write-Host("Deleted Resource: " +  $body.Id)
$erp.Update()
$projContext.ExecuteQuery()
$projContext.Load($projContext.EnterpriseResources)