Only open powershell during for setup

This commit is contained in:
Manuel Thalmann 2023-06-21 21:31:49 +02:00
parent a80ac15677
commit 9727871912
4 changed files with 16 additions and 12 deletions

View file

@ -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];

View file

@ -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";

14
winfs/Scripts/Startup.ps1 Normal file
View file

@ -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;

View file

@ -1,3 +1,3 @@
wpeinit
powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
X:\Scripts\Setup.cmd
X:\Scripts\Startup.cmd