mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02: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 {
|
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
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
c<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Uninstalls One Calendar
|
Uninstalls One Calendar
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script uninstalls One Calendar from the local computer.
|
This PowerShell script uninstalls One Calendar from the local computer.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./uninstall-one-calendar
|
PS> ./uninstall-one-calendar.ps1
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -12,12 +12,14 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
"Uninstalling One Calendar, please wait..."
|
"⏳ Uninstalling One Calendar ..."
|
||||||
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
& winget uninstall "One Calendar"
|
& winget uninstall "One Calendar"
|
||||||
if ($lastExitCode -ne "0") { throw "Can't uninstall One Calendar, is it installed?" }
|
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
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user