LoginSignup
40
77

More than 5 years have passed since last update.

Powershellコマンド集

Posted at

ずっとPowerShellを知らずにコマンドプロンプトを使ってWindows機器の調査などしてきたが、Powershellを知ってから一気に調査の幅が広がった。Linuxを経験してきた僕に取っては(コマンドプロンプトに比べて)PowerShellの方がずっと直観的にできるので、ずっと良い。

コマンドプロンプトのコマンド集は下記参照。
Windows コマンドプロンプトの調査で良く使うコマンドまとめ

基本関連

ディレクトリ移動(cd又はドライブ指定)

cd ディレクトリ
C:

Cドライブへ

D:

Dドライブへ

現在フォルダの把握(pwd)

pwd

ファイル一覧取得(ls)

ls

コマンド一覧取得(get-command)

get-command

ファイルを開く(cat)

cat test.txt

ヘルプ(help)

help get-command

ネットワーク関連

ピング(ping)

ping google.com

tracert

tracert google.com

IPアドレス情報取得(ifconfig)

ifconfig /all

グループポリシーアップデート(gpupdate)

gpupdate /force

対象デバイス関連

 ユーザー名取得

[System.Security.Principal.WindowsIdentity]::GetCurrent().Name

参照元: PowerShellで現在のユーザやグループなどのID情報を取得する方法

ホスト名取得(hostname)

hostname

MACアドレス取得(getmac)

getmac

システム情報一覧(systeminfo)

systeminfo

ただし、表示に時間がかかる。

OS/BIOS取得(syteminfo)

systeminfo | findstr /C:"OS Name"

WindowsUpdate表示

control /name Microsoft.WindowsUpdate

アプリ管理(追加、削除)表示

appwiz.cpl

現在日時(date)

date

Wi-Fiの設定関連

基本コマンド(netsh)

netsh wlan

様々なコマンドがあるので、詳細なコマンドは別途

あるプロファイルの設定を見る

netsh wlan show profile name="guest-WiFi"

あるプロファイルの設定のためのプロパティ情報一覧を取得

netsh wlan set profileparameter

例)プロファイルのキャッシュ設定をオフにする

netsh wlan set profileparameter name=guest-WiFi cacheUserData=no

プロファイルの設定をエクスポートする

netsh wlan export profile name=guest-WiFi folder="C:¥"

プロファイルの設定をインポートする

netsh plan add profile filename="C:¥Wi-Fi-guest-WiFi.xml"

コマンドは随時更新予定

40
77
1

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
40
77