mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-07 21:46:52 +02:00
Updated install-crystal-disk-info.ps1
This commit is contained in:
parent
5ad6815eba
commit
81f89c9484
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user