Appveyor moved function into scriptblock

This commit is contained in:
Gator96100 2020-09-18 16:45:09 +02:00
parent cf1b12a640
commit 2d6a6ba5d9

View file

@ -65,13 +65,13 @@ clone_script:
}
}
Function WSLExec($Text, $Cmd) {
Write-Host "$Text" -NoNewLine
wsl -- bash -c $Cmd
Write-Host "[ OK ]" -ForegroundColor Green
}
$WSLjob = Start-Job -Name WSLInstall -ScriptBlock {
Function WSLExec($Text, $Cmd) {
Write-Host "$Text"
wsl -- bash -c $Cmd
Write-Host "$Text[ OK ]" -ForegroundColor Green
}
$WSLInstallTime=[System.Environment]::TickCount
WSLExec "WSL update..." "sudo apt-get update 1>/dev/null"
WSLExec "WSL upgrade..." "sudo apt-get upgrade -y 1>/dev/null"
@ -81,8 +81,6 @@ clone_script:
Add-AppveyorMessage -Message "WSL setup took $(([System.Environment]::TickCount-$WSLInstallTime) / 1000) sec" -Category Information
}
Receive-Job -Job $WSLjob
Write-Host "Removing ProxSpace..." -NoNewLine
$PSInstallTime=[System.Environment]::TickCount
@ -92,6 +90,8 @@ clone_script:
Remove-Item -Recurse -Force -Path $env:proxspace_path
Write-Host "[ OK ]" -ForegroundColor Green
Receive-Job -Job $WSLjob
Write-Host "Download ProxSpace..." -NoNewLine
@ -101,6 +101,8 @@ clone_script:
Write-Host "[ OK ]" -ForegroundColor Green
Receive-Job -Job $WSLjob
Write-Host "Extracting ProxSpace..." -NoNewLine
Expand-Archive -LiteralPath "$env:proxspace_zip_file" -DestinationPath "\"
@ -109,6 +111,8 @@ clone_script:
Write-Host "[ OK ]" -ForegroundColor Green
Receive-Job -Job $WSLjob
Write-Host "Renaming ProxSpace folder..." -NoNewLine
Get-ChildItem -Path "\$env:proxspace_zip_folder_name" | Rename-Item -NewName (Split-Path $env:proxspace_path -Leaf)