Skip to content

Stream handling, param block, PowerShellManager #11

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

Merged
merged 17 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions azure-functions-powershell-worker.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8C758288-390
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Functions.PowerShell.Worker", "src\Azure.Functions.PowerShell.Worker\Azure.Functions.PowerShell.Worker.csproj", "{939262BA-4823-405E-81CD-436C0B77D524}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Functions.PowerShell.Worker.Messaging", "src\Azure.Functions.PowerShell.Worker.Messaging\Azure.Functions.PowerShell.Worker.Messaging.csproj", "{A1581262-DE79-4C01-AD6C-88BE7C3E6322}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{12092936-4F2A-4B40-9AF2-56C840D44FEA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Functions.PowerShell.Worker.Test", "test\Azure.Functions.PowerShell.Worker.Test\Azure.Functions.PowerShell.Worker.Test.csproj", "{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}"
Expand Down Expand Up @@ -38,18 +36,6 @@ Global
{939262BA-4823-405E-81CD-436C0B77D524}.Release|x64.Build.0 = Release|Any CPU
{939262BA-4823-405E-81CD-436C0B77D524}.Release|x86.ActiveCfg = Release|Any CPU
{939262BA-4823-405E-81CD-436C0B77D524}.Release|x86.Build.0 = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|x64.ActiveCfg = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|x64.Build.0 = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|x86.ActiveCfg = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Debug|x86.Build.0 = Debug|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|Any CPU.Build.0 = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|x64.ActiveCfg = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|x64.Build.0 = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|x86.ActiveCfg = Release|Any CPU
{A1581262-DE79-4C01-AD6C-88BE7C3E6322}.Release|x86.Build.0 = Release|Any CPU
{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -65,7 +51,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{939262BA-4823-405E-81CD-436C0B77D524} = {8C758288-3909-4CE1-972D-1BE966628D6C}
{A1581262-DE79-4C01-AD6C-88BE7C3E6322} = {8C758288-3909-4CE1-972D-1BE966628D6C}
{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4} = {12092936-4F2A-4B40-9AF2-56C840D44FEA}
EndGlobalSection
EndGlobal
15 changes: 14 additions & 1 deletion examples/PSCoreApp/MyHttpTrigger/run.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
param($req, $TriggerMetadata)

# Write-Host $TriggerMetadata["Name"]

# Invoked with Invoke-RestMethod:
# irm http://localhost:7071/api/MyHttpTrigger?Name=Tyler
# Input bindings are added to the scope of the script: ex. `$req`

# If no name was passed by query parameter
$name = 'World'

# You can interact with query parameters, the body of the request, etc.
if($req.Query.Name) {
$name = $req.Query.Name
}

Write-Verbose "Hello $name" -Verbose
# you can write to the same streams as you would in a normal PowerShell script
Write-Verbose "Verbose $name" -Verbose
Write-Warning "Warning $name"

# You set the value of your output bindings by assignment `$nameOfOutputBinding = 'foo'`
$res = [HttpResponseContext]@{
Body = @{ Hello = $name }
ContentType = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>

<Product>Azure Function PowerShell Language Worker</Product>
<Company>Microsoft Corporation</Company>
<Copyright>(c) Microsoft Corporation. All rights reserved.</Copyright>
Expand All @@ -15,7 +14,6 @@
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.1.0-rc.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public FunctionInfo(RpcFunctionMetadata metadata)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ internal class Function
public FunctionInfo Info {get; internal set;}
public string ScriptPath {get; internal set;}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public bool Equals(HttpRequestContext other)
&& (RawBody == other.RawBody || RawBody.Equals(other.RawBody));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ public bool Equals(HttpResponseContext other)
&& (Body == other.Body || Body.Equals(other.Body));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ public void SetContext(string requestId, string invocationId)
_invocationId = invocationId;
}
}
}
}

This file was deleted.

Loading