Created
August 12, 2015 20:47
-
-
Save RafPe/1ab94a798407836fea84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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-RemoteRequiredFunctions | |
{ | |
<# | |
.SYNOPSIS | |
Gets required functions | |
.PARAMETER functionName | |
this is object type data coming via pipeline | |
.DESCRIPTION | |
This cmdlet compares generic property names and values and return data if they match parameters passed. | |
Be aware that it lowers the characters for being compliant with all remaining functions | |
.EXAMPLE | |
Get-RemoteRequiredFunctions -functionName Do-SomethingAwesomeFunc | |
.FUNCTIONALITY | |
RequiredFunction<Export-FunctionRemote> | |
#> | |
param | |
( | |
[string]$functionName | |
) | |
try | |
{ | |
# create array to hold our processed results | |
$arrOfRes = @() | |
$requiredRemoteFunctions=Get-Help $functionName | |
if($requiredRemoteFunctions.Functionality.Contains(';')) | |
{ | |
$requiredRemoteFunctions = $requiredRemoteFunctions.Functionality.Split(';').Trim() | |
$requiredRemoteFunctions | % { if($_ -match 'RequiredFunction<(?<function>.*?)\>') | |
{ | |
$funcBody = Export-EolFunctionRemote $matches.function | |
$arrOfRes=$arrOfRes + $funcBody | |
} | |
} | |
return $arrOfRes | |
} | |
} | |
catch | |
{ | |
return $null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment