Skip to content

Commit 3dbaae4

Browse files
refactor package for AzF use
1 parent d16d1a9 commit 3dbaae4

12 files changed

+18
-13
lines changed

azure-functions-powershell-worker.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ VisualStudioVersion = 15.0.26124.0
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8C758288-3909-4CE1-972D-1BE966628D6C}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Functions.PowerShell.Worker", "src\Azure.Functions.PowerShell.Worker.csproj", "{939262BA-4823-405E-81CD-436C0B77D524}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Functions.PowerShellWorker", "src\Microsoft.Azure.Functions.PowerShellWorker.csproj", "{939262BA-4823-405E-81CD-436C0B77D524}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{12092936-4F2A-4B40-9AF2-56C840D44FEA}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Functions.PowerShell.Worker.Test", "test\Azure.Functions.PowerShell.Worker.Test.csproj", "{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Functions.PowerShellWorker.Test", "test\Microsoft.Azure.Functions.PowerShellWorker.Test.csproj", "{535C8DA3-479D-42BF-B1AF-5B03ECAF67A4}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
using System.Runtime.CompilerServices;
77

8-
[assembly:InternalsVisibleTo("Azure.Functions.PowerShell.Worker.Test")]
8+
[assembly:InternalsVisibleTo("Microsoft.Azure.Functions.PowerShellWorker.Test")]
99

src/Azure.Functions.PowerShell.Worker.Package.props renamed to src/Microsoft.Azure.Functions.PowerShellWorker.Package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
55
<Project>
66
<PropertyGroup>
77
<Version>0.1.0</Version>
8-
<PackageId>Azure.Functions.PowerShell.Worker</PackageId>
8+
<PackageId>Microsoft.Azure.Functions.PowerShellWorker</PackageId>
99
<Authors>Microsoft</Authors>
1010
<Owners>Microsoft</Owners>
1111
<Company>Microsoft Corporation</Company>

src/Azure.Functions.PowerShell.Worker.csproj renamed to src/Microsoft.Azure.Functions.PowerShellWorker.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Copyright (c) Microsoft. All rights reserved.
33
Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
-->
55
<Project Sdk="Microsoft.NET.Sdk">
6-
<Import Project="Azure.Functions.PowerShell.Worker.Package.props" />
6+
<Import Project="Microsoft.Azure.Functions.PowerShellWorker.Package.props" />
77
<PropertyGroup>
88
<OutputType>Exe</OutputType>
99
<TargetFramework>netcoreapp2.1</TargetFramework>
1010
<Product>Azure Function PowerShell Language Worker</Product>
11+
1112
<LangVersion>Latest</LangVersion>
1213
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1314
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -26,6 +27,10 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
2627
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
2728
</ItemGroup>
2829

30+
<!-- Copy Content files to the language worker's directory -->
31+
<PropertyGroup>
32+
<ContentTargetFolders>contentFiles\any\any\workers\powershell</ContentTargetFolders>
33+
</PropertyGroup>
2934
<ItemGroup>
3035
<Content Include="worker.config.json" PackageCopyToOutput="true">
3136
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/Modules/Azure.Functions.PowerShell.Worker.Module/Azure.Functions.PowerShell.Worker.Module.psd1 renamed to src/Modules/Microsoft.Azure.Functions.PowerShellWorker.Module/Microsoft.Azure.Functions.PowerShellWorker.Module.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@{
22

33
# Script module or binary module file associated with this manifest.
4-
RootModule = 'Azure.Functions.PowerShell.Worker.Module.psm1'
4+
RootModule = 'Microsoft.Azure.Functions.PowerShellWorker.Module.psm1'
55

66
# Version number of this module.
77
ModuleVersion = '0.1.0'

src/PowerShell/PowerShellManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal void InitializeRunspace()
5656
_pwsh.AddScript($"using namespace {typeof(HttpResponseContext).Namespace}").InvokeAndClearCommands();
5757

5858
// Set the PSModulePath
59-
Environment.SetEnvironmentVariable("PSModulePath", Path.Join(AppDomain.CurrentDomain.BaseDirectory, "Modules"));
59+
Environment.SetEnvironmentVariable("PSModulePath", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "workers", "powershell", "Modules"));
6060
}
6161

6262
internal Hashtable InvokeFunction(
@@ -121,7 +121,7 @@ internal Hashtable InvokeFunction(
121121
returnObject = pipelineItems[pipelineItems.Count - 1];
122122
}
123123

124-
var result = _pwsh.AddCommand("Azure.Functions.PowerShell.Worker.Module\\Get-OutputBinding")
124+
var result = _pwsh.AddCommand("Microsoft.Azure.Functions.PowerShellWorker.Module\\Get-OutputBinding")
125125
.AddParameter("Purge")
126126
.InvokeAndClearCommands<Hashtable>()[0];
127127

src/worker.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"language":"powershell",
44
"extensions":[".ps1"],
55
"defaultExecutablePath":"dotnet",
6-
"defaultWorkerPath":"Azure.Functions.PowerShell.Worker.dll"
6+
"defaultWorkerPath":"../../Microsoft.Azure.Functions.PowerShellWorker.dll"
77
}
88
}

test/Function/FunctionLoaderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Microsoft.Azure.WebJobs.Script.Grpc.Messages;
99
using Xunit;
1010

11-
namespace Azure.Functions.PowerShell.Worker.Test
11+
namespace Microsoft.Azure.Functions.PowerShellWorker.Test
1212
{
1313
public class FunctionLoaderTests
1414
{

test/Azure.Functions.PowerShell.Worker.Test.csproj renamed to test/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<ProjectReference Include="..\src\Azure.Functions.PowerShell.Worker.csproj" />
18+
<ProjectReference Include="..\src\Microsoft.Azure.Functions.PowerShellWorker.csproj" />
1919
</ItemGroup>
2020

2121
</Project>

0 commit comments

Comments
 (0)