From 9727871912797a7e546cd50cd373100439bfa129 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 21 Jun 2023 21:31:49 +0200 Subject: [PATCH] Only open powershell during for setup --- winfs/Scripts/Setup.ps1 | 10 ---------- winfs/Scripts/{Setup.cmd => Startup.cmd} | 2 +- winfs/Scripts/Startup.ps1 | 14 ++++++++++++++ winfs/Windows/System32/startnet.cmd | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) rename winfs/Scripts/{Setup.cmd => Startup.cmd} (91%) create mode 100644 winfs/Scripts/Startup.ps1 diff --git a/winfs/Scripts/Setup.ps1 b/winfs/Scripts/Setup.ps1 index b1475e7..9ef9ffa 100644 --- a/winfs/Scripts/Setup.ps1 +++ b/winfs/Scripts/Setup.ps1 @@ -1,13 +1,3 @@ -function Invoke-Diskpart { - param ( - $script - ) - - $file = New-TemporaryFile; - $null = Set-Content "$file" "$script"; - & diskpart -s "$file"; -} - $drives = & wmic volume get "DriveLetter,Label"; $drive = $($($drives | Select-String -Pattern "winiso") -split "\s+")[0]; diff --git a/winfs/Scripts/Setup.cmd b/winfs/Scripts/Startup.cmd similarity index 91% rename from winfs/Scripts/Setup.cmd rename to winfs/Scripts/Startup.cmd index d5ecd3e..344523d 100644 --- a/winfs/Scripts/Setup.cmd +++ b/winfs/Scripts/Startup.cmd @@ -5,4 +5,4 @@ rem cls echo. echo Starting windows Setup... -X:\PowerShell\pwsh.exe -ExecutionPolicy bypass -file "X:\Scripts\Setup.ps1" +X:\PowerShell\pwsh.exe -ExecutionPolicy bypass -file "X:\Scripts\Startup.ps1"; diff --git a/winfs/Scripts/Startup.ps1 b/winfs/Scripts/Startup.ps1 new file mode 100644 index 0000000..01fff33 --- /dev/null +++ b/winfs/Scripts/Startup.ps1 @@ -0,0 +1,14 @@ +$null = $env:WIN_COMPUTER_NAME; +$null = $env:SETUP_SCRIPT_NAME; + +Set-ExecutionPolicy Bypass -Scope Process -Force; +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; +Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')); + +Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1; +choco install -y git +choco install -y powershell-core; +refreshenv; +git clone https://git.nuth.ch/manuth/PortValhalla.git; +Set-Location PortValhalla; +pwsh; diff --git a/winfs/Windows/System32/startnet.cmd b/winfs/Windows/System32/startnet.cmd index dbeae2d..876c59b 100644 --- a/winfs/Windows/System32/startnet.cmd +++ b/winfs/Windows/System32/startnet.cmd @@ -1,3 +1,3 @@ wpeinit powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c -X:\Scripts\Setup.cmd +X:\Scripts\Startup.cmd