Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created October 3, 2018 13:14
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 shaneis/e6169298c2471197f1c4a0a12a82313f to your computer and use it in GitHub Desktop.
Save shaneis/e6169298c2471197f1c4a0a12a82313f to your computer and use it in GitHub Desktop.
Where to put an Alias attribute in a function
function Get-VideoPlayBackTime {
<#
comment based help
#>
[Alias('video')] # <-- This guy!
[CmdletBinding()]
[OutputType([PSCustomObject])]
param (
# Minutes of the video only
[Parameter(Position = 0)]
[int]$Minutes = 0,
# Seconds of the video left over after minutes
[Parameter(Mandatory,
Position = 1)]
[int]$Seconds,
# Speed up value for the video defaulting to 1.5
[Parameter(Position = 3)]
[ValidateSet('0.25', '0.5', '0.75', '1', '1.25', '1.5', '2')]
[double]$SpeedUp = 1.5
)
<#
the rest of the code
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment