本日は、powershellの基本としてコマンドの説明をします。
powershellを知ることで、コマンドプロンプトではできなかったことも
できるようになります。
ちなみに、コマンドは大文字小文字を区別しません。
目次
1.日付の表示 Get-date
Get-date 日付を表示します。

2.ディレクトリの移動 Get-Location Set-Location
Get-Location 現在の位置を表示します。

Set-Location
ディレクトリのパスを指定し、ディレクトリを移動することができます。
下記の例では、「c:\Users\user」に移動し、移動したことを「Get-Location」コマンドで確認しています。

3.ファイルやフォルダの表示 Get-childitem
Get-childitem カレントディレクトリにあるファイルやフォルダを表示します。

4.ファイル、フォルダの作成 New-Item
new-item c:\test -derectory
現在のディレクトリに新しファイルやディレクトリを作成します。
下記の画像は、「test」というフォルダを作成しています。

下記の例では、「test.txt」というファイルを作成しています。

5.ファイル、フォルダのコピー Copy-Item
copy-item -path コピー元 -destination コピー先 -recurse
ファイルやフォルダを別のディレクトリにコピーします。
下記の例では、c:\users\user\testフォルダをc:\へコピーしています。

cドライブの下にtestフォルダが作成されています。

6.ファイル、フォルダの削除 Remove-Item
remove-item -path ファイルやフォルダ名 -recurse
ファイルやフォルダを削除します。
下記の例では、c:\testフォルダを削除しています。
削除後に「Get-Item」コマンドで確認しています。

まとめ
以上、powershellの基本コマンドでした。