Creating a SharePoint 2013 PowerShell Help Document with Examples
Creating a SharePoint 2013 PowerShell Help Document with Examples
All of this was done inside of the SharePoint 2013 Management Shell running as Administrator in my test and development environment. Do Not Try In Production.
(For instructor-led SharePoint 2013 training, see our course schedule)
I first ran the following command in order to get all the SharePoint Commandlets into the variable:
$com
1 | $com = Get-Command “*-SP*” |
I then typed $com into the shell and it wrote a list of all the SharePoint commandlets to the host screen!
Next I looped through the collection and got the help documentation including examples for each commandlet and wrote it out to a txt file using the –NoClobber (don’t overwrite) and the –Append (add to the file flags to create a text file of all the SharePoint Commandlets including their help documentation and examples using this line:
1 | foreach($s in $com){help $s.Name –Examples | Out-File max.txt –NoClobber –Append} |
(I typed it all on one line in the shell)
I then typed:
1 | Notepad max.txt |
And there it was in all its glory, my own personal detailed, comprehensive help file!
My help file is almost 800 pages when I pasted it into Microsoft Word 2013!!
I will keep both the .docx as well as the .txt versions, one for readability and one for copy pasting.
I will be working on outing it to html or xml and creating a JQuery site with the results, but that’s another blog post.
Spike Xavier
SharePoint Instructor – Interface Technical Training
Phoenix, AZ
You May Also Like
A Simple Introduction to Cisco CML2
0 3852 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
Cable Testers and How to Use them in Network Environments
0 713 1This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments
Difference Between $_ and $PSItem in Windows PowerShell
2 1906 4In this video, I’m going to answer a very common question that I get when I’m teaching Windows PowerShell, and that’s, “What’s the difference between what’s called $_ and $PSItem?” Let me explain to you a little bit about what these two variables do. When we’re working with the PowerShell pipeline, and we want to … Continue reading Difference Between $_ and $PSItem in Windows PowerShell