PowerShell Template

From TekiWiki
Jump to: navigation, search

The following is a PowerShell template, showing parameters and scripting:

<#
.SYNOPSIS
One line description

.DESCRIPTION
Long description of the script.

.EXAMPLE
args.ps1 -name "Xyz" -Path "xyz"

.INPUTS
Input stuff

.OUTPUTS
Output Stuff

.NOTES
Notes section

.LINK
http://www.homemarketeer.com

#>

param(

	## Help for File name parameter
	## Put the name of the file in this parameter
	[string] $Name,
	## Help for Path name parameter
	[string] $Path
)

## Display Info
"Path  " + $PSCommandPath
"Loc   " + $PSScriptRoot
"Command " + $myInvocation.Line

## Display arguments

"Name  $Name"
"Path  $Path"
"============================================"

"args[0]  " + $args[0]
"args[1]  " + $args[1]

$args

$args.length