2017-07-25 4 views

Antwort

1
$dir = '.' # specify the directory to investigate 
$hasAnySubdir = (Get-ChildItem -Force -Directory $dir).Count -gt 0 

-Directory (PSV3 +) sorgt dafür, dass Get-ChildItem aufzählt nur sub- Verzeichnisse und -Force sorgt dafür, dass auch versteckt Verzeichnisse enthalten sind.

Verwandte Themen