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

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -