mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 04:29:01 +01:00
I don't know why if I replace old, system builtin powershell executable with powershell 7, scripts fail with this error: The argument 'Set-Item -Path ...' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Adding -Command at the end of flags just fixed it. Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
24 lines
669 B
Batchfile
24 lines
669 B
Batchfile
@echo off
|
|
:: Try to get powershell to launch Trilium since it deals with UTF-8 characters in current path
|
|
:: If there's no powershell available, fallback to unicode enabled command interpreter
|
|
|
|
WHERE powershell.exe > NUL 2>&1
|
|
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
|
|
|
|
:POWERSHELL
|
|
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0; ./trilium.exe"
|
|
GOTO END
|
|
|
|
:BATCH
|
|
:: Make sure we support UTF-8 characters
|
|
chcp 65001
|
|
|
|
:: Get Current Trilium executable directory and compute data directory
|
|
SET DIR=%~dp0
|
|
set NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
cd "%DIR%"
|
|
start trilium.exe
|
|
GOTO END
|
|
|
|
:END
|