Comments (15)
I guess our choices are:
- Don't support
entrypoint
at all. - Copy the
.ps1
file to a temp file and rename the extension to.psm1
, thenimport-module
the.psm1
file. This doesn't seem worth the effort.
I'm inclined to the first option. @tylerl0706 what's your thought?
from azure-functions-powershell-worker.
Entrypoint is a Functions concept and I think we should honor it if we can.
from azure-functions-powershell-worker.
If we dot source and then run the function in the local scope, wouldn't that work?
pwsh.AddScript(". ./foo.ps1; Invoke-Foo", useLocalScope: true).Invoke()
from azure-functions-powershell-worker.
Then we cannot use AddCommand
, which means we cannot differentiate between a hard exception (the script is broken) and an expected error because all kinds of errors will be written to error stream.
from azure-functions-powershell-worker.
Entrypoint is a Functions concept and I think we should honor it if we can.
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 .ps1
file? A .ps1
file always has a default entry point.
from azure-functions-powershell-worker.
I thought we had pwsh.HasErrors
available to us? Or is that set to true when there are errors in the error stream?
Also, using AddCommand(...).AddStatement()
also has this problem with hard exceptions.
from azure-functions-powershell-worker.
As far as I understand, pwsh.HasErrors
will be set to true
if there is any error written to the error stream, which means the expected error will make it set to true
too.
Didn't know the same issue happens to AddStatement()
too. That's a shame 😦
from azure-functions-powershell-worker.
So get this, that actually does throw it looks like?
from azure-functions-powershell-worker.
Same with dot sourcing actually.
from azure-functions-powershell-worker.
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.
from azure-functions-powershell-worker.
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 AddCommand("NonExistCmd")
will throw while AddScript("NonExistCmd")
doesn't.
Even with AddScript
and dot-sourcing, passing arguments would be awkward. If using @args
and AddArguments(..)
, you are basically assuming the parameter declaration is the in the same order of your passed-in arguments, which is fragile. And again, in my opinion, it's more work for a feature that is not reliable and of little value.
from azure-functions-powershell-worker.
ping PMs @asavaritayal @joeyaiello
from azure-functions-powershell-worker.
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?
from azure-functions-powershell-worker.
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.
from azure-functions-powershell-worker.
Closed via #116
from azure-functions-powershell-worker.
Related Issues (20)
- Component Detection: High Severity - Microsoft.Azure.EventHubs
- Component Detection: Medium Severity - Microsoft.Azure.DocumentDB.Core HOT 1
- Backport deprecated component replacement to PS7.2 HOT 1
- Update the function app in E2E tests to use latest Extension bundles HOT 1
- Update PowerShell language worker build to check and flag vulnerabilities in the resolved dependencies
- Upgrade PowerShell 7.4 SDK to 7.4.0
- Upgrade PowerShell SDK to latest version
- Update PowerShell 7.0 worker to latest System.Data.SqlClient HOT 1
- Known regression: Durable Functions Activity input fails to deserialize when the input is an array
- [Linux Consumption] [Portal] Portal shows Linux Consumption as an option for Powershell 7.4 it is not supported HOT 3
- [Linux Elastic Premium] Kudu SSH appears to fail for powershell7.4 HOT 3
- Linux (Consumption) not supported in PowerShell 7.4 yet HOT 1
- Feature Request: Recursive Directory Searching for function.json HOT 1
- Az-Accounts: Issue re-emerging.. HOT 4
- Support OpenTelemetry in the PowerShell worker
- Profile.ps1 not instrumented HOT 1
- Diagram of module interaction w/ worker HOT 1
- Update PowerShell SDK for 7.4 to 7.4.2
- Update PowerShell SDK for 7.2 to 7.2.19 HOT 1
- Document OpenTelemetry support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-powershell-worker.