Running powershell script from cmd.exe
i using tool, connects remote host , can use execute commands on cmd.exe . gives me output on command line.
when try run powershell script in following way,
cmd /c ""powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'"""" interpreted on command line of remote host
powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'" syntactically correct because can execute same on machine having powershell installed correctly, can see output on cmd line..
but here problem when remotly execute same command i.e. powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'" command prompt doen not receive output remote command , keeps on waiting output , timeouts.
does prowershell behaviour on cmdline different other commands?
anybody, idea?
when try run powershell script in following way,
cmd /c ""powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'"""" interpreted on command line of remote host
powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'" syntactically correct because can execute same on machine having powershell installed correctly, can see output on cmd line..
but here problem when remotly execute same command i.e. powershell "& 'c:\users\xxxxxx\desktop\abc.ps1'" command prompt doen not receive output remote command , keeps on waiting output , timeouts.
does prowershell behaviour on cmdline different other commands?
anybody, idea?
hi,
can report here command used winrs ? maybe easier :)
before that, can check theses things :
- powershell profile not load (-noprofile)
- powershell not executed in interactive mode (-noninteractive)
- move target script in other folder (example : c:\test)
grégory schiro powershell , mof http://scriptingof.blogspot.com
can report here command used winrs ? maybe easier :)
before that, can check theses things :
- powershell profile not load (-noprofile)
- powershell not executed in interactive mode (-noninteractive)
- move target script in other folder (example : c:\test)
grégory schiro powershell , mof http://scriptingof.blogspot.com
Windows Server > Windows PowerShell
Comments
Post a Comment