- Abstract
- Table of Contents
- Content Restrictions
- Getting Started
- Meta Information
- Suggested Quality Management
- Resource Maintenance
- Additional Resources
- VMWARE TECHNOLOGY PREVIEW LICENSE AGREEMENT
This document will serve for collaboration to identify the operating principles of a centralized PowerCLI Community Repository on GitHub.
The central PowerCLI repo will be located at: https://github.com/vmware/PowerCLI-Example-Scripts
The repository has been provided to allow the community to share resources that leverage VMware’s PowerCLI. This can include:
- Sample Scripts
- Modules
- DSC Resources
- PowerActions scripts
- Pester Tests
- Tools built with PowerShell
- Load the GitHub repository page: https://github.com/vmware/PowerCLI-Example-Scripts
- Click on the green “Clone or Download” button and then click “Download ZIP”
- Once downloaded, extract the zip file to the location of your choosing
- At this point, you now have a local copy of the repository
- Login (or signup) to GitHub
- Load the GitHub repository page: https://github.com/vmware/PowerCLI-Example-Scripts
- Click on the Fork button, which will create a copy of the repository and place it in the GitHub based location of your choosing.
- Browse to the appropriate section (example: Scripts)
- Select the “Create new file” button
- On the new page, enter a file name, enter the resource’s information
- Within the “Commit new file” area, enter the title and description, then select “Create a new branch for this commit…” and enter a sensical branch name
- Click “Propose new file”
- On the “Open a pull request” page, click “Create pull request”
- Browse to the appropriate section (example: Modules)
- Select the “Upload files” button
- On the new page, drag or choose the files to add
- Within the “Commit changes” area, enter the title and description, then select “Create a new branch for this commit…” and enter a sensical branch name
- Click “Propose new file”
- On the “Open a pull request” page, click “Create pull request”
This section will provide guidance on information which should be included with each submitted PowerCLI resource. Information listed in the Suggested Information will not be required for commit of a pull request to the repo, but will certainly increase ease of use for users of the resource.
The following information must be included with each submitted scripting resource. Please include the information in the appropriate location based upon the submitted scripting resource.
- Author Name
- This can include full name, Twitter profile, or other identifiable piece of information that would allow interested parties to contact author with questions. //: # (LucD: Shouldn't we enforce that all question follow the Issues concept? Questions about a script might be useful for others.)
- Date
- Date the resource was written
- Minimal/High Level Description
- What does the resource do
- Any KNOWN limitations or dependencies
- vSphere version, required modules, etc. //: # (LucD: Perhaps add a question to add additional "tested" versions/environments through the Issues concept. Original author(s) might not always have access.)
Script: Top few lines
Module: Module manifest
<#
Script name: script_name.ps1
Created on: 07/07/2016
Author: Author Name, @TwitterHandle
Description: The purpose of the script is to …
Dependencies: None known
#>
//: # (LucD: Why not go for the standard PS Help format as a requirement?) //: # (LucD: What about a Disclaimer? Or is that covered by the License attached to the repository?)
The following information should be included when possible. Inclusion of information provides valuable information to consumers of the resource.
- vSphere version against which the script was developed/tested
- PowerCLI build against which the script was developed/tested
- PowerShell version against which the script was developed/tested
- OS platform version against which the script was tested/developed
- Keywords that make it easier to find a script, for example: VDS, health check
<#
Script name: script_name.ps1
Created on: 07/07/2016
Author: Author Name, @TwitterHandle
Description: The purpose of the script is to …
Dependencies: None known
===Tested Against Environment====
vSphere Version: 6.0
PowerCLI Version: PowerCLI 6.3 R1
PowerShell Version: 5.0
OS Version: Windows 10
Keyword: VM
#>
This section describes guidelines put in place to maintain a standard of quality while also promoting broader contribution. //: # (LucD: I'm missing the formatting of the code (capitalisation, indentation, aligned braces... Perhaps refer to the The PowerShell Best Practices and Style Guide)
- Give the resource a name that is indicative of the actions and/or results of its running
- Read and apply the following basic fault handling where applicable: Microsoft’s Hey, Scripting Guy! Blog: https://blogs.technet.microsoft.com/heyscriptingguy/2014/07/09/handling-errors-the-powershell-way/
- Avoid any alias usage within all submitted resources.
- Avoid changing any global variables
- All resources should have inline documentation.
- The script should be easy to read and understand
- Place user-defined variables towards the top of the script
- The module file, PSM1, should contain only functions. A module manifest file, PSD1, should also be created and included. A module formatting file (format.ps1xml) is desirable but not a requirement.
- Use only standard verbs
- Usage of PowerShell’s strict mode is preferred, but not required.
- Remove any information related to one’s own environment (examples: Passwords, DNS/IP Addresses, custom user credentials, etc)
Ownership of any and all submitted resources are maintained by the submitter. This ownership also includes maintenance of any and all submitted resources. //: # (LucD: This part is one of the reasons I asked about Legal and Disclaimers. Is Ownership the same as Liability?)
Any bugs or other issues should be filed within GitHub by way of the repository’s Issue Tracker.
Any community member can resolve issues within the repository, however only the owner or a board member can approve the update. Once approved, assuming the resolution involves a pull request, only a board member will be able to merge and close the request.
Join in on the discussion within the VMware Code Slack team's PowerCLI channel: https://code.vmware.com/slack/ //: # (LucD: I would suggest to start a dedicated Slack channel, for example "PowerCLI Repository". This to avoid having to look through all the PowerCLI clatter)
It is highly recommened to add any and all submitted resources to the VMware Sample Exchange: https://developercenter.vmware.com/samples
Sample Exchange can be allowed to access your GitHub resources, by way of a linking process, where they can be indexed and searched by the community. There are VMware social media accounts which will advertise resources posted to the site and there's no additional accounts needed, as the VMware Sample Exchange uses MyVMware credentials.
//: # (LucD: Will that be an automated process?)
The VMware Technnology Preview License Agreement: https://github.com/vmware/PowerCLI-Example-Scripts/blob/master/LICENSE.md //: # (LucD: This only protects VMware, not the submitters, as far as my legalese is correct)
- Board Members
- Approval of Additions
Board members are volunteers from the PowerCLI community and VMware staff members, board members are not held responsible for any issues which may occur from running of scripts inside this repository. //: # (LucD: Again, I would like to have this checked by Legal. Especially for the submitter and the requirement to have a disclaimer in each script)
Members:
- Josh Atwell (Community Member)
- Mathieu Buisson (Community Member)
- Luc Dekens (Community Member)
- Jonathan Medd (Community Member)
- Alan Renouf (VMware)
- Kyle Ruddy (VMware)
- Rynardt Spies (Community Member)
Items added to the repository, including items from the Board members, require 2 votes from the board members before being added to the repository. The approving members will have ideally downloaded and tested the item. When two “Approved for Merge” comments are added from board members, the pull can then be committed to the repository.