I'm trying to execute remote command which echoes some text to a network share, but getting an error:
"PermissionDenied:[Add-Content] UnauthorizedAccessException".
The actual command is:
Invoke-Command -ComputerName $MyWorkstation -ScriptBlock { Add-Content \\server\C$\Scripts\1.txt -Value "My Test"}
Tried also "Out-File" with the same result. NTFS permissions are OK.