ここでの目標は、このPowerShellコードで始まるWeb.Foldersプロパティにアクセスすることです。SharePoint CSOM PowerShellでWeb.Foldersプロパティが返されない
Connect-SPOnline –Url https://mysite.sharepoint.com;
$web = Get-SPOWeb;
$web | Get-Member | sort name
そのリストから、私はそのようなものとして、以下の
Definition:
----------
Microsoft.SharePoint.Client.FolderCollection,
Microsoft.SharePoint.Client,
Version=16.1.0.0,
Culture=neutral,
PublicKeyToken=71e9bce111e9429c Folders {get;}
を持っている「フォルダ」のプロパティを見ることができるメンバーは、私は次のコードを使用して、フォルダProperyを盗んすることができshould'nt?
$ctx = Get-SPOContext;
$folders = $web.Folders;
$ctx.Load($folders);
$ctx.ExecuteQuery();
$folders;
は、次のメッセージを返します。
format-default : The collection has not been initialized. It has not been requested or the request has not been
executed. It may need to be explicitly requested.
+ CategoryInfo : NotSpecified: (:) [format-default], CollectionNotInitializedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.CollectionNotInitializedException,Microsoft.PowerShell.Comma
nds.FormatDefaultCommand