-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) - Update powershell provider install
- Loading branch information
1 parent
9989dff
commit dd18ad2
Showing
1 changed file
with
4 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -%> |