-
Notifications
You must be signed in to change notification settings - Fork 54
Disable .ps1 support in entryPoint #73
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
Comments
I guess our choices are:
I'm inclined to the first option. @tylerl0706 what's your thought? |
Entrypoint is a Functions concept and I think we should honor it if we can. |
If we dot source and then run the function in the local scope, wouldn't that work?
|
Then we cannot use |
I think it depends on whether it adds any value. What would be the scenarios for people to use an entry point along with a |
I thought we had Also, using |
As far as I understand, Didn't know the same issue happens to |
I might be holding on to nothing here. Feel free to change it (remove the EntryPoint support) if you think this is something user's won't want and we can get feedback later. Please confirm with PMs though. |
Hmm, thanks for verifying it. My memory was a bit off on this one. They have some different behaviors but I couldn't recall exactly what except that Even with |
ping PMs @asavaritayal @joeyaiello |
I just saw that we got some chatter about classes support. If we keep entryPoint, we can leverage it with classes no? That seems like a reasonable use case? |
I'm not sure we care about entrypoint right now, but I'll spin up an issue to discuss it, and then we can close this out if we determine it's useless over there. |
Closed via #116 |
When working on the refactoring, I found that although
Import-Module -Name script.ps1
does import the script file as a module, the module doesn't expose anything, and functions from the script are actually loaded in the global scope.This unexpected behavior will leave those functions around to pollute the Runspace.
We could useNew-Module -ScriptBlock
to replace the current approach.New-Module
creates a dynamc module that will be persisted in the session until the session exits. So it doesn't help.The text was updated successfully, but these errors were encountered: