Replace osk with cmd during debugging

This commit is contained in:
Manuel Thalmann 2024-08-21 18:33:41 +02:00
parent 33e7afacda
commit 0f31a80d2a

View file

@ -46,6 +46,20 @@ $null = New-Module {
break;
}
([SetupStage]::Initialize) {
if ($env:DEBUG) {
& {
$sys32 = "$env:WINDIR/System32";
$osk = "$sys32/osk.exe";
$cmd = "$sys32/cmd.exe";
if ((Get-FileHash $osk) -ne (Get-FileHash $cmd)) {
Rename-Item $osk "${osk}_";
Copy-Item $cmd $osk;
continue;
}
};
}
if (-not ((Test-Command "choco") -and (Test-Command "refreshenv"))) {
Invoke-Hook "Install-Chocolatey" -Fallback {
# Install chocolatey