Why does PowerShell asks me for Credentials to access a remotecomputer, after I already put in the password for my $PW variable and created the correct PSCredential
$PW
You need to declare the parameters inside the Invoke-Command scriptblock:
Invoke-Command
foreach ($c in $ComputerName) { Invoke-Command -ComputerName $c -Credential $cred -ArgumentList $cred,$UNCexepath { param($cred,$UNCexepath) Start-Process -Filepath $UNCexepath -Credential $cred -Verb RunAs } }}