windows - Remote complex command not recognized in Powershell PSSession through script -


I am trying to write a small power script to complete some networking integration for the software I am working on. .

I have both RunnySoft 4.0 running between Win7 and Win8, and connection functions, and manual manipulation and execution are allowed between 4 machines.

However, when I try and write a script to automate the process, start misbehaving.

I

  F: \ folder \ App.exe /xLICENSE.txt  code>  

on any type of machine Takes command line input from .exe / xLICENSE.txt and creates a file named LICENSE.txt in the home directory with a unique user handle to use some application processes.

If I manually enter a new PSSession with a computer hosting App.exe, then I can enter that order as per the usual form, and it executes the application, and the right Generates results.

However, I try to integrate this C omp in a script, it keeps telling me that the command has not been recognized as any command or CMDlet.

I have tried

  $ connection = new-Pssession- Computation Name NAME - Credential Log In Hour-Command-session $ Connection- ScriptBlock {& amp; Remove "F: \ folder \ App.exe /xLICENSE.txt"} - PSSession $ connection  

but it only tells me the error mentioned earlier. I have also taken the command out of quotes, and & amp; Also, command command (at least in quotes) and

and I also line

  come-command-computer name NAME -ScriptBlock {& Amp; "F: \ folder \ App.exe /xLICENSE.txt"} - Credential Login  

And that also does not work. I have also tried various ways of using strings in terms of command, and I have also tried to pass the stroke as the parameter of the invoice-command CMDlet, but nothing is working.

If I do this manually IVE-command does not work ...

If I delete the / x logic, the script executes, but it There is no way to prove that it did. If I do this with one of the above CMDlet, say, Get-ChildItem, then it will correctly display the contents of the server's home directory connecting to the server.

I just lost as I could about this. I had high hopes for PowerShell, but if I can not do it to do this, then it would be difficult ...

Thank you!

I have decided that after a lot of trial and error, I decided that even if I app I am fully declaring the exe command, I have to change the working directory in the script before executing it. While working at the local level I do not have to do this, but I need to do it on the network for any reason. It works fine now, and I can continue whatever I was doing! I'm still having trouble executing remote commands stored in stars, but this is a topic for another time.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -