File tree Expand file tree Collapse file tree 7 files changed +70
-21
lines changed
windowsservercore-ltsc2016
windowsservercore-ltsc2016
windowsservercore-ltsc2016 Expand file tree Collapse file tree 7 files changed +70
-21
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
20
20
Invoke-WebRequest -Uri $url -OutFile 'python.exe' ; \
21
21
\
22
22
Write-Host 'Installing ...' ; \
23
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
24
- Start-Process python.exe -Wait \
23
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
24
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
25
25
-ArgumentList @( \
26
26
'/quiet' , \
27
27
'InstallAllUsers=1' , \
@@ -31,7 +31,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
31
31
'Include_doc=0' , \
32
32
'Include_pip=0' , \
33
33
'Include_test=0' \
34
- ); \
34
+ ) \
35
+ ).ExitCode; \
36
+ if ($exitCode -ne 0) { \
37
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39
+ exit $exitCode; \
40
+ } \
35
41
\
36
42
# the installer updated PATH, so we should refresh our local value
37
43
$env:PATH = [Environment]::GetEnvironmentVariable('PATH' , [EnvironmentVariableTarget]::Machine); \
@@ -41,6 +47,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
41
47
\
42
48
Write-Host 'Removing ...' ; \
43
49
Remove-Item python.exe -Force; \
50
+ Remove-Item $env:TEMP/Python*.log -Force; \
44
51
\
45
52
Write-Host 'Complete.'
46
53
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
14
14
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
15
15
\
16
16
Write-Host 'Installing ...'; \
17
- # https://docs.python.org/3.5 /using/windows.html#installing-without-ui
18
- Start-Process python.exe -Wait \
17
+ # https://docs.python.org/3/using/windows.html#installing-without-ui
18
+ $exitCode = ( Start-Process python.exe -Wait -NoNewWindow -PassThru \
19
19
-ArgumentList @( \
20
20
'/quiet', \
21
21
'InstallAllUsers=1', \
@@ -25,7 +25,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
25
25
'Include_doc=0', \
26
26
'Include_pip=0', \
27
27
'Include_test=0' \
28
- ); \
28
+ ) \
29
+ ).ExitCode; \
30
+ if ($exitCode -ne 0) { \
31
+ Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
32
+ Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
33
+ exit $exitCode; \
34
+ } \
29
35
\
30
36
# the installer updated PATH, so we should refresh our local value
31
37
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
@@ -35,6 +41,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env
35
41
\
36
42
Write-Host 'Removing ...'; \
37
43
Remove-Item python.exe -Force; \
44
+ Remove-Item $env:TEMP/Python*.log -Force; \
38
45
\
39
46
Write-Host 'Complete.'
40
47
You can’t perform that action at this time.
0 commit comments