piping a path into Set-Location


im searching file , trying change current working directory path file.

ive tried following:

set-location |get-childitem -recurse |where-object{$_.name -match "filename*"}| select directory

get-childitem -recurse |where-object{$_.name -match "filename*"}| select directory| set-location

 

neither work. can advise me how directory name get-childitem, without header, , pipe into  set-location?

 

get-childitem -recurse |where-object{$_.name -match "filename*"}| set-location -path {$_.directory} 




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Group policy default policy cannot be edited because network name not found

Problem when changing update source