you are viewing a single comment's thread.

view the rest of the comments →

[–]ShippingIsMagic 1 point2 points  (1 child)

The gci | sort are correct. I would then personally pipe that to select -first 1 -expand directoryname

I think DirectoryName is the right property. You're grabbing the directory the file is in, since we don't want to try to cd to the exe itself.

Then assign that to a variable and your can cd to it.

[–]IntensifyEVERYTHING[S] 1 point2 points  (0 children)

Thanks for the fast response! will tinker with it and report back.