powershell – Script to copy Egde-Chromium browsing history from a remote machine. Try-catch, custom object building

There are some Kiosk machines for people to take a survey. The survey is running by a 3rd party, so no way to get the data from them. To measure how much machines are in use I wrote a script to pull Edge-Chromium browsing history from a remote machine

function Copy-FileRemotely
{
    (CmdletBinding())
    param
    (
        (Parameter(Mandatory = $true,
                   Position = 0))
        (string)$ComputerName
    )
    
    try
    {       
        $isSuccess = $true
        $Message = Copy-Item -Path "\$ComputerNamec$UsersSMZSurvey2AppDataLocalMicrosoftEdgeUser DataDefaultHistory" -Destination $PSScriptRoot$ComputerName -Force -ErrorAction Stop -PassThru
    }
    catch
    {
        $isSuccess = $false
        $Message = ($_.Exception).Message
    }
    return (pscustomobject)@{
        'ComputerName'   = $ComputerName
        'isSuccess'      = $isSuccess
        'Message'        = $Message
        
    }
    
}

$comps = "smz-F9246-DB", "xxx"
$result = @()
foreach ($comp in $comps)
{
    $result += Copy-FileRemotely $comp
}
$result | Out-GridView
sleep 10
```