F5F Stay Refreshed Software Operating Systems I can assist you with your PowerShell script. Just let me know what you need help with!

I can assist you with your PowerShell script. Just let me know what you need help with!

I can assist you with your PowerShell script. Just let me know what you need help with!

B
BHLxNJx
Posting Freak
881
02-25-2023, 09:09 AM
#1
You're looking to adjust the script so it writes matching results into a text or log file instead of just displaying them. You can redirect the output using redirection operators like `>` or `>>`. For example, replace the `write-Host` lines with `echo` and append to a file:

```powershell
$data = import.csv
Get-Childitem C:\ -recurse -Include $i.Fname | %{Write-Host $_.Fullname} >> log.txt
```

Or use a more structured approach:

```powershell
$data | ForEach-Object {
Get-ChildItem C:\ -Recurse -Include $_.Fullname | Select-Object Fullname
| Where-Object { $_.Name -match ".*bleepingcomputer.com.*" }
| Out-File -FilePath "log.txt" -Append
}
```

This will save matching startup names into `log.txt`.
B
BHLxNJx
02-25-2023, 09:09 AM #1

You're looking to adjust the script so it writes matching results into a text or log file instead of just displaying them. You can redirect the output using redirection operators like `>` or `>>`. For example, replace the `write-Host` lines with `echo` and append to a file:

```powershell
$data = import.csv
Get-Childitem C:\ -recurse -Include $i.Fname | %{Write-Host $_.Fullname} >> log.txt
```

Or use a more structured approach:

```powershell
$data | ForEach-Object {
Get-ChildItem C:\ -Recurse -Include $_.Fullname | Select-Object Fullname
| Where-Object { $_.Name -match ".*bleepingcomputer.com.*" }
| Out-File -FilePath "log.txt" -Append
}
```

This will save matching startup names into `log.txt`.

G
gavin0099
Member
179
02-25-2023, 09:29 AM
#2
Download the latest update from Kaspersky's website for enhanced protection.
G
gavin0099
02-25-2023, 09:29 AM #2

Download the latest update from Kaspersky's website for enhanced protection.

C
connor8c
Member
163
02-25-2023, 10:08 AM
#3
Attempt: $data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | Out-File C:\yourtextdocument.txt or if not: $data = import.csv E:\rootkitstartups.csvforeach ($i in $data){C:\Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname} >> C:\textdoc.txt I have very little knowledge of PowerShell so don't worry if I'm off.
C
connor8c
02-25-2023, 10:08 AM #3

Attempt: $data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | Out-File C:\yourtextdocument.txt or if not: $data = import.csv E:\rootkitstartups.csvforeach ($i in $data){C:\Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname} >> C:\textdoc.txt I have very little knowledge of PowerShell so don't worry if I'm off.