Skip to content

Commit 3631160

Browse files
committed
Adding data/files/install-openssh.bat
1 parent eec7507 commit 3631160

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

data/files/install-openssh.bat

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@echo off
2+
REM ================================================
3+
REM Install OpenSSH Client and create .ssh folder
4+
REM Windows 11 Batch Script
5+
REM ================================================
6+
7+
echo.
8+
echo Creating .ssh directory under user profile...
9+
10+
if not exist "%USERPROFILE%\.ssh" (
11+
mkdir "%USERPROFILE%\.ssh"
12+
echo Created: %USERPROFILE%\.ssh
13+
) else (
14+
echo .ssh directory already exists
15+
)
16+
17+
echo.
18+
echo Installing OpenSSH Client...
19+
20+
REM Check if already installed
21+
powershell -Command "Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Client*' | findstr Installed" >nul
22+
23+
if %errorlevel%==0 (
24+
echo OpenSSH Client already installed
25+
) else (
26+
powershell -Command "Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0"
27+
)
28+
29+
echo.
30+
echo Verifying installation...
31+
32+
where ssh >nul 2>nul
33+
34+
if %errorlevel%==0 (
35+
echo OpenSSH installed successfully
36+
) else (
37+
echo OpenSSH installation failed or restart required
38+
)
39+
40+
echo.
41+
echo Done.
42+
pause

0 commit comments

Comments
 (0)