Exemplo n.º 1
0
        public void Clean()
        {
            using (ChoNetworkShare networkShare = new ChoNetworkShare(RemoteShareName, _networkCredential))
            {
                if (File.Exists(RemoteScriptFilePath))
                {
                    File.Delete(RemoteScriptFilePath);
                }

                if (File.Exists(RemoteScriptInnerFilePath))
                {
                    File.Delete(RemoteScriptInnerFilePath);
                }

                if (File.Exists(RemoteScriptOutputFilePath))
                {
                    File.Delete(RemoteScriptOutputFilePath);
                }

                if (File.Exists(RemoteScriptErrorFilePath))
                {
                    File.Delete(RemoteScriptErrorFilePath);
                }
            }
        }
Exemplo n.º 2
0
        public ChoWinRemoteExecState RunCmd(string[] cmds)
        {
            ChoGuard.ArgumentNotNullOrEmpty(cmds, "Commands");

            ChoWinRemoteExecState winRemoteExecState = new ChoWinRemoteExecState(_remoteMachine, _networkCredential);

            using (ChoNetworkShare networkShare = new ChoNetworkShare(winRemoteExecState.RemoteShareName, _networkCredential))
            {
                CreateScriptOnRemote(cmds, winRemoteExecState);
                RunSriptOnRemote(winRemoteExecState);
                return(winRemoteExecState);
            }
        }