2017-10-04 11 views
0

私は、次のPowerShellワークフローを実行すると:UNCエラー

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 
} 

私は次のエラーを取得するが、私はまだRスクリプトの結果を得る:

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" 

をしかし、私をStart-LocalRScript script1.Rコマンドを実行してもエラーは発生しません。ワークフローは、RScript.exeがスクリプトのどこにあるのかを指定しても、RScript.exeのネットワークにあるユーザーのローカルパスにアクセスしようとしているようです。Start-LocalRScript誰がここで何が起こっているのか知っていますか?

答えて

0

の代わりにStart-Process-WorkingDirectoryを適切な作業ディレクトリに設定してください。

関連する問題