2024-11-08 12:38:20 +01:00
|
|
|
The *install-octoprint.ps1* Script
|
|
|
|
===========================
|
2023-09-01 17:53:03 +02:00
|
|
|
|
|
|
|
install-octoprint.ps1
|
|
|
|
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
----------
|
|
|
|
```powershell
|
|
|
|
|
|
|
|
|
|
|
|
[<CommonParameters>]
|
|
|
|
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
|
|
|
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
|
|
|
```
|
|
|
|
|
|
|
|
Script Content
|
|
|
|
--------------
|
|
|
|
```powershell
|
|
|
|
|
|
|
|
try {
|
|
|
|
"⏳ Installing OctoPrint (snap 'octoprint-pfs', channel 'edge')..."
|
|
|
|
|
|
|
|
& sudo snap install octoprint-pfs --edge
|
|
|
|
if ($lastExitCode -ne "0") { throw "'snap install octoprint-pfs' exited with code $lastExitCode" }
|
|
|
|
|
|
|
|
"HINT: Access Octoprint's web login at: http://<HOSTNAME>:5000"
|
|
|
|
exit 0 # success
|
|
|
|
} catch {
|
|
|
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-11-20 11:52:20 +01:00
|
|
|
*(generated by convert-ps2md.ps1 as of 11/20/2024 11:51:54)*
|