Jump to content

How to run a Powershell command


VeeDub
 Share

Go to solution Solved by VeeDub,

Recommended Posts

Hello,

I've had a look at some previous questions, but the responses / examples aren't working for me.

I am trying to run vmconnect

If I enter the following at a command prompt it works

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\ZEN\ALR\Connect_VM.ps1

If I try this in AutoIt, nothing happens

Run("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\ZEN\ALR\Connect_VM.ps1", "", @SW_ENABLE)

Would appreciate some troubleshooting suggestions

Thanks

VW

Link to comment
Share on other sites

  • Solution

Hello,

I couldn't get Powershell to work.

Ended up getting this to work, so thought I would share it.

Local $HyperV_Host = "HyperV-Host"
    Local $HyperV_VM = "VM"

    Run(@ComSpec & " /k " & "C:\Windows\Microsoft.NET\assembly\GAC_64\vmconnect\v4.0_10.0.0.0__31bf3856ad364e35\vmconnect.exe " _
    & $HyperV_Host & " " & $HyperV_VM,"",@SW_HIDE)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...