Skip to content

Commit

Permalink
(maint) - Update powershell provider install
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Jun 26, 2023
1 parent 9989dff commit dd18ad2
Showing 1 changed file with 4 additions and 35 deletions.
39 changes: 4 additions & 35 deletions templates/windows/install_powershell_provider.ps1.erb
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
# this file install the Windows Docker package using the DockerMsftProvider powershell provider
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$dockerProviderName="DockerMsftProvider"

Write-Information "Installing Package Provider"
$module = Install-PackageProvider NuGet -Force `
<% if @nuget_package_provider_version -%>
-RequiredVersion <%= @nuget_package_provider_version %>
<% end -%>

If ($module -eq $null) {
Write-Error "Failed to install NuGet Package Provider"
Exit 1
}

Write-Information "Installing Docker Provider"
Install-Module $dockerProviderName -Force `
<% if @docker_msft_provider_version -%>
-RequiredVersion <%= @docker_msft_provider_version %>
<% end -%>

$provider = Get-Module -ListAvailable -Name $dockerProviderName
If ($provider -eq $null) {
Write-Error "Failed to install Docker Microsoft Provider"
Exit 1
}

Write-Information "Installing Docker Package"
$package=Install-Package <%= @docker_ee_package_name %> -ProviderName $dockerProviderName -Force `
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1 -NoRestart `
<% if @version -%>
-RequiredVersion <%= @version %>
<% end -%>

If ($package -eq $null) {
Write-Error "Failed to install Docker Package"
Exit 1
}
-DockerVersion <%= @version %>
<% end -%>

0 comments on commit dd18ad2

Please sign in to comment.