-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #156 - Start-RSJob - be able to import private functions #157
Conversation
PoshRSJob/Public/Start-RSJob.ps1
Outdated
.PARAMETER FunctionFilesToLoad | ||
A collection of files containing custom functions that will be imported into the background runspace job. | ||
|
||
.PARAMETER FunctionsToLoad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change for those who have been using this parameter. I would recommend adding an alias on FunctionsToImport called FunctionsToLoad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi,
I just cloned the master branch of the repo, if we take a look at the line 178 of :
https://github.com/proxb/PoshRSJob/blob/master/PoshRSJob/Public/Start-RSJob.ps1
The real param name is FunctionsToLoad but not FunctionsToImport, I just correct it in the help file to be the same as declared in the function param block.
And the new param that I added is : FunctionFilesToLoad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. That makes sense now. Thanks for the additional information!
This will be a breaking change for those who have been using this parameter. I would recommend adding an alias on FunctionsToImport called FunctionsToLoad. Other than that, I think everything looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems because of using AST
and [pscustomobject]
these changes doesnt support PSv2
Well, yes, AST is used which is not supported by PSv2. But if we keep the compatibility for V2, we will lost many powerful cmdlets/functionalities provided by the later versions. V2 might be considered as deprecated now. Nevertheless, I'll push a new commit to let it be compatible with V2 by using the FindFunction.ps1 Reg. the V2 support lifecycle, please refer to : |
Looks good, but I think will be better if 275 + $functionDefinition = $function.Body.Trim().Trim("{}")
276 + }
277 + Default {
278 + $functionDefinition = $function.Body.Extent.Text.Trim("{}") will be inside btw, GetFun --c-- tionByFile ;-) |
@MVKozlov Or I add the part inside, and rename the file GetFunсtionByFile.ps1 to GetFunсtionDefinitionByFile.ps1 ? |
I think it doesn't matter (almost) how named internal function, but I prefer new functional mimic existing implementation in Personally me strongly dislike |
I agree with you, all the |
I like it, wait for @proxb :) |
I'm so late to this. As far as I can tell, it looks good to me. I'll get this approved by the end of the week. |
Late to get this done, but now it's done. :) |
add a new param : FunctionFilesToLoad
and some code formatting.