Skip to content

Commit 04890c2

Browse files
Copilotnddq
andcommitted
Simplify Windows shell container to use just PowerShell
Co-authored-by: nddq <[email protected]>
1 parent b685638 commit 04890c2

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

shell/Dockerfile.windows

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,11 @@ FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}
55

66
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
77

8-
# Install common network troubleshooting tools
9-
# - Netstat, ping, ipconfig, etc. are built into Windows
10-
# - NirSoft WinDump (tcpdump equivalent for Windows)
11-
# - Portqry - port scanner
12-
13-
# Download and install NirSoft WinDump
14-
RUN mkdir -p C:\tools; \
15-
Invoke-WebRequest -Uri "https://www.nirsoft.net/utils/windump_setup.exe" -OutFile "C:\tools\windump_setup.exe" -UseBasicParsing; \
16-
Start-Process -FilePath "C:\tools\windump_setup.exe" -ArgumentList "/S" -Wait; \
17-
Remove-Item -Path "C:\tools\windump_setup.exe" -Force
18-
19-
# Download and install PortQry
20-
RUN Invoke-WebRequest -Uri "https://download.microsoft.com/download/3/b/5/3b51a025-7522-4686-87a6-47aa8ea68141/PortQryV2.exe" -OutFile "C:\Windows\System32\PortQry.exe" -UseBasicParsing
21-
22-
# Download and extract Nmap network scanner
23-
RUN Invoke-WebRequest -Uri "https://nmap.org/dist/nmap-7.92-win32.zip" -OutFile "C:\tools\nmap.zip" -UseBasicParsing; \
24-
Expand-Archive -Path "C:\tools\nmap.zip" -DestinationPath "C:\tools" -Force; \
25-
Move-Item -Path "C:\tools\nmap-*\*" -Destination "C:\tools\" -Force; \
26-
$env:PATH = "C:\tools;$env:PATH"
8+
# PowerShell is already included in Windows Server Core
9+
# No additional tools needed - using only built-in Windows commands
2710

2811
# Create a convenience script to display available tools
29-
RUN Set-Content -Path "C:\tools\show-tools.cmd" -Value @"
30-
@echo off
31-
echo.
32-
echo Available Network Troubleshooting Tools:
33-
echo - ipconfig : Show network configuration
34-
echo - netstat : Show network connections
35-
echo - ping : Test connectivity
36-
echo - tracert : Trace route
37-
echo - nslookup : DNS lookup
38-
echo - route : Show/manipulate routing table
39-
echo - netsh : Network shell for configuration
40-
echo - nmap : Network discovery and security auditing
41-
echo - portqry : Port scanner
42-
echo - windump : Packet analyzer (tcpdump for Windows)
43-
echo.
44-
"@
45-
46-
# Set PATH to include tools
47-
ENV PATH="C:\tools;C:\Windows\System32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0"
12+
RUN Set-Content -Path "C:\show-tools.cmd" -Value "@echo off\necho.\necho Available Windows Commands:\necho - ipconfig : Show network configuration\necho - netstat : Show network connections\necho - ping : Test connectivity\necho - tracert : Trace route\necho - nslookup : DNS lookup\necho - route : Show/manipulate routing table\necho - netsh : Network shell for configuration\necho."
4813

4914
WORKDIR C:\
5015

0 commit comments

Comments
 (0)