What is the Proper Way to Share Credit on Script Authoring and Editing?
powershell, scripting
Solution
I generally have myself as the author and include my (work) contact information, seeing as how comments are for internal consumption, and I would be the most useful point of contact to anyone reading the comments.
I also generally place an "adapted from" field or section in there where I list where and from whom I grabbed any code snippets. It's a lot less about plagiarism (these people provided their code online for free, they expect people to copy it) and a lot more about being able to find the resources again if needed. My bosses don't care even a little about "credit" for scripts - I could write it from scratch or copy-pasta the whole thing, as long as it works... and I suspect the same is true of most people in IT.
Problem
In my scripting exploits I often check to see if a script has been written previously before I begin from scratch. Often I can at least find some of what I need through google or other means. I then adapt what I find to my needs and put it into production. As a best practice, I comment my code and include author information (I'm not a fan of plagiarizing). However there becomes the question of how and when it's appropriate to add/change that author designation. I'll use a sample script from Ed Wilson off his blog for reference: ``` Function Get-OutlookCalendar { <# .Synopsis This function returns appointment items from default Outlook profile .Description This function returns appointment items from default Outlook profile. It uses the Outlook interop assembly to use the olFolderCalendar enumeration. It creates a custom object consisting of Subject, Start, Duration, Location for each appointment item. .Example Get-OutlookCalendar | where-object { $_.start -gt [datetime]"5/10/2011" -AND $_.start -lt ` [datetime]"5/17/2011" } | sort-object Duration Displays subject, start, duration and location for all appointments that occur between 5/10/11 and 5/17/11 and sorts by duration of the appointment. The sort is shortest appointment on top. .Notes NAME: Get-OutlookCalendar AUTHOR: ed wilson, msft LASTEDIT: 05/10/2011 08:36:42 KEYWORDS: Microsoft Outlook, Office HSG: HSG-05-24-2011 .Link Http://www.ScriptingGuys.com/blog #Requires -Version 2.0 #> Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook" | Out-Null $olFolders = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -as [type] $outlook = New-Object -ComObject Outlook.Application $namespace = $outlook.GetNameSpace("MAPI") $folder = $namespace.getDefaultFolder($olFolders::olFolderCalendar) $folder.items | Select-Object -Property Subject,Start,Duration,Location } ``` I view the author field as the point of contact for that script as it's the person who wrote it and understands it. Is there a general rule of thumb as to how much a script is changed before it no longer makes sense to list the original author? Or are they always the author and then you're an editor? In the case of the latter, what's the appropriate way to designate that? Is it that you add a line under Author labeled "Editor" and change the last edit label? How exactly is the right way to document your contributions? Is there a documented best practice?