Here's my issue. I'm trying to figure out how to hide a parent director and all the subdirectories I created with powershell. Here's the code that I'm using...
$f=ni -ItemType Directory -Path 'C:[name][name][name]\' -Force
$f.attributes = 'Hidden'
 My problem is that it will only hide that very last folder and not the entire path. Please help I'm out of hair and teeth.

$f=ni -ItemType Directory -Path 'C:[name][name][name]\' -Force
$f.attributes = 'Hidden'

$f=ni -ItemType Directory -Path 'C:[name][name][name]\' -Force
$f.attributes = 'Hidden'

Expected result is to have the parent and subdirectories hidden. What actually happens is only the last subdirectory is hidden.