Updaate uninstall-one-calender.ps1

This commit is contained in:
Markus Fleschutz 2023-08-24 13:45:27 +02:00
parent 9f45904cb4
commit 68decf6c89
2 changed files with 12 additions and 5 deletions

View File

@ -27,7 +27,12 @@ function ListScripts { param([string]$FilePath)
}
try {
ListScripts "$PSScriptRoot/../Data/scripts.csv" | Format-Table -property No,Script,Description
# ListScripts "$PSScriptRoot/../Data/scripts.csv" | Format-Table -property No,Script,Description
$files = Get-ChildItem -path "./*.ps1" -attributes !Directory
foreach ($file in $files) {
$help = Get-Help $file -full
Write-Output "$($file.Name),$($help.Synopsis),"
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,10 +1,10 @@
c<#
<#
.SYNOPSIS
Uninstalls One Calendar
.DESCRIPTION
This PowerShell script uninstalls One Calendar from the local computer.
.EXAMPLE
PS> ./uninstall-one-calendar
PS> ./uninstall-one-calendar.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -12,12 +12,14 @@
#>
try {
"Uninstalling One Calendar, please wait..."
"⏳ Uninstalling One Calendar ..."
$StopWatch = [system.diagnostics.stopwatch]::startNew()
& winget uninstall "One Calendar"
if ($lastExitCode -ne "0") { throw "Can't uninstall One Calendar, is it installed?" }
"One Calendar is uninstalled now."
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ Removal of One Calendar tool $Elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"