mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-30 01:28:51 +01:00
Updaate uninstall-one-calender.ps1
This commit is contained in:
parent
9f45904cb4
commit
68decf6c89
@ -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])"
|
||||
|
@ -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])"
|
||||
|
Loading…
Reference in New Issue
Block a user