I'm putting together a script to go to a bunch of domain computers and copy a file.
My code is:
Get-ChildItem -Path \\$computer -Filter $filename -Recurse -ErrorAction SilentlyContinue | Select-Object Directory -outvariable $directory
Now my problem is the result that is stored in the variable is @{Directory=\\Computer\dir
How do i make it output to the variable only the \\Computer\dir
Any help or guidance would be appreciated