When I run the following powershell workflow :
Function Start-LocalRScript {
Param([Parameter(ValueFromPipeline, Mandatory)]$Name)
$ScriptPath = "C:\Exploration.RScripts"
$RScriptExePath = "C:\Program Files\R\R-3.1.2\bin\Rscript.exe"
$scriptPath = Join-Path -Path $ScriptPath -ChildPath $Name
& $RScriptExePath $scriptPath
}
Workflow Get-RScriptWorkflow {
Start-LocalRScript script1.R
}
I get the following error but I still get the result of the R script:
Rscript.exe : '\\srvuser01\profil\myUser\Documents' At Get-RScriptWorkflow:2 char:2
+ CategoryInfo : NotSpecified ('\\srvuser01\profil\myUser\Documents':String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
+ PSComputerName : [localhost]
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
[1] "from script 1"
But when I run the command Start-LocalRScript script1.R there is no error. It seems that the workflow is trying to access the local path of my user that is in the network for the RScript.exe even though I specify where RScript.exe is on the script Start-LocalRScript. Does anyone know what is going on here?