{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/67","labels_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/67/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/67/events","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/67","id":107004114,"number":67,"title":"Export-SPOTaxonomy  and Debugging PNP PowerShell","user":{"login":"PieterVeenstra","id":13237009,"avatar_url":"https://avatars.githubusercontent.com/u/13237009?v=3","gravatar_id":"","url":"https://api.github.com/users/PieterVeenstra","html_url":"https://github.com/PieterVeenstra","followers_url":"https://api.github.com/users/PieterVeenstra/followers","following_url":"https://api.github.com/users/PieterVeenstra/following{/other_user}","gists_url":"https://api.github.com/users/PieterVeenstra/gists{/gist_id}","starred_url":"https://api.github.com/users/PieterVeenstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PieterVeenstra/subscriptions","organizations_url":"https://api.github.com/users/PieterVeenstra/orgs","repos_url":"https://api.github.com/users/PieterVeenstra/repos","events_url":"https://api.github.com/users/PieterVeenstra/events{/privacy}","received_events_url":"https://api.github.com/users/PieterVeenstra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-17T14:58:12Z","updated_at":"2015-09-17T17:01:20Z","closed_at":null,"body":"I have been trying to make the export taxonomy work for me using the following:\r\n\r\nConnect-SPOnline -Url https://mydemo1.sharepoint.com -Credentials (Get-Credential)\r\n\r\nExport-SPOTaxonomy -TermSetId 1e193f11-eb5f-4f76-8747-ddbb8902cd2b -TermStoreName \"Site Navigation\"\r\n\r\nbut this keeps resulting in the following error:\r\n\r\nExport-SPOTaxonomy : Specified argument was out of the range of valid values.\r\nParameter name: index\r\n\r\n\r\nThen when I corrected the term store name:\r\n\r\nExport-SPOTaxonomy -TermSetId fd829cd1-8970-448f-9152-93c1fbb5eaf3 -TermStoreName \"Taxonomy_hrn/SoS5OfY1gQN3xJiX6g==\"\r\n\r\nI got \r\n\r\nExport-SPOTaxonomy : Cannot invoke method or retrieve property from null object. Object returned by the following call stack \r\nis null. \"GetTermSet\r\nGetByName\r\nTermStores\r\nMicrosoft.SharePoint.Taxonomy.TaxonomySession.GetTaxonomySession\r\n\"\r\nAt line:1 char:1\r\n+ Export-SPOTaxonomy -TermSetId fd829cd1-8970-448f-9152-93c1fbb5eaf3 -TermStoreNam ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : WriteError: (:) [Export-SPOTaxonomy], ServerException\r\n    + FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.ExportTaxonomy\r\n\r\nThen when I corrected the guid to point to a termset it all worked and I got my export:\r\n\r\nExport-SPOTaxonomy -TermSetId dda17137-1adf-43e4-bf3b-ce7be1fc943e -TermStoreName \"Taxonomy_hrn/SoS5OfY1gQN3xJiX6g==\"\r\n\r\nThen now my issue:\r\n\r\nIs there a way to debug these commands in Visual studio stepping through will help me understand what each command expects. I've tried setting break points and attaching to the PowerShell commands but this doesn't seem to be working. I've tried both Visual Studio 2013 and 2015.\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/comments/141149754","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/67#issuecomment-141149754","issue_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/67","id":141149754,"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-17T17:01:20Z","updated_at":"2015-09-17T17:01:20Z","body":"There is absolutely a way to debug them. Open the solution in Visual Studio, build the project and make sure that you do NOT have the prebuild package installed (e.g. the one that comes as an MSI). The build command (make sure you build in debug mode) will copy the assemblies to a folder called:\r\n\r\nc:\\users\\<username>\\Documents\\WindowsPowerShell\\Modules\\etc. etc.\r\n\r\nThat path is added to your PSModulePath environment variable by default and the moment you launch a powershell session it will automatically load the modules available there. Then in Visual Studio attach the debugger to the powershell session you just launched and you should be set. Make sure that if you use the latest version of the powershell cmdlets in Visual Studio you also need a full copy of the core library on your computer (e.g. the source code) as many of the PnP PowerShell cmdlets are simply wrappers around Core library methods, e.g. the work is done in the core library.\r\n\r\n"}}