Fix Powershell code to list all running processes including Path, Product name and Copyright strings

Job ID: 37202073

Budget: $30 – $250 AUD

I am looking for a skilled Powershell developer to fix my code. The code currently does not output the Product name and Copyright strings of the running processes.

Requirements:
- Must have experience with Powershell 7
- The output should include both the running processes and their corresponding details, including the Path, Product name, and Copyright strings.

Here's the current PS version:

$processes = Get-Process | Where-Object { $_.Path }

$results = @()

foreach ($process in $processes) {
try {
$properties = Get-ItemProperty -Path $process.Path

$result = New-Object PSObject -Property @{
"ProcessName" = $process.ProcessName
"Path" = $process.Path
"ProductName" = $properties.ProductName
"Copyright" = $properties.Copyright
}

$results += $result

} catch {
# Handle any errors in fetching the properties, continue to the next process
}
}

$results | Format-Table -AutoSize ProcessName, Path, ProductName, Copyright
Related categories: Shell Script Powershell