.
This commit is contained in:
@ -1,54 +1,50 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
set check_computername=%COMPUTERNAME%
|
set check_computername=%COMPUTERNAME%
|
||||||
echo "Found computer %check_computername%"
|
echo "Found computer %check_computername%"
|
||||||
|
|
||||||
set PACKAGES="C:\Packages"
|
set PACKAGES="C:\Packages"
|
||||||
set WPUBLIC="C:\wPublic"
|
set WPUBLIC="C:\wPublic"
|
||||||
|
|
||||||
mkdir %PACKAGES%
|
set POWERSHELL=%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe
|
||||||
|
|
||||||
call %WPUBLIC%\bin\SpeedUpPS.bat
|
mkdir %PACKAGES%
|
||||||
|
|
||||||
echo "------- attempting uninstall first"
|
echo "------- attempting uninstall first"
|
||||||
set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1"
|
set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1"
|
||||||
if exist %PSFILE% (
|
if exist %PSFILE% (
|
||||||
echo "SSH uninstall script"
|
echo "SSH uninstall script"
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
%POWERSHELL% -ExecutionPolicy Bypass -File %PSFILE%
|
||||||
)
|
)
|
||||||
|
|
||||||
del /f/s/q "C:\Program Files\OpenSSH\*.*"
|
del /f/s/q "C:\Program Files\OpenSSH\*.*"
|
||||||
rmdir /s/q "C:\Program Files\OpenSSH"
|
rmdir /s/q "C:\Program Files\OpenSSH"
|
||||||
|
|
||||||
del /f/s/q "C:\Packages\openssh-portable-9.2.2.0\*.*"
|
|
||||||
rmdir /s/q "C:\Packages\openssh-portable-9.2.2.0"
|
|
||||||
|
|
||||||
del /f/s/q "C:\Packages\OpenSSH-Win64\*.*"
|
del /f/s/q "C:\Packages\OpenSSH-Win64\*.*"
|
||||||
rmdir /s/q "C:\Packages\OpenSSH-Win64"
|
rmdir /s/q "C:\Packages\OpenSSH-Win64"
|
||||||
|
|
||||||
echo "------- Download and unpack OpenSSH"
|
echo "------- Download and unpack OpenSSH"
|
||||||
set PSFILE="%WPUBLIC%\bin\Download.ps1"
|
set PSFILE="%WPUBLIC%\bin\Download.ps1"
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
%POWERSHELL% -ExecutionPolicy Bypass -File %PSFILE%
|
||||||
|
|
||||||
@REM if exist "C:\Program Files\OpenSSH\sshd.exe" (
|
|
||||||
@REM echo "OPENSSH already installed"
|
|
||||||
@REM )
|
|
||||||
@REM else (
|
|
||||||
echo "NEW installation"
|
echo "NEW installation"
|
||||||
robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E
|
robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E
|
||||||
@REM )
|
|
||||||
|
|
||||||
echo "------- attempting install"
|
echo "------- Attempting install"
|
||||||
set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1"
|
set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1"
|
||||||
if exist %PSFILE% (
|
if exist %PSFILE% (
|
||||||
echo "SSH install script"
|
echo "SSH install script"
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
%POWERSHELL% -ExecutionPolicy Bypass -File %PSFILE%
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "------- fix firewall"
|
echo "------- Fix firewall"
|
||||||
set PSFILE="%WPUBLIC%\bin\Firewall.ps1"
|
set PSFILE="%WPUBLIC%\bin\Firewall.ps1"
|
||||||
if exist %PSFILE% (
|
if exist %PSFILE% (
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
%POWERSHELL% -ExecutionPolicy Bypass -File %PSFILE%
|
||||||
net start sshd
|
net start sshd
|
||||||
)
|
)
|
||||||
|
|
||||||
curl.exe --output C:\BaseGitClone.bat --url https://git.cabinbagonly.com/mirror/wBase/raw/branch/main/BaseGitClone.bat
|
curl.exe --output C:\BaseGitClone.bat --url https://git.cabinbagonly.com/mirror/wBase/raw/branch/main/BaseGitClone.bat
|
||||||
|
curl.exe --output C:\pull.bat --url https://git.cabinbagonly.com/mirror/wPublic/raw/branch/main/bin/pull.bat
|
||||||
|
|
||||||
|
call %WPUBLIC%\bin\SpeedUpPS.bat
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
@echo off
|
|
||||||
set check_computername=%COMPUTERNAME%
|
|
||||||
echo "Found computer %check_computername%"
|
|
||||||
|
|
||||||
set PACKAGES="C:\Packages"
|
|
||||||
set WPUBLIC="C:\wPublic"
|
|
||||||
|
|
||||||
echo "Dump software list"
|
|
||||||
set PSFILE="%WPUBLIC%\bin\ListSoftware.ps1"
|
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% > "C:\%check_computername%.txt"
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
function Optimize-PowershellAssemblies {
|
|
||||||
# NGEN powershell assembly, improves startup time of powershell by 10x
|
|
||||||
$old_path = $env:path
|
|
||||||
try {
|
|
||||||
$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
|
|
||||||
[AppDomain]::CurrentDomain.GetAssemblies() | % {
|
|
||||||
if (! $_.location) {continue}
|
|
||||||
$Name = Split-Path $_.location -leaf
|
|
||||||
if ($Name.startswith("Microsoft.PowerShell.")) {
|
|
||||||
Write-Progress -Activity "Native Image Installation" -Status "$name"
|
|
||||||
ngen install $_.location | % {"`t$_"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
$env:path = $old_path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Optimize-PowershellAssemblies
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
@echo off
|
|
||||||
set check_computername=%COMPUTERNAME%
|
|
||||||
echo "Found computer %check_computername%"
|
|
||||||
|
|
||||||
set PACKAGES="C:\Packages"
|
|
||||||
set WPUBLIC="C:\wPublic"
|
|
||||||
|
|
||||||
echo "Speed up Powershell processing"
|
|
||||||
set PSFILE="%WPUBLIC%\bin\SpeedUp.ps1"
|
|
||||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
|
||||||
|
|
||||||
@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
|
if not exist "C:\Packages" mkdir "C:\Packages"
|
||||||
|
if not exist "C:\Scriptsa" mkdir "C:\Scriptsa"
|
||||||
|
|
||||||
|
cd \packages
|
||||||
curl --ssl-no-revoke -o c:\Packages\wlocal.zip https://git.cabinbagonly.com/mirror/wLocal/archive/main.zip
|
curl --ssl-no-revoke -o c:\Packages\wlocal.zip https://git.cabinbagonly.com/mirror/wLocal/archive/main.zip
|
||||||
curl --ssl-no-revoke -o c:\Packages\wbase.zip https://git.cabinbagonly.com/mirror/wBase/archive/main.zip
|
curl --ssl-no-revoke -o c:\Packages\wbase.zip https://git.cabinbagonly.com/mirror/wBase/archive/main.zip
|
||||||
curl --ssl-no-revoke -o c:\Packages\wpublic.zip https://git.cabinbagonly.com/mirror/wPublic/archive/main.zip
|
curl --ssl-no-revoke -o c:\Packages\wpublic.zip https://git.cabinbagonly.com/mirror/wPublic/archive/main.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user