test-path powershell remote computer code example
Example: powershell test-path remote computer
$cred = Get-Credential
Invoke-Command -ComputerName Computer1 -Credential $cred -ScriptBlock { Test-Path "C:\Temp\test.txt" }
$cred = Get-Credential
Invoke-Command -ComputerName Computer1 -Credential $cred -ScriptBlock { Test-Path "C:\Temp\test.txt" }