Skip to content

Commit 6406040

Browse files
Enter-PSHostProcess workaround (#121)
* bundle Management + Utility modules and misc config updates * Test-Path fix
1 parent 04c0af3 commit 6406040

5 files changed

+24
-4
lines changed

build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ if(!$NoBuild.IsPresent) {
6767
}
6868

6969
Invoke-PSDepend -Path $requirements -Force
70+
71+
# TODO: Remove this once the SDK properly bundles modules
72+
Get-WebFile -Url 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1' `
73+
-OutFile "$PSScriptRoot/src/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1"
74+
Get-WebFile -Url 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1' `
75+
-OutFile "$PSScriptRoot/src/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1"
76+
7077
dotnet publish -c $Configuration $PSScriptRoot
7178
dotnet pack -c $Configuration "$PSScriptRoot/package"
7279
}

package/Microsoft.Azure.Functions.PowerShellWorker.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
1111
<authors>Microsoft</authors>
1212
<owners>Microsoft</owners>
1313
<requireLicenseAcceptance>false</requireLicenseAcceptance>
14-
<licenseUrl>https://github.com/Azure/azure-functions-powershell-worker/blob/dev/LICENSE</licenseUrl>
14+
<license type="expression">MIT</license>
1515
<projectUrl>https://github.com/Azure/azure-functions-powershell-worker</projectUrl>
1616
<iconUrl>https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_black_64.png?raw=true</iconUrl>
1717
<description>The Azure Function PowerShell Language Worker allows users to write Azure Function Apps using PowerShell. It leverages the PowerShell Core SDK.</description>

src/Microsoft.Azure.Functions.PowerShellWorker.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.0-preview.2" />
22-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
21+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.0-preview.3" />
22+
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
2323
<PackageReference Include="CommandLineParser" Version="2.3.0" />
2424
<PackageReference Include="Grpc" Version="1.14.1" />
2525
<PackageReference Include="Google.Protobuf" Version="3.6.1" />

test/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageReference Include="xunit" Version="2.3.1" />
1212
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
1313
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
14-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.0-preview.2" />
14+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.0-preview.3" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

tools/helper.psm1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ function Resolve-ProtoBufToolPath
168168
}
169169
}
170170

171+
function Get-WebFile {
172+
param (
173+
[string] $Url,
174+
[string] $OutFile
175+
)
176+
$directoryName = [System.IO.Path]::GetDirectoryName($OutFile)
177+
if (!(Test-Path $directoryName)) {
178+
New-Item -Type Directory $directoryName
179+
}
180+
Remove-Item $OutFile -ErrorAction SilentlyContinue
181+
Invoke-RestMethod $Url -OutFile $OutFile
182+
}
183+
171184
function Invoke-Tests
172185
{
173186
param(

0 commit comments

Comments
 (0)