none
Is it possible to write a script to create a testfile on a virtual machine? RRS feed

  • Question

  • How can you make a Powershell script which allows you to create a test-/text file  on a virtual machine on Hyper-V?
    • Edited by JeremySky Wednesday, February 17, 2016 1:12 PM
    Wednesday, February 17, 2016 1:07 PM

Answers

All replies

  • New-Item \\machine\c$\temp\file.txt -ItemType File


    \_(ツ)_/


    • Edited by jrv Wednesday, February 17, 2016 1:22 PM
    • Proposed as answer by Mike Laughlin Wednesday, February 17, 2016 1:50 PM
    • Marked as answer by JeremySky Wednesday, February 17, 2016 1:56 PM
    Wednesday, February 17, 2016 1:21 PM
  • Ok, awesome I got a server called MyServer and a virtual machine called CleanW81 in Hyper-V manager, but
    New-Item \\CleanW81\c$\temp\file.txt isn't working. Are there any other settings I must adjust? Kinda new to Powershell.
    I'm getting the error The network path was not found.
    • Edited by JeremySky Wednesday, February 17, 2016 1:56 PM
    Wednesday, February 17, 2016 1:54 PM
  • It works just like it works on any real machine.  The rules are the same.

    Start by learning how to use sharing and how a Hyper-V machine is made visible on the network.

    None of this is about scripting.  It is fundamental Windows and Hyper-V.


    \_(ツ)_/

    Wednesday, February 17, 2016 2:00 PM
  • Thanks for all the help! This worked perfectly!
    Wednesday, February 17, 2016 2:10 PM
  • Thanks for all the help! This worked perfectly!

    What changed?

    \_(ツ)_/

    Wednesday, February 17, 2016 2:23 PM
  • Just started with my internship had to change vm name with ip-address that fixed my problem.
    Wednesday, February 17, 2016 4:06 PM