Odd. I went back to using just the basics: ps.AddCommand("Get-SvnRepository"); Collection<PSObject> output = ps.Invoke();
And now it's working. Initially, it told me it found the command in a module that hadn't been imported yet. But now it's working. So that's a bit weird. On Tuesday, February 27, 2018 at 2:21:10 PM UTC-7, Adam Humpherys wrote: > > I found one old message (from 2008) that asked for an API And I'm curious > if this is in consideration. > > We're building some automation tools to free up some developer time for > managing SVN repositories in VisualSVN. I've been trying to use the > PowerShell cmdlets from within a Windows service but it's not working very > well. > > But maybe if I can figure out what's wrong with the PowerShell execution > then that will be good enough. > > > using (PowerShell ps = PowerShell.Create()) > { > var psSession = InitialSessionState.Create(); > psSession.ImportPSModule(new string[] { "VisualSVN" }); > var ps_rSpace = RunspaceFactory.CreateRunspace(psSession); > ps_rSpace.Open(); > var ps_invoker = new RunspaceInvoke(ps_rSpace); > > Collection<PSObject> output = ps_invoker.Invoke("Get-SvnRepository"); > } > > at ps_rSpace.Open() I get an error: > > Cannot process Cmdlet Definition XML for the following file: C:\Program > Files\VisualSVN Server\PowerShellModules\VisualSVN\SvnRepository.cdxml. > Value cannot be null. > Parameter name: key ---> System.Xml.XmlException: Cannot process Cmdlet > Definition XML for the following file: C:\Program Files\VisualSVN > Server\PowerShellModules\VisualSVN\SvnRepository.cdxml. Value cannot be > null. > Parameter name: key ---> System.ArgumentNullException: Value cannot be > null. > > I just upgraded to VisualSVN Server 3.8.0. > > The Windows service will have a web interface/rest api so we can hook up > our dashboard to it. Any ideas? > > Thanks. > -- You received this message because you are subscribed to the Google Groups "VisualSVN" group. To unsubscribe from this group and stop receiving emails from it, send an email to visualsvn+unsubscr...@googlegroups.com. To post to this group, send email to visualsvn@googlegroups.com. Visit this group at https://groups.google.com/group/visualsvn. For more options, visit https://groups.google.com/d/optout.