Reputation: 361
I have on e diretory like this in a remote server:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 15-04-2014 14:44 custerr
d----- 31-10-2014 16:04 ftproot
d----- 07-01-2019 12:02 history
d----- 31-10-2014 11:36 logs
d----- 05-08-2014 16:50 mailroot
d----- 15-04-2014 14:45 temp
d----- 05-05-2017 15:09 wwwroot
-a---- 14-03-2018 14:42 14524 cdbase.asp
-a---- 17-10-2017 14:49 14186 cdbase.asp.bak
-a---- 25-11-2014 12:39 11150 cdbase.asp~
-a---- 23-08-2018 15:04 91 cienciaVitaeConf.asp
-a---- 26-01-2017 17:26 7459 functions.asp
and i need to get only the files of inetpub(parent) and files diretory wwwroot
d----- 05-05-2017 15:09 wwwroot > all files inside
-a---- 14-03-2018 14:42 14524 cdbase.asp
-a---- 17-10-2017 14:49 14186 cdbase.asp.bak
-a---- 25-11-2014 12:39 11150 cdbase.asp~
-a---- 02-03-2016 16:06 13630 cdbase_TESTES.asp
-a---- 23-08-2018 15:04 91 cionf.asp
-a---- 26-01-2017 17:26 7459 functions.asp
Missing something in my code:
Get-ChildItem -Path \\SIGQUAL\inetpub -File -Include wwwroot | Select-String -Pattern '192.*'
Thanks for any help
Upvotes: 1
Views: 33
Reputation: 174465
Just do two queries:
@(
Get-ChildItem -Path \\SIGQUAL\inetpub\wwwroot -File
Get-ChildItem -Path \\SIGQUAL\inetpub -File
) | Select-String -Pattern '192.*'
Upvotes: 1