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?





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


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...