PortValhalla/scripts/Windows/Software/Nextcloud/Manage.ps1

21 lines
739 B
PowerShell

. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
function Restore-Nextcloud([Context] $context) {
if (-not (choco list --exact nextcloud-client)) {
choco install nextcloud-client -y --params="'/KeepUpdateCheck'";
}
$null = Invoke-WebRequest https://valid-isrgrootx1.letsencrypt.org/;
while (-not (Test-Path $context.GetNextcloudConfigFile())) {
Write-Host "Nextcloud has been installed!";
Read-Host "Please log in in the Nextcloud app and hit enter to continue";
if (-not (Test-Path $context.GetNextcloudConfigFile())) {
Write-Error "The login seems to have failed. Please try again.";
}
}
}
}