Automatic Documentation with PowerShell

Maintain good documentation (especially up-to-date) it’s a very important requirement in every workplace or project.

So why don’t we focus on this subject some of the automation tasks?  Starting with a basic PowerShell script that will help us to save time and bring us value on a daily basis.

In this example Get-SimpleServerDoc we will store on a local folder all server and features installed on one or more windows server.  More then an inventory will describe the requirements and the characteristics of our environment.

Looking at the example is easy to run that script on all servers in a specific OU / Domain or using a list from a file if desired.

Every time I write documentation my aim is to keep it simple.

This script is just a starting point with a lot of possible improvements.

We can save them on a shared folder for example or run the script periodically as a scheduled task, so the documentation will be automatically generated.

If documentation consists of a simple text file or even an HTML ad if that folder is the website folder of IIS can be a simple webpage with this code:

Text files can be used for re-deploy the server with this oneliner:

But you can also save other important files or configuration file as well or the services with the startup type  automatic :

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.