Forum

Author Topic: Starting client from PowerShell  (Read 1972 times)

nngoe

  • Newbie
  • *
  • Posts: 5
    • View Profile
Starting client from PowerShell
« on: July 07, 2017, 09:23:46 PM »
Hi everyone,
we have a small cluster consisting of 10 nodes. For the moment I start each client using the remote desktop which is very time-consuming. My idea was to have a PowerShell script who can do this task. I started playing around but it is still not working as I expected. Maybe it has to do with Start-Process option which behaves differently than starting the client using the cmd.
Here is my current script, would be great if someone has more experience and can help me:

#Start photoscan in server mode
########################################
Start-Process -FilePath "C:/Program Files/Agisoft/PhotoScan Pro/photoscan.exe" -ArgumentList "--server --control 192.168.0.1 --dispatch 192.168.0.1"

# List with all computernames
$computers = Get-Content -Path C:\...\computerliste.txt


#Run Photoscan on remote computers
########################################
$s = New-PSSession -ComputerName $computers -Credential Admin

Invoke-Command -Session $s -ScriptBlock {
Start-Process -FilePath "C:/Program Files/Agisoft/PhotoScan Pro/photoscan.exe" -ArgumentList "--node --dispatch 192.168.0.1 --root Z:/test"
}

tkwasnitschka

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Starting client from PowerShell
« Reply #1 on: September 05, 2017, 04:04:38 PM »
Hi,
you could just throw a batch file starting the nodes into each machines autostart folder? Of course this means they run all the time...
works well for us...
Tom

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Starting client from PowerShell
« Reply #2 on: September 05, 2017, 04:10:40 PM »
When looking for the most appropriate Windows solution I've encountered the following service application:
http://nssm.cc/
Haven't tested it, but it seems to solve the required task, although some first time run tweaking is necessary.
Best regards,
Alexey Pasumansky,
Agisoft LLC