Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Need to call multiple powershell commands from cmd (dos)

$
0
0

Good morning! I am working on a project with splunk and am writing an application that will inventory my systems. I of course find PS to be beyond featured to perform this task, but I need to call it from a cmd shell (not powershell) because splunk will only run bat files. SO my question; Can I run a block of powershell command in a bat file? Like:

 

@powershell -Command "{

command1

command2

write-output 1

write-output 2 }"

Or something like this?!?!

Thanks in advance for helping me out.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles