LoginSignup
0
8

More than 5 years have passed since last update.

PowerShell 初期設定

Last updated at Posted at 2017-02-25

管理者権限で PowerShell を起動する。

Start-Process -verb runas powershell

ポリシーを変更する。

Set-ExecutionPolicy RemoteSigned

コマンドレットのヘルプを更新する。

Update-Help

プロファイルを作成する。

$profile_directory=$(Split-Path -Parent $profile)
New-Item -ItemType Directory $profile_directory
New-Item $profile

スクリプト用ディレクトリを作成する。

$script_directory="$(Split-Path -Parent $profile)\script"
New-Item -ItemType Directory $script_directory

スクリプト用ディレクトリへパスを通す。

profile.ps1
$script_directory="$(Split-Path -Parent $profile)\script"
$env:Path=$env:Path+";"+$script_directory

.ps1 ファイルでコマンドを作り、スクリプト用ディレクトリへ格納すると、
Linux の /usr/local/bin へ格納した .sh ファイルと
同じ感覚で使用することができる。

0
8
2

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
8