LoginSignup
0
0

More than 1 year has passed since last update.

Windows10の新規作成メニューにPowerShellスクリプトを追加する

Posted at

はじめに

Explorerの新規作成メニューに「新規 Windows PowerShell スクリプト.ps1」を追加する方法をまとめてみた。

本手順ではユーザ毎に管理されるテンプレートを使用します

手順

1.テンプレートファイルを用意する

1-1.テンプレートフォルダパスを調べる

PowerShell Host にて[Environment]::GetFolderPath("Template")コマンドを実行。

1-2.テンプレートフォルダパスにPoWerShellスクリプトファイルを作成

NewPowerShellScript.ps1
function 動詞-名詞 {
  [CmdletBinding()]
  Param(
  )
  Begin{
  }
  Process{
  }
  End{
  }
}

2.[.ps1]ファイルに新規作成レジストリを追加する

  1. レジストリエディタを開く

  2. 「HKEY_CLASSROOT.ps1」にレジストリキー「ShellNew」を追加

  3. 「ShellNew」に文字列を追加し
    名前:FileName
    値 :NewPowerShellScript.ps1

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