Invoke-Command is not helping me anymore..

Brass Contributor

Team ,

 

I need a solution here , I am trying to connect my VM which is running in Hyper-V and I would like to deploy some of the scripts which will run automatically inside the VM and then it will create a text file which I would like to export it to the base machine .

 

I was trying the same with Invoke-Command . I don't know the other work around .

 

Need your help to get this thing done ASAP .

 

Regards ,

Manas Saha

2 Replies

https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

 

Make shure the VM and abse machine are on the same network, that the VM is not set to be on a private network. Then powershell remotign should work. Or you could run the script from a VM and output to a networkdrive.

 

Hope this helps

PowerShell Direct should help you do this. It allows you to run PowerShell from the host inside the VM guests. Windows 10 and/or Server 2016 is required.

 

https://blogs.technet.microsoft.com/virtualization/2015/05/14/powershell-direct-running-powershell-i...