Last active
May 2, 2017 15:20
-
-
Save RafPe/f16e471ea47a248a8a0a 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 Export-FunctionRemote | |
{ | |
<# | |
.SYNOPSIS | |
Exports function to String ScriptBlock | |
.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 | |
$mtFunction = Export-FunctionRemote | |
#> | |
param | |
( | |
$name | |
) | |
$function = $(Get-Content function:\$name) | |
$result = "Function $name {" | |
$result += $function | |
$result += '}' | |
return $result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where is the new stored please?
I'm calling your script like so at the moment but not finding the new function ?
PS C:\Users> Export-FunctionRemote -name WebAdministration
Function WebAdministration {
if(-Not(Get-Module -ListAvailable -Name 'WebAdministration'))
{
Write-Logging -level Error "MODULE : WebAdministration CANNOT be imported on $env:computername"
}
}