Convert string to directory object in PowerShell -


i read strings line line file (using get-content , foreach loop), want convert strings directory objects (so can access properties .fullname). how convert string directory?

with files easy: $myfileasfile = $myfileasstr | dir $_, however, how obtain goal $directoryasstring?

okay, answer seems get-item:

$dirasstr = '.\documents' $dirasdir = get-item $dirasstr echo $dirasdir.fullname 

works!


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -