0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows10×Minecraft1.19.4×MinecraftDiscordChatSync1.2.2

Last updated at Posted at 2023-04-10

参考にしたサイト

・Gakuto1112/MinecraftDiscordChatSync: マインクラフトとDiscordのチャット等を相互的に送受信できるDiscordのBotです。
・PowerShellでこのシステムではスクリプトの実行が無効になっているため、ファイル hoge.ps1 を読み込むことができません。となったときの対応方法

環境

Windows10
Node.js v16.13.11

躓いたところ

ts-node MinecraftDiscordChatSync.tsを実行したところ下記のエラーが発生
ts-node : このシステムではスクリプトの実行が無効になっているため、ファイル C:\Program Files\nodejs\ts-node.ps1 を読み込
むことができません。詳細については、「about_Execution_Policies」(https://go.microsoft.com/fwlink/?LinkID=135170) を参照
してください。
発生場所 行:1 文字:1
ts-node MinecraftDiscordChatSync.ts
+ CategoryInfo : セキュリティ エラー: (: ) []、PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

解決方法

実行ポリシーを確認する
C:> Get-ExecutionPolicy
Restricted

実行ポリシーの変更
(書き方)Set-ExecutionPolicy -ExecutionPolicy <実行ポリシー> -Scope <スコープ>
C:> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
実行ポリシーは、信頼されていないスクリプトからの保護に役立ちます。実行ポリシーを変更すると、about_Execution_Policies のヘルプ トピック
(https://go.microsoft.com/fwlink/?LinkID=135170) で説明されているセキュリティ上の危険にさらされる可能性があります。実行ポリシーを変更しますか?
[Y] はい(Y) [A] すべて続行(A) [N] いいえ(N) [L] すべて無視(L) [S] 中断(S) [?] ヘルプ (既定値は "N"): y

実行ポリシーを確認する
C:> Get-ExecutionPolicy
RemoteSigned

以下 setting.json

{
    "minecraftVersion": "1.19.3",
    "pathToLogFile": "../logs/latest.log",
    "logEncode": "utf-8",
    "timeOffset": 9,
    "embeds": {
        "advancements": true,
        "playerJoin": true,
        "playerLeave": true
    },
    "rconPort": 25575,
    "rconPassword": "任意",
    "token": "任意",
    "botSendChannels": [
        "任意"
    ],
    "botWatchChannels": [
        "任意"
    ],
    "discordMessageDisplay": {
        "ignoreBots": true,
        "displayRoleColor": true,
        "showChannelName": true,
        "useRichText": true,
        "showAttachments": true
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?