Skip to content

Instantly share code, notes, and snippets.

@victorvogelpoel
Last active January 3, 2016 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorvogelpoel/8387918 to your computer and use it in GitHub Desktop.
Save victorvogelpoel/8387918 to your computer and use it in GitHub Desktop.
Write-HelloWorld.ps1 is a sample file for Measure-ScriptCode to work on.
# Write-HelloWorld.ps1
# Sample file for calculating PowerShell script code metrics
# Jan 2014
# If this works, Victor Vogelpoel <victor@victorvogelpoel.nll> wrote this.
# If it doesn't, I don't know who wrote this.
Set-PSDebug -Strict
Set-StrictMode -Version Latest
function Write-HelloWorld
{
# Just write it to the host! # This line has no code, just comment
Write-Host "Hello World!" # A line of comment on a codeline
Write-Verbose "Hello World!"
<#
.Synopsis
Writes hello world to the host
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
.INPUTS
Inputs to this cmdlet (if any)
.OUTPUTS
Output from this cmdlet (if any)
.NOTES
General notes
.COMPONENT
The component this cmdlet belongs to
.ROLE
The role this cmdlet belongs to
.FUNCTIONALITY
The functionality that best describes this cmdlet
#>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment