Powershellを使ってdirコマンドを実行したのですが、「/s」 オプション : パス が存在しないため検出できません。 エラーがでました。
PS e:\> dir /s
dir : パス 'e:\s' が存在しないため検出できません。
発生場所 行:1 文字:1
+ dir /s
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (e:\s:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
ちなみにこのコマンドはよく使います。
https://learn.microsoft.com/ja-jp/windows-server/administration/windows-commands/dir
どうも「スラッシュ/」がよくないようです。
ということで、「スラッシュ/」の代わりに「ハイフン -」を使うとエラーなく表示させることができました。
dir -s
コマンドプロンプトでOKだけどPowerShellでNGになることがあります。
|