What is the easiest way to delete the file on remote computer with powershell if name longer than 260 chars? I have the following code but I am hitting 260 chars limit.
$s = New-PSSession -computername Server1
Invoke-Command -session $s -scriptblock
{Remove-Item "C:\Jenkins\workspace\Long Path with spaces" -force
-recurse}
Remove-PSSession $s