{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/58","labels_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/58/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/58/events","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/58","id":105746530,"number":58,"title":"Error on New-SPOWeb","user":{"login":"maerger","id":6177363,"avatar_url":"https://avatars.githubusercontent.com/u/6177363?v=3","gravatar_id":"","url":"https://api.github.com/users/maerger","html_url":"https://github.com/maerger","followers_url":"https://api.github.com/users/maerger/followers","following_url":"https://api.github.com/users/maerger/following{/other_user}","gists_url":"https://api.github.com/users/maerger/gists{/gist_id}","starred_url":"https://api.github.com/users/maerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maerger/subscriptions","organizations_url":"https://api.github.com/users/maerger/orgs","repos_url":"https://api.github.com/users/maerger/repos","events_url":"https://api.github.com/users/maerger/events{/privacy}","received_events_url":"https://api.github.com/users/maerger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-10T07:27:15Z","updated_at":"2015-09-10T08:36:06Z","closed_at":null,"body":"Hi,\r\n\r\nI tried to use New-SPOWeb. The subsite is created but unfortunately the script breaks with an error message:\r\nformat-default : The collection has not been initialized. It has not been requested or the request has not been\r\nexecuted. It may need to be explicitly requested.\r\n    + CategoryInfo          : NotSpecified: (:) [format-default], CollectionNotInitializedException\r\n    + FullyQualifiedErrorId : Microsoft.SharePoint.Client.CollectionNotInitializedException,Microsoft.PowerShell.Comma\r\n   nds.FormatDefaultCommand\r\n\r\nI tried to catch this exception with no luck. What can I do?\r\n\r\nThanks\r\nRoman"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/comments/139168170","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/58#issuecomment-139168170","issue_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/58","id":139168170,"user":{"login":"erwinvanhunen","id":7666381,"avatar_url":"https://avatars.githubusercontent.com/u/7666381?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinvanhunen","html_url":"https://github.com/erwinvanhunen","followers_url":"https://api.github.com/users/erwinvanhunen/followers","following_url":"https://api.github.com/users/erwinvanhunen/following{/other_user}","gists_url":"https://api.github.com/users/erwinvanhunen/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinvanhunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinvanhunen/subscriptions","organizations_url":"https://api.github.com/users/erwinvanhunen/orgs","repos_url":"https://api.github.com/users/erwinvanhunen/repos","events_url":"https://api.github.com/users/erwinvanhunen/events{/privacy}","received_events_url":"https://api.github.com/users/erwinvanhunen/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T08:36:06Z","updated_at":"2015-09-10T08:36:06Z","body":"Hi Roman,\r\n\r\nPlease include the code of your script straight after the New-SPOWeb cmdlet. I assume you're doing something like\r\n\r\n$web = new-spoweb <various parameters>\r\n\r\nand then you use the $web object?\r\n\r\nBecause it's using CSOM, not all properties of the web object are loaded by default ,e.g. you might have to request them specifically\r\n\r\nfor instance:\r\n\r\n$ctx = Get-SPOContext\r\n$list = web.Lists.GetByTitle(\"Test\")\r\n$ctx.Load($list)\r\n$ctx.ExecuteQuery()\r\n\r\n\r\n"}}