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 setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html