Hi @Ayan Mullick ,
According to the document.
There is no PowerShell for the lang option. The language of the template now only support C#, F# and VB.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @Ayan Mullick , what I mean is that the lang option deoesn't contain PowerShell. You can create a webapi in PowerShell like this: dotnet new webapi -n WebApi -lang C#.
I understand @Jiadong Meng - MSFT , But I need to create a web api in PowerShell only, like below
How does one do that using the .Net5 SDK?
@Ayan Mullick the link you provide only indicate that azure function can run .ps1 file. However .net5 only support the 3 language I mentioned above to create project. I think they are two different things
I understand you are saying PowerShell is unsupported by the .Net5 SDK. The question is how does one create a PowerShell web API that uses .Net5?
@Ayan Mullick I think there is no way to do this.
@Jiadong Meng - MSFT , Thank you for confirming. Does one need to submit this as a UserVoice feature suggestion?
There is no feature or functionality to create a Web API having PowerShell as the language.
The link you have provided is for Azure Functions:
Quickstart: Create a PowerShell function in Azure from the command line
funccommand comes from Azure Functions Core Tools.
It is impossible to do that via .NET 5 SDK. You need to use the Azure related SDK and tools, and the forum for that is also Azure Functions forum, https://learn.microsoft.com/en-us/answers/topics/azure-functions.html
PowerShell is a .Net Global tool.
I thought web API creation should be doable too.
"PowerShell is a .NET Global tool" only indicates that PowerShell itself (the execution engine) is a .NET Core application, and can be wrapped as a global tool, which has nothing to do with "web API creation" at all, because PowerShell is just a script language primarily designed for system management, not general programming. I already pointed out that if you indeed want to write a web API using the PowerShell language, then Azure Functions happens to have some support there. However, that's Azure centric and not part of .NET SDK experience.
Ok. got it. Although, Windows PowerShell was primarily used 'for system management'. PowerShell is open-source, platform-independent and ranks 39th among general programming languages. https://www.tiobe.com/tiobe-index
I feel the .Net5 SDK could provide more support for it.
Sign in to comment