指定されたパスが存在するかどうかを調べるTest-Pathコマンドレットだが、そのマニュアルを読むと、次のように「-PathType」というパラメータが用意されていることがわかる。 「Container」はディレクトリを、「Leaf」がファイルを意味していることがわかる。
Writing to files is one of the most important things you will learn in any new programming language. This allows you to save user data for future reference, to manipulate large data sets, or to build ...
前回作ったスクリプト(test-d_9.ps1)は次の通りだ。 #!/usr/bin/env pwsh # 1つの引数が必要。引数はディレクトリパス。 if (0 -eq ...