File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments