PowerShell/docs/install-evcc.md

81 lines
2.0 KiB
Markdown
Raw Normal View History

2024-01-25 13:37:12 +01:00
Script: *install-evcc.ps1*
========================
2023-05-26 12:20:18 +02:00
This PowerShell script installs evcc. Sevcc is an extensible EV Charge Controller with PV integration implemented in Go. See https://evcc.io for details.
2023-07-29 10:04:38 +02:00
Parameters
----------
2023-05-26 12:20:18 +02:00
```powershell
2024-11-08 12:35:11 +01:00
/home/markus/Repos/PowerShell/scripts/install-evcc.ps1 [<CommonParameters>]
2023-05-26 12:20:18 +02:00
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
2023-07-29 10:04:38 +02:00
Example
-------
2023-05-26 12:20:18 +02:00
```powershell
2023-08-06 21:36:33 +02:00
PS> ./install-evcc.ps1
2023-05-26 12:20:18 +02:00
```
2023-07-29 10:04:38 +02:00
Notes
-----
2023-05-26 12:20:18 +02:00
Author: Markus Fleschutz | License: CC0
2023-07-29 10:04:38 +02:00
Related Links
-------------
2023-05-26 12:20:18 +02:00
https://github.com/fleschutz/PowerShell
2023-07-29 10:04:38 +02:00
Script Content
--------------
2023-05-26 12:20:18 +02:00
```powershell
<#
.SYNOPSIS
Installs evcc
.DESCRIPTION
This PowerShell script installs evcc. Sevcc is an extensible EV Charge Controller with PV integration implemented in Go. See https://evcc.io for details.
.EXAMPLE
2023-08-06 21:36:33 +02:00
PS> ./install-evcc.ps1
2023-05-26 12:20:18 +02:00
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) {
"⏳ (1/6) Installing necessary packets..."
& sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
"⏳ (2/6) Installing keyring for evcc..."
& curl -1sLf 'https://dl.cloudsmith.io/public/evcc/stable/setup.deb.sh' | sudo -E bash
"⏳ (3/6) Updating packet list...."
& sudo apt update
"⏳ (4/6) Installing evcc packet..."
& sudo apt install -y evcc
"⏳ (5/6) Configuring evcc..."
& evcc configure
"⏳ (6/6) Starting evcc Web server on :7070 as system service..."
& sudo systemctl start evcc
} else {
throw "Sorry, only Linux installation currently supported"
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
2024-11-08 12:35:11 +01:00
"✅ evcc installed successfully in $Elapsed sec"
2023-05-26 12:20:18 +02:00
exit 0 # success
} catch {
"Sorry: $($Error[0])"
exit 1
}
```
2024-11-08 12:35:11 +01:00
*(generated by convert-ps2md.ps1 using the comment-based help of install-evcc.ps1 as of 11/08/2024 12:34:49)*