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

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

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

Azure MFA with Azure AD and RDS