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

Azure MFA with Azure AD and RDS

Failed to delete the test record dcdiag-test-record in zone test.com

Failed to setup initiator portal. Error status is given in the dump data.