From 81f89c9484963c7d56ba032827c56265f782ed62 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 2 Jun 2025 18:52:24 +0200 Subject: [PATCH] Updated install-crystal-disk-info.ps1 --- scripts/install-crystal-disk-info.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/install-crystal-disk-info.ps1 b/scripts/install-crystal-disk-info.ps1 index 9f79a4fd..510fda6d 100755 --- a/scripts/install-crystal-disk-info.ps1 +++ b/scripts/install-crystal-disk-info.ps1 @@ -12,14 +12,16 @@ #> try { - "Installing CrystalDiskInfo, please wait..." + "⏳ Installing CrystalDiskInfo from Microsoft Store, please wait..." + $stopWatch = [system.diagnostics.stopwatch]::startNew() & winget install "CrystalDiskInfo" --source msstore --accept-package-agreements --accept-source-agreements - if ($lastExitCode -ne 0) { throw "'winget install' failed" } + if ($lastExitCode -ne 0) { throw "Can't install CrystalDiskInfo, is it already installed?" } - "CrystalDiskInfo installed successfully." + int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "✅ CrystalDiskInfo installed successfully in $($elapsed)s." exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Error: $($Error[0])" exit 1 }